@@ -141,36 +141,49 @@ - (instancetype)initWithAuthUI:(FUIAuth *)authUI
141141}
142142
143143+ (FUIOAuth *)twitterAuthProvider {
144- return [[FUIOAuth alloc ] initWithAuthUI: [FUIAuth defaultAuthUI ]
145- providerID: @" twitter.com"
146- buttonLabelText: @" Sign in with Twitter"
147- shortName: @" Twitter"
148- buttonColor: [UIColor colorWithRed: 71 .0f /255 .0f
149- green: 154 .0f /255 .0f
150- blue: 234 .0f /255 .0f
151- alpha: 1 .0f ]
152- iconImage: [FUIAuthUtils imageNamed: @" ic_twitter"
153- fromBundle: [FUIOAuth bundle ]]
154- scopes: @[@" user.readwrite" ]
155- customParameters: @{@" prompt" : @" consent" }
156- loginHintKey: nil ];
144+ return [FUIOAuth twitterAuthProviderWithAuthUI: [FUIAuth defaultAuthUI ]];
145+ }
146+
147+ + (FUIOAuth *)twitterAuthProviderWithAuthUI : (FUIAuth *)authUI {
148+ return [[FUIOAuth alloc ] initWithAuthUI: authUI
149+ providerID: @" twitter.com"
150+ buttonLabelText: @" Sign in with Twitter"
151+ shortName: @" Twitter"
152+ buttonColor: [UIColor colorWithRed: 71 .0f /255 .0f
153+ green: 154 .0f /255 .0f
154+ blue: 234 .0f /255 .0f
155+ alpha: 1 .0f ]
156+ iconImage: [FUIAuthUtils imageNamed: @" ic_twitter"
157+ fromBundle: [FUIOAuth bundle ]]
158+ scopes: @[@" user.readwrite" ]
159+ customParameters: @{@" prompt" : @" consent" }
160+ loginHintKey: nil ];
157161}
158162
159163+ (FUIOAuth *)githubAuthProvider {
160- return [[FUIOAuth alloc ] initWithAuthUI: [FUIAuth defaultAuthUI ]
161- providerID: @" github.com"
162- buttonLabelText: @" Sign in with GitHub"
163- shortName: @" GitHub"
164- buttonColor: [UIColor colorWithRed: 0.2 green: 0.2 blue: 0.2 alpha: 1.0 ]
165- iconImage: [FUIAuthUtils imageNamed: @" ic_github"
166- fromBundle: [FUIOAuth bundle ]]
167- scopes: nil
168- customParameters: nil
169- loginHintKey: nil ];
164+ return [FUIOAuth githubAuthProviderWithAuthUI: [FUIAuth defaultAuthUI ]];
165+ }
166+
167+ + (FUIOAuth *)githubAuthProviderWithAuthUI : (FUIAuth *)authUI
168+ {
169+ return [[FUIOAuth alloc ] initWithAuthUI: authUI
170+ providerID: @" github.com"
171+ buttonLabelText: @" Sign in with GitHub"
172+ shortName: @" GitHub"
173+ buttonColor: [UIColor colorWithRed: 0.2 green: 0.2 blue: 0.2 alpha: 1.0 ]
174+ iconImage: [FUIAuthUtils imageNamed: @" ic_github"
175+ fromBundle: [FUIOAuth bundle ]]
176+ scopes: nil
177+ customParameters: nil
178+ loginHintKey: nil ];
170179}
171180
172181+ (FUIOAuth *)microsoftAuthProvider {
173- return [[FUIOAuth alloc ] initWithAuthUI: [FUIAuth defaultAuthUI ]
182+ return [FUIOAuth microsoftAuthProviderWithAuthUI: [FUIAuth defaultAuthUI ]];
183+ }
184+
185+ + (FUIOAuth *)microsoftAuthProviderWithAuthUI : (FUIAuth *)authUI {
186+ return [[FUIOAuth alloc ] initWithAuthUI: authUI
174187 providerID: @" microsoft.com"
175188 buttonLabelText: @" Sign in with Microsoft"
176189 shortName: @" Microsoft"
@@ -183,7 +196,11 @@ + (FUIOAuth *)microsoftAuthProvider {
183196}
184197
185198+ (FUIOAuth *)yahooAuthProvider {
186- return [[FUIOAuth alloc ] initWithAuthUI: [FUIAuth defaultAuthUI ]
199+ return [FUIOAuth yahooAuthProviderWithAuthUI: [FUIAuth defaultAuthUI ]];
200+ }
201+
202+ + (FUIOAuth *)yahooAuthProviderWithAuthUI : (FUIAuth *)authUI {
203+ return [[FUIOAuth alloc ] initWithAuthUI: authUI
187204 providerID: @" yahoo.com"
188205 buttonLabelText: @" Sign in with Yahoo"
189206 shortName: @" Yahoo"
@@ -196,11 +213,19 @@ + (FUIOAuth *)yahooAuthProvider {
196213}
197214
198215+ (FUIOAuth *)appleAuthProvider {
216+ return [FUIOAuth appleAuthProviderWithAuthUI: [FUIAuth defaultAuthUI ]];
217+ }
218+
219+ + (FUIOAuth *)appleAuthProviderWithAuthUI : (FUIAuth *)authUI {
199220 UIUserInterfaceStyle style = UITraitCollection.currentTraitCollection .userInterfaceStyle ;
200- return [self appleAuthProviderWithUserInterfaceStyle : style];
221+ return [self appleAuthProviderWithAuthUI: authUI userInterfaceStyle : style];
201222}
202223
203224+ (FUIOAuth *)appleAuthProviderWithUserInterfaceStyle : (UIUserInterfaceStyle)userInterfaceStyle {
225+ return [FUIOAuth appleAuthProviderWithAuthUI: [FUIAuth defaultAuthUI ] userInterfaceStyle: userInterfaceStyle];
226+ }
227+
228+ + (FUIOAuth *)appleAuthProviderWithAuthUI : (FUIAuth *)authUI userInterfaceStyle : (UIUserInterfaceStyle)userInterfaceStyle {
204229 UIImage *iconImage = [FUIAuthUtils imageNamed: @" ic_apple"
205230 fromBundle: [FUIOAuth bundle ]];
206231 UIColor *buttonColor = [UIColor blackColor ];
@@ -216,7 +241,7 @@ + (FUIOAuth *)appleAuthProviderWithUserInterfaceStyle:(UIUserInterfaceStyle)user
216241 } else {
217242 iconImage = [iconImage imageWithTintColor: [UIColor whiteColor ]];
218243 }
219- FUIOAuth *provider = [[FUIOAuth alloc ] initWithAuthUI: [FUIAuth defaultAuthUI ]
244+ FUIOAuth *provider = [[FUIOAuth alloc ] initWithAuthUI: authUI
220245 providerID: @" apple.com"
221246 buttonLabelText: @" Sign in with Apple"
222247 shortName: @" Apple"
0 commit comments