diff --git a/OAuth/FirebaseOAuthUI/FUIOAuth.h b/OAuth/FirebaseOAuthUI/FUIOAuth.h index b3f095fa84e..aa992ee0229 100644 --- a/OAuth/FirebaseOAuthUI/FUIOAuth.h +++ b/OAuth/FirebaseOAuthUI/FUIOAuth.h @@ -40,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN @param authUI The @c FUIAuth instance that manages controllers of this provider. @param providerID The unique identifier for the provider. @param buttonLabelText The text label for the sign in button. + @param shortName A short display name for the provider. @param buttonColor The background color that should be used for the sign in button of the provider. @param iconImage The icon image of the provider. @@ -49,6 +50,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithAuthUI:(FUIAuth *)authUI providerID:(NSString *)providerID buttonLabelText:(NSString *)buttonLabelText + shortName:(NSString *)shortName buttonColor:(UIColor *)buttonColor iconImage:(UIImage *)iconImage scopes:(nullable NSArray *)scopes @@ -60,6 +62,7 @@ NS_ASSUME_NONNULL_BEGIN @param providerID The unique identifier for the provider. @param buttonLabelText The text label for the sign in button. + @param shortName A short display name for the provider. @param buttonColor The background color that should be used for the sign in button of the provider. @param iconImage The icon image of the provider. @@ -68,6 +71,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithProviderID:(NSString *)providerID buttonLabelText:(NSString *)buttonLabelText + shortName:(NSString *)shortName buttonColor:(UIColor *)buttonColor iconImage:(UIImage *)iconImage scopes:(nullable NSArray *)scopes diff --git a/OAuth/FirebaseOAuthUI/FUIOAuth.m b/OAuth/FirebaseOAuthUI/FUIOAuth.m index d0fbab8f5b0..6b04a9cdaef 100644 --- a/OAuth/FirebaseOAuthUI/FUIOAuth.m +++ b/OAuth/FirebaseOAuthUI/FUIOAuth.m @@ -60,6 +60,11 @@ @interface FUIOAuth () */ @property(nonatomic, copy) NSString *signInLabel; +/** @property shortName + @brief A short display name for the provider. + */ +@property(nonatomic, copy) NSString *shortName; + /** @property icon @brief The icon image of the provider. */ @@ -92,6 +97,7 @@ @implementation FUIOAuth - (instancetype)initWithAuthUI:(FUIAuth *)authUI providerID:(NSString *)providerID buttonLabelText:(NSString *)buttonLabelText + shortName:(NSString *)shortName buttonColor:(UIColor *)buttonColor iconImage:(UIImage *)iconImage scopes:(nullable NSArray *)scopes @@ -100,6 +106,7 @@ - (instancetype)initWithAuthUI:(FUIAuth *)authUI _authUI = authUI; _providerID = providerID; _signInLabel = buttonLabelText; + _shortName = shortName; _buttonBackgroundColor = buttonColor; _icon = iconImage; _scopes = scopes; @@ -113,6 +120,7 @@ - (instancetype)initWithAuthUI:(FUIAuth *)authUI - (instancetype)initWithProviderID:(NSString *)providerID buttonLabelText:(NSString *)buttonLabelText + shortName:(NSString *)shortName buttonColor:(UIColor *)buttonColor iconImage:(UIImage *)iconImage scopes:(nullable NSArray *)scopes @@ -120,6 +128,7 @@ - (instancetype)initWithProviderID:(NSString *)providerID return [self initWithAuthUI:[FUIAuth defaultAuthUI] providerID:providerID buttonLabelText:buttonLabelText + shortName:shortName buttonColor:buttonColor iconImage:iconImage scopes:scopes @@ -142,10 +151,6 @@ - (nullable NSString *)idToken { return nil; } -- (NSString *)shortName { - return @"OAuth"; -} - - (UIColor *)buttonTextColor { return [UIColor whiteColor]; } diff --git a/OAuth/FirebaseOAuthUITests/FirebaseOAuthUITests.m b/OAuth/FirebaseOAuthUITests/FirebaseOAuthUITests.m index ec4db55259b..7af434290ad 100644 --- a/OAuth/FirebaseOAuthUITests/FirebaseOAuthUITests.m +++ b/OAuth/FirebaseOAuthUITests/FirebaseOAuthUITests.m @@ -50,6 +50,7 @@ - (void)setUp { self.provider = [[FUIOAuth alloc] initWithAuthUI:authUI providerID:@"dummy" buttonLabelText:@"Sign in with dummy" + shortName:@"Dummy" buttonColor:[UIColor clearColor] iconImage:[UIImage imageNamed:@""] scopes:@[] diff --git a/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m b/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m index 7a009568c92..6500261d7df 100644 --- a/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m +++ b/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m @@ -425,6 +425,7 @@ + (NSArray *)getListOfIDPs:(NSArray *)selectedRows provider = [[FUIOAuth alloc] initWithAuthUI:[FUIAuth defaultAuthUI] providerID:@"microsoft.com" buttonLabelText:@"Sign in with Microsoft" + shortName:@"Microsoft" buttonColor:buttonColor iconImage:[UIImage imageWithContentsOfFile:iconPath] scopes:@[@"user.readwrite"]