@@ -79,6 +79,11 @@ @interface FUIOAuth () <ASAuthorizationControllerDelegate, ASAuthorizationContro
7979 */
8080@property (nonatomic , strong ) UIColor *buttonBackgroundColor;
8181
82+ /* * @property buttonTextColor
83+ @brief The text color that should be used for the sign in button of the provider.
84+ */
85+ @property (nonatomic , readwrite ) UIColor *buttonTextColor;
86+
8287/* * @property scopes
8388 @brief Array used to configure the OAuth scopes.
8489 */
@@ -118,6 +123,7 @@ - (instancetype)initWithAuthUI:(FUIAuth *)authUI
118123 _signInLabel = buttonLabelText;
119124 _shortName = shortName;
120125 _buttonBackgroundColor = buttonColor;
126+ _buttonTextColor = [UIColor whiteColor ];
121127 _icon = iconImage;
122128 _scopes = scopes;
123129 _customParameters = customParameters;
@@ -185,17 +191,26 @@ + (FUIOAuth *)yahooAuthProvider {
185191}
186192
187193+ (FUIOAuth *)appleAuthProvider {
194+ UIImage *iconImage = [FUIAuthUtils imageNamed: @" ic_apple"
195+ fromBundleNameOrNil: @" FirebaseOAuthUI" ];
196+ UIColor *buttonColor = [UIColor blackColor ];
197+ UIColor *buttonTextColor = [UIColor whiteColor ];
198+ if (UITraitCollection.currentTraitCollection .userInterfaceStyle == UIUserInterfaceStyleLight) {
199+ iconImage = [iconImage imageWithTintColor: [UIColor blackColor ]];
200+ buttonColor = [UIColor whiteColor ];
201+ buttonTextColor = [UIColor blackColor ];
202+ }
188203 FUIOAuth *provider = [[FUIOAuth alloc ] initWithAuthUI: [FUIAuth defaultAuthUI ]
189204 providerID: @" apple.com"
190205 buttonLabelText: @" Sign in with Apple"
191206 shortName: @" Apple"
192- buttonColor: [UIColor colorWithRed: 0.0 green: 0.0 blue: 0.0 alpha: 1.0 ]
193- iconImage: [FUIAuthUtils imageNamed: @" ic_apple"
194- fromBundleNameOrNil: @" FirebaseOAuthUI" ]
207+ buttonColor: buttonColor
208+ iconImage: iconImage
195209 scopes: @[@" name" , @" email" ]
196210 customParameters: nil
197211 loginHintKey: nil ];
198212 provider.buttonAlignment = FUIButtonAlignmentCenter;
213+ provider.buttonTextColor = buttonTextColor;
199214 return provider;
200215}
201216
@@ -215,10 +230,6 @@ - (nullable NSString *)idToken {
215230 return nil ;
216231}
217232
218- - (UIColor *)buttonTextColor {
219- return [UIColor whiteColor ];
220- }
221-
222233#pragma clang diagnostic push
223234#pragma clang diagnostic ignored "-Wdeprecated-implementations"
224235- (void )signInWithEmail : (nullable NSString *)email
0 commit comments