diff options
-rw-r--r-- | AuthSamples/SwiftSample/ViewController.swift | 5 | ||||
-rw-r--r-- | Firebase/Auth/FirebaseAuth.podspec | 1 | ||||
-rw-r--r-- | Firebase/Auth/Source/Public/FIRAuth.h | 28 | ||||
-rw-r--r-- | Firebase/Auth/Source/Public/FIRAuthUIDelegate.h | 5 | ||||
-rw-r--r-- | Firebase/Auth/Source/Public/FirebaseAuth.h | 1 | ||||
-rw-r--r-- | FirebaseCommunity.podspec | 1 |
6 files changed, 25 insertions, 16 deletions
diff --git a/AuthSamples/SwiftSample/ViewController.swift b/AuthSamples/SwiftSample/ViewController.swift index 14b74c4..e90b727 100644 --- a/AuthSamples/SwiftSample/ViewController.swift +++ b/AuthSamples/SwiftSample/ViewController.swift @@ -19,7 +19,7 @@ import UIKit import FirebaseCommunity.FirebaseAuth import GoogleSignIn -final class ViewController: UIViewController, UITextFieldDelegate { +final class ViewController: UIViewController, UITextFieldDelegate, FIRAuthUIDelegate { /// The profile image for the currently signed-in user. @IBOutlet weak var profileImage: UIImageView! @@ -158,7 +158,8 @@ final class ViewController: UIViewController, UITextFieldDelegate { func verify(phoneNumber: String, completion: @escaping (PhoneAuthCredential?, Error?) -> Void) { if #available(iOS 8.0, *) { - PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumber) { verificationID, error in + PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumber, uiDelegate:self) { + verificationID, error in guard error == nil else { completion(nil, error) return diff --git a/Firebase/Auth/FirebaseAuth.podspec b/Firebase/Auth/FirebaseAuth.podspec index 6d07375..86577ad 100644 --- a/Firebase/Auth/FirebaseAuth.podspec +++ b/Firebase/Auth/FirebaseAuth.podspec @@ -31,6 +31,7 @@ Simplify your iOS development, grow your user base, and monetize more effectivel 'Source/**/FIRAuthAPNSTokenType.[mh]', 'Source/**/FIRAuthAPNSToken.[mh]', 'Source/**/FIRAuthDefaultUIDelegate.[mh]', + 'Source/**/FIRAuthUIDelegate.h', 'Source/**/FIRAuthURLPresenter.[mh], 'Source/**/FIRPhoneAuthCredential.[mh]', 'Source/**/FIRPhoneAuthProvider.[mh]' diff --git a/Firebase/Auth/Source/Public/FIRAuth.h b/Firebase/Auth/Source/Public/FIRAuth.h index eeb7ff9..eabcf23 100644 --- a/Firebase/Auth/Source/Public/FIRAuth.h +++ b/Firebase/Auth/Source/Public/FIRAuth.h @@ -280,18 +280,6 @@ FIR_SWIFT_NAME(Auth) */ - (instancetype)init NS_UNAVAILABLE; -/** @fn canHandleURL: - @brief Whether the specific URL is handled by @c FIRAuth . - @param URL The URL received by the application delegate from any of the openURL method. - @return Whether or the URL is handled. YES means the URL is for Firebase Auth - so the caller should ignore the URL from further processing, and NO means the - the URL is for the app (or another libaray) so the caller should continue handling - this URL as usual. - @remarks If swizzling is disabled, URLs received by the application delegate must be forwarded - to this method for phone number auth to work. - */ -- (BOOL)canHandleURL:(nonnull NSURL *)URL; - /** @fn fetchProvidersForEmail:completion: @brief Fetches the list of IdPs that can be used for signing in with the provided email address. Useful for an "identifier-first" sign-in flow. @@ -675,6 +663,19 @@ FIR_SWIFT_NAME(Auth) - (void)useAppLanguage; #if TARGET_OS_IOS + +/** @fn canHandleURL: + @brief Whether the specific URL is handled by @c FIRAuth . + @param URL The URL received by the application delegate from any of the openURL method. + @return Whether or the URL is handled. YES means the URL is for Firebase Auth + so the caller should ignore the URL from further processing, and NO means the + the URL is for the app (or another libaray) so the caller should continue handling + this URL as usual. + @remarks If swizzling is disabled, URLs received by the application delegate must be forwarded + to this method for phone number auth to work. + */ +- (BOOL)canHandleURL:(nonnull NSURL *)URL; + /** @fn setAPNSToken:type: @brief Sets the APNs token along with its type. @remarks If swizzling is disabled, the APNs Token must be set for phone number auth to work, @@ -694,7 +695,8 @@ FIR_SWIFT_NAME(Auth) for phone number auth to work. */ - (BOOL)canHandleNotification:(NSDictionary *)userInfo; -#endif + +#endif // TARGET_OS_IOS @end diff --git a/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h b/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h index 7f9adb0..a8d0549 100644 --- a/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h +++ b/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h @@ -17,6 +17,8 @@ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> +#import "FIRAuthSwiftNameSupport.h" + NS_ASSUME_NONNULL_BEGIN /** @protocol FIRAuthUIDelegate @@ -44,7 +46,8 @@ NS_ASSUME_NONNULL_BEGIN @param completion The block to execute after the presentation finishes. This block has no return value and takes no parameters. */ -- (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^ _Nullable)(void))completion; +- (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^ _Nullable)(void))completion + FIR_SWIFT_NAME(dismiss(animated:completion:)); @end diff --git a/Firebase/Auth/Source/Public/FirebaseAuth.h b/Firebase/Auth/Source/Public/FirebaseAuth.h index 126645e..cd17b45 100644 --- a/Firebase/Auth/Source/Public/FirebaseAuth.h +++ b/Firebase/Auth/Source/Public/FirebaseAuth.h @@ -34,6 +34,7 @@ #import "FirebaseAuthVersion.h" #if TARGET_OS_IOS +#import "FIRAuthUIDelegate.h" #import "FIRPhoneAuthCredential.h" #import "FIRPhoneAuthProvider.h" #import "FIRAuthAPNSTokenType.h" diff --git a/FirebaseCommunity.podspec b/FirebaseCommunity.podspec index b6624c8..307a93d 100644 --- a/FirebaseCommunity.podspec +++ b/FirebaseCommunity.podspec @@ -43,6 +43,7 @@ Firebase Development CocoaPod including experimental and community supported fea 'Firebase/Auth/Source/**/FIRAuthAPNSTokenType.[mh]', 'Firebase/Auth/Source/**/FIRAuthAPNSToken.[mh]', 'Firebase/Auth/Source/**/FIRAuthDefaultUIDelegate.[mh]', + 'Firebase/Auth/Source/**/FIRAuthUIDelegate.h', 'Firebase/Auth/Source/**/FIRAuthURLPresenter.[mh]', 'Firebase/Auth/Source/**/FIRPhoneAuthCredential.[mh]', 'Firebase/Auth/Source/**/FIRPhoneAuthProvider.[mh]' |