-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Auth integration with App Multicast Delegate #8422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d65224d
f02c740
9e4f97b
9275ef5
fbf3143
51d4e96
0e27b25
218937b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,7 +77,14 @@ | |
| #import "FirebaseAuth/Sources/SystemService/FIRAuthAppCredentialManager.h" | ||
| #import "FirebaseAuth/Sources/SystemService/FIRAuthNotificationManager.h" | ||
| #import "FirebaseAuth/Sources/Utilities/FIRAuthURLPresenter.h" | ||
| #endif | ||
|
|
||
| #if SWIFT_PACKAGE | ||
| @import GoogleUtilities_MulticastAppDelegate; | ||
| #else // SWIFT_PACKAGE | ||
| #import <GoogleMulticastAppDelegate/GoogleMulticastAppDelegate-Swift.h> | ||
| #endif // SWIFT_PACKAGE | ||
|
|
||
| #endif // TARGET_OS_IOS | ||
|
|
||
| NS_ASSUME_NONNULL_BEGIN | ||
|
|
||
|
|
@@ -482,7 +489,14 @@ - (nullable instancetype)initWithAPIKey:(NSString *)APIKey appName:(NSString *)a | |
| } | ||
| UIApplication *application = [applicationClass sharedApplication]; | ||
|
|
||
| [GULAppDelegateSwizzler proxyOriginalDelegateIncludingAPNSMethods]; | ||
| // Use Multicast App Delegate when available but fallback to App Delegate Swizzler for backward compatibility. | ||
| id<GULMulticastAppDelegateProtocol> multicastDelegate = | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this in iOS specific code?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My guess is it's due to phone auth not being available on other platforms, but that was out of ease-of-implementation not any product decisions. |
||
| [GULMulticastAppDelegate installedMulticastDelegate]; | ||
| if (multicastDelegate == nil) { | ||
| FIRLogInfo(kFIRLoggerAuth, @"I-AUT000018", @"Multicast App delegate was not detected. Make sure app events forwarding is configured manually for you app. <Add link to docs>"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: long line |
||
| [GULAppDelegateSwizzler proxyOriginalDelegateIncludingAPNSMethods]; | ||
| } | ||
|
|
||
| [GULSceneDelegateSwizzler proxyOriginalSceneDelegate]; | ||
| #endif // TARGET_OS_IOS | ||
|
|
||
|
|
@@ -540,7 +554,11 @@ - (nullable instancetype)initWithAPIKey:(NSString *)APIKey appName:(NSString *)a | |
| initWithApplication:application | ||
| appCredentialManager:strongSelf->_appCredentialManager]; | ||
|
|
||
| [GULAppDelegateSwizzler registerAppDelegateInterceptor:strongSelf]; | ||
| if (multicastDelegate != nil) { | ||
| [multicastDelegate addInterceptor:strongSelf]; | ||
| } else { | ||
| [GULAppDelegateSwizzler registerAppDelegateInterceptor:strongSelf]; | ||
| } | ||
| #if ((TARGET_OS_IOS || TARGET_OS_TV) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 130000)) | ||
| if (@available(iOS 13, tvos 13, *)) { | ||
| [GULSceneDelegateSwizzler registerSceneDelegateInterceptor:strongSelf]; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,7 @@ let package = Package( | |
| .package( | ||
| name: "GoogleUtilities", | ||
| url: "https://github.com/google/GoogleUtilities.git", | ||
| "7.4.0" ..< "8.0.0" | ||
| .branch("mm/app-delegate-sample") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not merge to master. |
||
| ), | ||
| .package( | ||
| name: "GTMSessionFetcher", | ||
|
|
@@ -372,6 +372,7 @@ let package = Package( | |
| dependencies: [ | ||
| "FirebaseCore", | ||
| .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"), | ||
| .product(name: "GULMulticastAppDelegate", package: "GoogleUtilities"), | ||
| .product(name: "GULEnvironment", package: "GoogleUtilities"), | ||
| .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"), | ||
| ], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Structure public headers as documented in https://github.com/firebase/firebase-ios-sdk/blob/master/HeadersImports.md#header-file-types-and-locations---for-header-file-creators to avoid need for SPM/CocoaPods specific imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, not sure I understand how it's applicable here because there are no headers in the lib currently, but only a single Swift file. But probably it won't be relevant any more after google/GoogleUtilities#50 (comment) since we will have to re-implement the multicast delegate in Objective-C.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right. I made this comment before I saw the implementation was Swift.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Validate in Firebase