From ca46bd7fb3108f941f367b5795b23710dbe22684 Mon Sep 17 00:00:00 2001 From: Zsika Phillip Date: Thu, 14 Sep 2017 17:46:25 -0700 Subject: [PATCH 1/3] Small code clean-up changes --- .../AuthProviders/Phone/FIRPhoneAuthProvider.m | 13 +++++++++++++ Firebase/Auth/Source/FIRAuthDefaultUIDelegate.h | 5 +++++ Firebase/Auth/Source/FIRAuthURLPresenter.h | 3 +++ Firebase/Auth/Source/FIRAuthURLPresenter.m | 3 ++- Firebase/Auth/Source/FIRAuthWebView.h | 3 +++ Firebase/Auth/Source/FIRAuthWebViewController.h | 10 ++++++++-- Firebase/Auth/Source/FIRAuthWebViewController.m | 4 ++-- Firebase/Auth/Source/Public/FIRAuthUIDelegate.h | 3 +-- 8 files changed, 37 insertions(+), 7 deletions(-) diff --git a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m index 3a098a56827..a7d5a8c97ff 100644 --- a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m +++ b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m @@ -429,6 +429,13 @@ - (void)verifyClientWithCompletion:(FIRVerifyClientCallback)completion { }]; } +/** @fn reCAPTCHAURLWithEventID:completion: + @brief Constructs a URL used for openning a reCAPTCHA app verification flow for a given event + ID. + @param eventID The event ID used for this purpose. + @param completion The callback invoked after the URL has been constructed or an error + has been encountered. + */ - (void)reCAPTCHAURLWithEventID:(NSString *)eventID completion:(FIRReCAPTCHAURLCallBack)completion { [self fetchAuthDomainWithCompletion:^(NSString *_Nullable authDomain, NSError *_Nullable error) { @@ -457,6 +464,12 @@ - (void)reCAPTCHAURLWithEventID:(NSString *)eventID completion:(FIRReCAPTCHAURLC }]; } + +/** @fn fetchAuthDomainWithCompletion:completion: + @brief Fetches the auth domain associated with the Firebase Project. + @param completion The callback invoked after the auth domain has been constructed or an error + has been encountered. + */ - (void)fetchAuthDomainWithCompletion:(FIRFetchAuthDomainCallback)completion { FIRGetProjectConfigRequest *request = [[FIRGetProjectConfigRequest alloc] initWithRequestConfiguration:_auth.requestConfiguration]; diff --git a/Firebase/Auth/Source/FIRAuthDefaultUIDelegate.h b/Firebase/Auth/Source/FIRAuthDefaultUIDelegate.h index f0e5d805847..03cadf7ee46 100644 --- a/Firebase/Auth/Source/FIRAuthDefaultUIDelegate.h +++ b/Firebase/Auth/Source/FIRAuthDefaultUIDelegate.h @@ -20,6 +20,11 @@ NS_ASSUME_NONNULL_BEGIN +/** @class FIRAuthDefaultUIDelegate + @brief Class responsible for providing a default FIRAuthUIDelegte. + @remarks This class should be used in the case that a UIDelegate was expected and necessary to + continue a given flow, but none was provided. + */ @interface FIRAuthDefaultUIDelegate : NSObject /** @fn defaultUIDelegate diff --git a/Firebase/Auth/Source/FIRAuthURLPresenter.h b/Firebase/Auth/Source/FIRAuthURLPresenter.h index 694b3982d2f..6068214a6ee 100644 --- a/Firebase/Auth/Source/FIRAuthURLPresenter.h +++ b/Firebase/Auth/Source/FIRAuthURLPresenter.h @@ -35,6 +35,9 @@ typedef void (^FIRAuthURLPresentationCompletion)(NSURL *_Nullable callbackURL, */ typedef BOOL (^FIRAuthURLCallbackMatcher)(NSURL * _Nullable callbackURL); +/** @class FIRAuthURLPresenter + @brief Class responsible for presenting URL via SFSafariViewController or UIWebView. + */ @interface FIRAuthURLPresenter : NSObject /** @fn presentURL:UIDelegate:callbackMatcher:completion: diff --git a/Firebase/Auth/Source/FIRAuthURLPresenter.m b/Firebase/Auth/Source/FIRAuthURLPresenter.m index d923c8a7c8c..9e24805f1d6 100644 --- a/Firebase/Auth/Source/FIRAuthURLPresenter.m +++ b/Firebase/Auth/Source/FIRAuthURLPresenter.m @@ -26,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN -@interface FIRAuthURLPresenter () +@interface FIRAuthURLPresenter () @end @implementation FIRAuthURLPresenter { diff --git a/Firebase/Auth/Source/FIRAuthWebView.h b/Firebase/Auth/Source/FIRAuthWebView.h index f4a8d1b6781..0f7bce52ccd 100644 --- a/Firebase/Auth/Source/FIRAuthWebView.h +++ b/Firebase/Auth/Source/FIRAuthWebView.h @@ -18,6 +18,9 @@ NS_ASSUME_NONNULL_BEGIN +/** @class FIRAuthWebView + @brief Reponsible for creating a UIWebview for use within Firebase Auth. + */ @interface FIRAuthWebView : UIView /** @property webView diff --git a/Firebase/Auth/Source/FIRAuthWebViewController.h b/Firebase/Auth/Source/FIRAuthWebViewController.h index 5c2c0423f16..36b42540b23 100644 --- a/Firebase/Auth/Source/FIRAuthWebViewController.h +++ b/Firebase/Auth/Source/FIRAuthWebViewController.h @@ -20,7 +20,10 @@ NS_ASSUME_NONNULL_BEGIN -@protocol FIRAuthWebViewDelegate +/** @protocol FIRAuthWebViewControllerDelegate + @brief Defines a delegate for FIRAuthWebViewController + */ +@protocol FIRAuthWebViewControllerDelegate /** @fn webViewController:canHandleURL: @brief Determines if a URL should be handled by the delegate. @@ -45,6 +48,9 @@ NS_ASSUME_NONNULL_BEGIN @end +/** @class FIRAuthWebView + @brief Reponsible for creating a UIViewController for presenting a FIRAutWebView. + */ @interface FIRAuthWebViewController : UIViewController /** @fn initWithNibName:bundle: @@ -59,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; - (instancetype)initWithURL:(NSURL *)URL - delegate:(__weak id)delegate + delegate:(__weak id)delegate NS_DESIGNATED_INITIALIZER; @end diff --git a/Firebase/Auth/Source/FIRAuthWebViewController.m b/Firebase/Auth/Source/FIRAuthWebViewController.m index b9a2473690f..a3ab06ae798 100644 --- a/Firebase/Auth/Source/FIRAuthWebViewController.m +++ b/Firebase/Auth/Source/FIRAuthWebViewController.m @@ -32,7 +32,7 @@ @implementation FIRAuthWebViewController { /** @var _delegate @brief The delegate to call. */ - __weak id _delegate; + __weak id _delegate; /** @var _webView; @brief The web view instance for easier access. @@ -41,7 +41,7 @@ @implementation FIRAuthWebViewController { } - (instancetype)initWithURL:(NSURL *)URL - delegate:(__weak id)delegate { + delegate:(__weak id)delegate { self = [super initWithNibName:nil bundle:nil]; if (self) { _URL = URL; diff --git a/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h b/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h index a8d0549a100..ee044dc2568 100644 --- a/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h +++ b/Firebase/Auth/Source/Public/FIRAuthUIDelegate.h @@ -23,8 +23,7 @@ NS_ASSUME_NONNULL_BEGIN /** @protocol FIRAuthUIDelegate @brief A protocol to handle user interface interactions for Firebase Auth. -*/ - + */ @protocol FIRAuthUIDelegate /** @fn presentViewController:animated:completion: From d1a76b0f00aa882c191d060203b8da941ee85876 Mon Sep 17 00:00:00 2001 From: Zsika Phillip Date: Thu, 14 Sep 2017 17:51:01 -0700 Subject: [PATCH 2/3] Fixes typos --- Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m | 2 +- Firebase/Auth/Source/FIRAuthURLPresenter.h | 2 +- Firebase/Auth/Source/FIRAuthWebView.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m index a7d5a8c97ff..5d22fc42233 100644 --- a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m +++ b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m @@ -430,7 +430,7 @@ - (void)verifyClientWithCompletion:(FIRVerifyClientCallback)completion { } /** @fn reCAPTCHAURLWithEventID:completion: - @brief Constructs a URL used for openning a reCAPTCHA app verification flow for a given event + @brief Constructs a URL used for opening a reCAPTCHA app verification flow using a given event ID. @param eventID The event ID used for this purpose. @param completion The callback invoked after the URL has been constructed or an error diff --git a/Firebase/Auth/Source/FIRAuthURLPresenter.h b/Firebase/Auth/Source/FIRAuthURLPresenter.h index 6068214a6ee..a886a3ec2ba 100644 --- a/Firebase/Auth/Source/FIRAuthURLPresenter.h +++ b/Firebase/Auth/Source/FIRAuthURLPresenter.h @@ -36,7 +36,7 @@ typedef void (^FIRAuthURLPresentationCompletion)(NSURL *_Nullable callbackURL, typedef BOOL (^FIRAuthURLCallbackMatcher)(NSURL * _Nullable callbackURL); /** @class FIRAuthURLPresenter - @brief Class responsible for presenting URL via SFSafariViewController or UIWebView. + @brief A Class responsible for presenting URL via SFSafariViewController or UIWebView. */ @interface FIRAuthURLPresenter : NSObject diff --git a/Firebase/Auth/Source/FIRAuthWebView.h b/Firebase/Auth/Source/FIRAuthWebView.h index 0f7bce52ccd..28af833a8f2 100644 --- a/Firebase/Auth/Source/FIRAuthWebView.h +++ b/Firebase/Auth/Source/FIRAuthWebView.h @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN /** @class FIRAuthWebView - @brief Reponsible for creating a UIWebview for use within Firebase Auth. + @brief A class reponsible for creating a UIWebview for use within Firebase Auth. */ @interface FIRAuthWebView : UIView From 963207b92c87bfeb2ddc531cf1021b31b8109b25 Mon Sep 17 00:00:00 2001 From: Zsika Phillip Date: Fri, 15 Sep 2017 14:52:04 -0700 Subject: [PATCH 3/3] Addresses comment --- Firebase/Auth/Source/FIRAuthWebViewController.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firebase/Auth/Source/FIRAuthWebViewController.h b/Firebase/Auth/Source/FIRAuthWebViewController.h index 36b42540b23..4bf9678cae9 100644 --- a/Firebase/Auth/Source/FIRAuthWebViewController.h +++ b/Firebase/Auth/Source/FIRAuthWebViewController.h @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN @end -/** @class FIRAuthWebView +/** @class FIRAuthWebViewController @brief Reponsible for creating a UIViewController for presenting a FIRAutWebView. */ @interface FIRAuthWebViewController : UIViewController