@@ -47,8 +47,8 @@ Auth guides at the following links:
47
47
48
48
### Configuration
49
49
50
- All operations, callbacks, UI customizations are done through an ` FIRAuthUI `
51
- instance. The ` FIRAuthUI ` instance associated with the default ` FIRAuth `
50
+ All operations, callbacks, UI customizations are done through an ` FUIAuth `
51
+ instance. The ` FUIAuth ` instance associated with the default ` FIRAuth `
52
52
instance can be accessed as follows:
53
53
54
54
``` swift
@@ -59,8 +59,8 @@ import FirebaseAuthUI
59
59
/* ... */
60
60
61
61
FIRApp.configure ()
62
- let authUI = FIRAuthUI .default ()
63
- // You need to adopt a FIRAuthUIDelegate protocol to receive callback
62
+ let authUI = FUIAuth .default ()
63
+ // You need to adopt a FUIAuthDelegate protocol to receive callback
64
64
authUI? .delegate = self
65
65
```
66
66
@@ -70,8 +70,8 @@ authUI?.delegate = self
70
70
@import FirebaseAuthUI
71
71
...
72
72
[FIRApp configure ];
73
- FIRAuthUI *authUI = [FIRAuthUI defaultAuthUI ];
74
- // You need to adopt a FIRAuthUIDelegate protocol to receive callback
73
+ FUIAuth *authUI = [FUIAuth defaultAuthUI ];
74
+ // You need to adopt a FUIAuthDelegate protocol to receive callback
75
75
authUI.delegate = self;
76
76
```
77
77
@@ -83,10 +83,10 @@ import FirebaseGoogleAuthUI
83
83
import FirebaseFacebookAuthUI
84
84
import FirebaseTwitterAuthUI
85
85
86
- let providers: [FIRAuthProviderUI ] = [
87
- FIRGoogleAuthUI (),
88
- FIRFacebookAuthUI (),
89
- FIRTwitterAuthUI (),
86
+ let providers: [FUIAuthProvider ] = [
87
+ FUIGoogleAuth (),
88
+ FUIFacebookAuth (),
89
+ FUITwitterAuth (),
90
90
]
91
91
self .authUI ? .providers = providers
92
92
```
@@ -95,12 +95,12 @@ self.authUI?.providers = providers
95
95
// objc
96
96
@import FirebaseGoogleAuthUI
97
97
@import FirebaseFacebookAuthUI
98
- @import FIRTwitterAuthUI
98
+ @import FUITwitterAuth
99
99
...
100
- NSArray <id <FIRAuthProviderUI >> *providers = @[
101
- [[FIRGoogleAuthUI alloc ] init ],
102
- [[FIRFacebookAuthUI alloc ] init ],
103
- [[FIRTwitterAuthUI alloc ] init ],
100
+ NSArray <id <FUIAuthProvider >> *providers = @[
101
+ [[FUIGoogleAuth alloc ] init ],
102
+ [[FUIFacebookAuth alloc ] init ],
103
+ [[FUITwitterAuth alloc ] init ],
104
104
];
105
105
_authUI.providers = providers;
106
106
```
@@ -119,7 +119,7 @@ Google/Facebook authentication process.
119
119
// swift
120
120
func application (_ app : UIApplication, open url : URL, options : [UIApplicationOpenURLOptionsKey : Any ]) -> Bool {
121
121
let sourceApplication = options[UIApplicationOpenURLOptionsKey.sourceApplication ] as! String ?
122
- if FIRAuthUI. default ()? .handleOpen (url, sourceApplication : sourceApplication) ?? false {
122
+ if FUIAuth. defaultAuthUI ()? .handleOpen (url, sourceApplication : sourceApplication) ?? false {
123
123
return true
124
124
}
125
125
// other URL handling goes here.
@@ -131,14 +131,14 @@ func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpe
131
131
// objc
132
132
- (BOOL )application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {
133
133
NSString * sourceApplication = options[ UIApplicationOpenURLOptionsSourceApplicationKey] ;
134
- return [[ FIRAuthUI defaultAuthUI] handleOpenURL: url sourceApplication: sourceApplication ] ;
134
+ return [[ FUIAuth defaultAuthUI] handleOpenURL: url sourceApplication: sourceApplication ] ;
135
135
}
136
136
```
137
137
138
138
### Sign In
139
139
140
140
To start the authentication flow, obtain an ` authViewController ` instance from
141
- ` FIRAuthUI ` . In order to leverage FirebaseUI for iOS you must display the
141
+ ` FUIAuth ` . In order to leverage FirebaseUI for iOS you must display the
142
142
` authViewController ` ; you can present it as the first view controller of your
143
143
app or present it from another view controller within your app. In order to
144
144
present the ` authViewController ` obtain as instance as follows:
@@ -149,7 +149,7 @@ present the `authViewController` obtain as instance as follows:
149
149
// Present the auth view controller and then implement the sign in callback.
150
150
let authViewController = authUI! .authViewController ()
151
151
152
- func authUI (_ authUI : FIRAuthUI , didSignInWith user : FIRUser? , error : Error ? ) {
152
+ func authUI (_ authUI : FUIAuth , didSignInWith user : FIRUser? , error : Error ? ) {
153
153
// handle user and error as necessary
154
154
}
155
155
```
@@ -160,7 +160,7 @@ UINavigationController *authViewController = [authUI authViewController];
160
160
// Use authViewController as your root view controller,
161
161
// or present it on top of an existing view controller.
162
162
163
- - (void )authUI:(FIRAuthUI *)authUI didSignInWithUser:(nullable FIRUser *)user error:(nullable NSError *)error {
163
+ - (void )authUI:(FUIAuth *)authUI didSignInWithUser:(nullable FIRUser *)user error:(nullable NSError *)error {
164
164
// Implement this method to handle signed in user or error if any.
165
165
}
166
166
```
@@ -209,21 +209,21 @@ should have the same key as its counterpart in the default `.strings` files.
209
209
You can customize everything about the authentication method picker screen,
210
210
except for the actual sign-in buttons and their position.
211
211
212
- In order to do so, create a subclass of ` FIRAuthPickerViewController ` and
213
- customize it to your needs. Provide ` FIRAuthUI ` with an instance of your
212
+ In order to do so, create a subclass of ` FUIAuthPickerViewController ` and
213
+ customize it to your needs. Provide ` FUIAuth ` with an instance of your
214
214
subclass by implementing the delegate method
215
215
` authPickerViewControllerForAuthUI: ` as follows:
216
216
217
217
``` swift
218
218
// swift
219
- func authPickerViewController (for authUI : FIRAuthUI ) -> FIRAuthPickerViewController {
219
+ func authPickerViewController (for authUI : FUIAuth ) -> FUIAuthPickerViewController {
220
220
return CustomAuthPickerViewController (authUI : authUI)
221
221
}
222
222
```
223
223
224
224
``` objective-c
225
225
// objc
226
- - (FIRAuthPickerViewController *)authPickerViewControllerForAuthUI:(FIRAuthUI *)authUI {
226
+ - (FUIAuthPickerViewController *)authPickerViewControllerForAuthUI:(FUIAuth *)authUI {
227
227
return [[ CustomAuthPickerViewController alloc] initWithAuthUI: authUI ] ;
228
228
}
229
229
```
@@ -239,61 +239,61 @@ Things that are not customizable:
239
239
- modification of screen flow (you can't combine screens, skip particular screens)
240
240
- disabling validation (e g email validation)
241
241
242
- In order to achieve email provider screen customization, create subclass of appropriate controller and implement it to your needs. Provide ` FIRAuthUI ` with an instance of your
242
+ In order to achieve email provider screen customization, create subclass of appropriate controller and implement it to your needs. Provide ` FUIAuth ` with an instance of your
243
243
subclass by implementing the delegate methods:
244
244
``` swift
245
245
// swift
246
- func emailEntryViewController (for authUI : FIRAuthUI ) -> FIREmailEntryViewController {
246
+ func emailEntryViewController (for authUI : FUIAuth ) -> FUIEmailEntryViewController {
247
247
return CustomEmailEntryViewController (authUI : authUI)
248
248
}
249
249
250
- func passwordSignInViewController (for authUI : FIRAuthUI , email : String ) -> FIRPasswordSignInViewController {
250
+ func passwordSignInViewController (for authUI : FUIAuth , email : String ) -> FUIPasswordSignInViewController {
251
251
return CustomPasswordSignInViewController (authUI : authUI, email : email)
252
252
}
253
253
254
- func passwordSignUpViewController (for authUI : FIRAuthUI , email : String ) -> FIRPasswordSignUpViewController {
254
+ func passwordSignUpViewController (for authUI : FUIAuth , email : String ) -> FUIPasswordSignUpViewController {
255
255
return CustomPasswordSignUpViewController (authUI : authUI, email : email)
256
256
}
257
257
258
- func passwordRecoveryViewController (for authUI : FIRAuthUI , email : String ) -> FIRPasswordRecoveryViewController {
258
+ func passwordRecoveryViewController (for authUI : FUIAuth , email : String ) -> FUIPasswordRecoveryViewController {
259
259
return CustomPasswordRecoveryViewController (authUI : authUI, email : email)
260
260
}
261
261
262
- func passwordVerificationViewController (for authUI : FIRAuthUI , email : String , newCredential : FIRAuthCredential) -> FIRPasswordVerificationViewController {
262
+ func passwordVerificationViewController (for authUI : FUIAuth , email : String , newCredential : FIRAuthCredential) -> FUIPasswordVerificationViewController {
263
263
return CustomPasswordVerificationViewController (authUI : authUI, email : email, newCredential : newCredential)
264
264
}
265
265
266
266
```
267
267
268
268
``` objective-c
269
269
// objc
270
- - (FIREmailEntryViewController *)emailEntryViewControllerForAuthUI:(FIRAuthUI *)authUI {
270
+ - (FUIEmailEntryViewController *)emailEntryViewControllerForAuthUI:(FUIAuth *)authUI {
271
271
return [[ CustomEmailEntryViewController alloc] initWithAuthUI: authUI ] ;
272
272
273
273
}
274
274
275
- - (FIRPasswordSignInViewController *)passwordSignInViewControllerForAuthUI:(FIRAuthUI *)authUI
275
+ - (FUIPasswordSignInViewController *)passwordSignInViewControllerForAuthUI:(FUIAuth *)authUI
276
276
email:(NSString *)email {
277
277
return [[ CustomPasswordSignInViewController alloc] initWithAuthUI: authUI
278
278
email: email ] ;
279
279
280
280
}
281
281
282
- - (FIRPasswordSignUpViewController *)passwordSignUpViewControllerForAuthUI:(FIRAuthUI *)authUI
282
+ - (FUIPasswordSignUpViewController *)passwordSignUpViewControllerForAuthUI:(FUIAuth *)authUI
283
283
email:(NSString *)email {
284
284
return [[ CustomPasswordSignUpViewController alloc] initWithAuthUI: authUI
285
285
email: email ] ;
286
286
287
287
}
288
288
289
- - (FIRPasswordRecoveryViewController *)passwordRecoveryViewControllerForAuthUI:(FIRAuthUI *)authUI
289
+ - (FUIPasswordRecoveryViewController *)passwordRecoveryViewControllerForAuthUI:(FUIAuth *)authUI
290
290
email:(NSString *)email {
291
291
return [[ CustomPasswordRecoveryViewController alloc] initWithAuthUI: authUI
292
292
email: email ] ;
293
293
294
294
}
295
295
296
- - (FIRPasswordVerificationViewController *)passwordVerificationViewControllerForAuthUI:(FIRAuthUI *)authUI
296
+ - (FUIPasswordVerificationViewController *)passwordVerificationViewControllerForAuthUI:(FUIAuth *)authUI
297
297
email:(NSString *)email
298
298
newCredential:(FIRAuthCredential *)newCredential {
299
299
return [[ CustomPasswordVerificationViewController alloc] initWithAuthUI: authUI
@@ -308,4 +308,4 @@ While customizing call original methods (see subclassed header). Most frequent b
308
308
- ` - (void)onBack; `
309
309
- ` - (void)cancelAuthorization; `
310
310
311
- You can refer to objective-c and swift samples to see how customization can be achieved.
311
+ You can refer to objective-c and swift samples to see how customization can be achieved.
0 commit comments