Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions OAuth/FirebaseOAuthUI/FUIOAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<NSString *> *)scopes
Expand All @@ -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.
Expand All @@ -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<NSString *> *)scopes
Expand Down
13 changes: 9 additions & 4 deletions OAuth/FirebaseOAuthUI/FUIOAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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<NSString *> *)scopes
Expand All @@ -100,6 +106,7 @@ - (instancetype)initWithAuthUI:(FUIAuth *)authUI
_authUI = authUI;
_providerID = providerID;
_signInLabel = buttonLabelText;
_shortName = shortName;
_buttonBackgroundColor = buttonColor;
_icon = iconImage;
_scopes = scopes;
Expand All @@ -113,13 +120,15 @@ - (instancetype)initWithAuthUI:(FUIAuth *)authUI

- (instancetype)initWithProviderID:(NSString *)providerID
buttonLabelText:(NSString *)buttonLabelText
shortName:(NSString *)shortName
buttonColor:(UIColor *)buttonColor
iconImage:(UIImage *)iconImage
scopes:(nullable NSArray<NSString *> *)scopes
customParameters:(nullable NSDictionary<NSString *, NSString*> *)customParameters {
return [self initWithAuthUI:[FUIAuth defaultAuthUI]
providerID:providerID
buttonLabelText:buttonLabelText
shortName:shortName
buttonColor:buttonColor
iconImage:iconImage
scopes:scopes
Expand All @@ -142,10 +151,6 @@ - (nullable NSString *)idToken {
return nil;
}

- (NSString *)shortName {
return @"OAuth";
}

- (UIColor *)buttonTextColor {
return [UIColor whiteColor];
}
Expand Down
1 change: 1 addition & 0 deletions OAuth/FirebaseOAuthUITests/FirebaseOAuthUITests.m
Original file line number Diff line number Diff line change
Expand Up @@ -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:@[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ + (NSArray *)getListOfIDPs:(NSArray<NSIndexPath *> *)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"]
Expand Down