Skip to content

Commit 8c7cc1d

Browse files
committed
Update Firebase Phone Auth docs.
1 parent 508021c commit 8c7cc1d

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

FirebasePhoneAuthUI/README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ You can use Firebase Phone Authentication to sign in a user by sending an SMS me
77
1. [Installation](#installation)
88
1. [Integration](#using-firebasephoneui-for-authentication)
99
1. [Customization](#customizing)
10+
1. [Integration cheat sheet](#integration-cheat-sheet)
1011

1112
## Installation
1213
### Importing FirebaseUI Phone Auth components
@@ -69,4 +70,39 @@ FUIPhoneAuth *phoneProvider = [FUIAuth defaultAuthUI].providers.firstObject;
6970
```
7071
7172
## Customizing
72-
Customizing of Phone Auth is planned to be implemented in 2017 Q4
73+
Customizing of Phone Auth is planned to be implemented in 2017 Q4
74+
75+
## Integration cheat sheet
76+
Here you can find steps things that need to be checked in case of any issues with Firebase Phone Auth integration problems.
77+
78+
In case need to handle push notifications yourself:
79+
80+
1. Add `APNS Key` or `APNS cert` to Firebase console project.
81+
<br>If `APNS cert` is used than check that you uploaded certificate with the same `bundleID` as Firebase iOS app `bundleID`.
82+
1. In the Xcode `Project settings` -> `Capabilities` enable `Push Notifications`
83+
1. In the project `Info.plist` set to `NO` value of `FirebaseAppDelegateProxyEnabled` (add this key if needed)
84+
1. In the `AppDelegate` `didRegisterForRemoteNotificationsWithDeviceToken` call `[FUIAuth.defaultAuthUI.auth setAPNSToken:deviceToken]`
85+
<br>In this case The type of the token (production or sandbox) will be attempted to be automatically detected. There is other method to set it manually.
86+
1. In the `AppDelegate` `application:didReceiveRemoteNotification:fetchCompletionHandler:` call `[FUIAuth.defaultAuthUI.auth canHandleNotification:userInfo]`
87+
1. In the `AppDelegate` `application:didFinishLaunchingWithOptions:` call `[FIRApp configure]`
88+
1. In the `AppDelegate` `application:openURL:options:` return `[FUIAuth.defaultAuthUI handleOpenURL:url sourceApplication:sourceApplication]`
89+
1. Add `REVERSED_CLIENT_ID` as URL scheme to `Project settings`
90+
1. Add `GoogleService-Info.plist` to your project
91+
1. In you controller call:
92+
```objective-c
93+
[FUIAuth defaultAuthUI].delegate = self; // delegate should be retained by you!
94+
FUIPhoneAuth *phoneProvider = [[FUIPhoneAuth alloc] initWithAuthUI:[FUIAuth defaultAuthUI]];
95+
[FUIAuth defaultAuthUI].providers = \@[phoneProvider];
96+
```
97+
11\. To start Phone Auth, please call:
98+
```objective-c
99+
FUIPhoneAuth *phoneProvider = [FUIAuth defaultAuthUI].providers.firstObject;
100+
[phoneProvider signInWithPresentingViewController:self phoneNumber:nil];
101+
```
102+
You can skip all errors, FirbaseUI Phone Auth will display all error messages for you.
103+
<br>You may need only to handle error code `FUIAuthErrorCodeUserCancelledSignIn`.
104+
105+
If you don't need to handle APNS yourself, than don't do steps 3, 4, 5.
106+
107+
Please notice that you can use either APNS key OR APNS certificate.
108+
<br>One APNS Key can be used for all your iOS app from the same Apple Developer account.

0 commit comments

Comments
 (0)