diff options
author | Zsika Phillip <protocol86@users.noreply.github.com> | 2017-09-04 17:37:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-04 17:37:46 -0700 |
commit | 85e81371801f9cd3e94a1505ce3b2f4f66086b08 (patch) | |
tree | 220fdf17ff9aed20e865bf019dd7dad805458fab /Firebase/Auth/Source/Public | |
parent | 540e21c0cc3206a8e911554227cc1f081ef40dda (diff) |
Adds app verification alternative (#228)
* Adds app verification alternative
Diffstat (limited to 'Firebase/Auth/Source/Public')
-rw-r--r-- | Firebase/Auth/Source/Public/FIRAuth.h | 12 | ||||
-rw-r--r-- | Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h | 24 |
2 files changed, 36 insertions, 0 deletions
diff --git a/Firebase/Auth/Source/Public/FIRAuth.h b/Firebase/Auth/Source/Public/FIRAuth.h index ad6b635..eeb7ff9 100644 --- a/Firebase/Auth/Source/Public/FIRAuth.h +++ b/Firebase/Auth/Source/Public/FIRAuth.h @@ -280,6 +280,18 @@ 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. diff --git a/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h b/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h index 138028a..5acc500 100644 --- a/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h +++ b/Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h @@ -20,6 +20,7 @@ @class FIRAuth; @class FIRPhoneAuthCredential; +@protocol FIRAuthUIDelegate; NS_ASSUME_NONNULL_BEGIN @@ -85,6 +86,29 @@ FIR_SWIFT_NAME(PhoneAuthProvider) - (void)verifyPhoneNumber:(NSString *)phoneNumber completion:(nullable FIRVerificationResultCallback)completion; +/** @fn verifyPhoneNumber:UIDelegate:completion: + @brief Starts the phone number authentication flow by sending a verifcation code to the + specified phone number. + @param phoneNumber The phone number to be verified. + @param UIDelegate A view controller object used to present the SFSafariViewController or + WKWebview. + @param completion The callback to be invoked when the verification flow is finished. + @remarks Possible error codes: + <ul> + <li>@c FIRAuthErrorCodeCaptchaCheckFailed - Indicates that the reCAPTCHA token obtained by + the Firebase Auth is invalid or has expired.</li> + <li>@c FIRAuthErrorCodeQuotaExceeded - Indicates that the phone verification quota for this + project has been exceeded.</li> + <li>@c FIRAuthErrorCodeInvalidPhoneNumber - Indicates that the phone number provided is + invalid.</li> + <li>@c FIRAuthErrorCodeMissingPhoneNumber - Indicates that a phone number was not provided. + </li> + </ul> + */ +- (void)verifyPhoneNumber:(NSString *)phoneNumber + UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate + completion:(nullable FIRVerificationResultCallback)completion; + /** @fn credentialWithVerificationID:verificationCode: @brief Creates an @c FIRAuthCredential for the phone number provider identified by the verification ID and verification code. |