@@ -217,7 +217,8 @@ startActivityForResult(
217
217
218
218
#### Handling the sign-in response
219
219
220
- #####Response codes
220
+ ##### Response codes
221
+
221
222
The authentication flow provides several response codes of which the most common are as follows:
222
223
` ResultCodes.OK ` if a user is signed in, ` ResultCodes.CANCELLED ` if the user manually canceled the sign in,
223
224
` ResultCodes.NO_NETWORK ` if sign in failed due to a lack of network connectivity,
@@ -344,6 +345,23 @@ AuthUI.getInstance()
344
345
});
345
346
```
346
347
348
+ ### Using the ` GoogleApiClient ` in your own app
349
+
350
+ FirebaseUI Auth heavily relies on the ` GoogleApiClient ` and its ` enableAutoManage ` method to
351
+ help prevent memory leaks. However, using ` enableAutoManage ` can be risky because the method will throw
352
+ an ` IllegalStateException ` if another ` GoogleApiClient ` is being managed with the same id.
353
+ To help solve this problem, FirebaseUI provides a helper method to get a safe id that is
354
+ not being used: ` GoogleApiHelper#getSafeAutoManageId() `
355
+
356
+ #### Example usage:
357
+
358
+ ``` java
359
+ new GoogleApiClient .Builder (mActivity)
360
+ .enableAutoManage(mActivity, GoogleApiHelper . getSafeAutoManageId(), null /* listener */ )
361
+ .addApi(... )
362
+ .build()
363
+ ```
364
+
347
365
### Authentication flow chart
348
366
349
367
The authentication flow implemented on Android is more complex than on other
@@ -352,7 +370,7 @@ represented in the following diagram:
352
370
353
371
![ FirebaseUI authentication flow on Android] ( flow.png )
354
372
355
- ### UI customization
373
+ ## UI customization
356
374
357
375
To provide customization of the visual style of the activities that implement
358
376
the flow, a new theme can be declared. Standard material design color
@@ -459,4 +477,4 @@ startActivityForResult(
459
477
460
478
#### Twitter
461
479
462
- Twitter permissions can only be configured through Twitter's developer console.
480
+ Twitter permissions can only be configured through [ Twitter's developer console] ( https://apps.twitter.com/ ) .
0 commit comments