Skip to content

Commit faaef1d

Browse files
Peter Gordon HayesPeter Gordon Hayes
authored andcommitted
docs: add Auth Providers and Firebase updates
1 parent 0bd5a0d commit faaef1d

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ Pre-lit Firebase authentication. It provides a set of convenient utilities and w
2828
- [Initialization](#initialization)
2929
- [Google Sign In for Android](#google-sign-in-for-android)
3030
- [Google Sign In for iOS](#google-sign-in-for-ios)
31-
- [iOS additional requirement](#ios-additional-requirement)
31+
- [iOS additional requirement](#ios-additional-requirement)
32+
- [Apple Sign In for Android](#apple-sign-in-for-android)
3233
- [Apple Sign In for iOS](#apple-sign-in-for-ios)
3334
- [Twitter Sign In for iOS and Android](#twitter-sign-in-for-ios-and-android)
35+
- [Github Sign In for iOS and Android](#github-sign-in-for-ios-and-android)
3436
- [Using with Lit Firebase Auth](#using-with-lit-firebase-auth)
3537
- [Decoration and theming](#decoration-and-theming)
3638
- [Standard Sign-in widget customization](#standard-sign-in-widget-customization)
@@ -61,13 +63,13 @@ Pre-lit Firebase authentication. It provides a set of convenient utilities and w
6163

6264
## Getting started
6365

64-
See the [example](example/) project to get up and running fast.
66+
Please note that before this package can be used, Firebase Core needs to be initialized in your application. See the official [FlutterFire documentation](https://firebase.flutter.dev/docs/overview#initializing-flutterfire) for up to date information.
6567

66-
Or take a look at a [live demo](https://funwithflutter.github.io/lit_firebase_example/).
68+
For a complete example (with Firebase initialization) see the [example](example/) project.
69+
70+
Or take a look at a [live demo](https://funwithflutter.github.io/lit_firebase_example/). Note that this video was recorded with the old version of FlutterFire and Lit Firebase Auth. As such, some configuration may be different. For example, this does not show how to initialize FlutterFire.
6771

6872
## Platform Configuration
69-
<details>
70-
<summary>...</summary>
7173

7274
### Android integration
7375

@@ -115,7 +117,6 @@ Below is an example of a Flutter Web `index.html` with Firebase Auth enabled:
115117
<!-- CONTINUE TO INITIALIZE FLUTTER WEB -->
116118
...
117119
```
118-
</details>
119120

120121
## Usage
121122
The two most important widgets are
@@ -258,32 +259,28 @@ Should only be used in the build method.
258259

259260
## Authentication Providers
260261

262+
Lit Firebase Auth supports a number of third party authentication providers, such as Google, Apple, Github, etc.
263+
261264
### Initialization
262265
Enable the sign-in method you want to use in firebase console
263266

264267
### Google Sign In for Android
265268

266-
To access Google Sign-In, you'll need to make sure to [register your
267-
application](https://developers.google.com/mobile/add?platform=android).
269+
Lit Firebase Auth uses the [google_sign_in](https://pub.dev/packages/google_sign_in) package for Google Sign in. Please see their documentation if you encounter difficulties.
268270

269-
You don't need to include the google-services.json file in your app unless you
270-
are using Google services that require it. You do need to enable the OAuth APIs
271-
that you want, using the [Google Cloud Platform API
272-
manager](https://console.developers.google.com/). For example, if you
273-
want to mimic the behavior of the Google Sign-In sample app, you'll need to
274-
enable the [Google People API](https://developers.google.com/people/).
271+
Please ensure you have done the steps outline in [Android integration](#android-integration)
275272

276-
Make sure you've filled out all required fields in the console for [OAuth consent screen](https://console.developers.google.com/apis/credentials/consent). Otherwise, you may encounter `APIException` errors.
273+
The majority of the configuration is on Firebase side. First, Google Sign In needs to be enabled in the Authentication section of your Firebase project. Next, if you have not done so yet, you will need to provide your application's SHA certificate within your Firebase settings and replace the `google-services.json` file with the updated one. This is needed for Google Sign in to be allowed.
274+
275+
A correctly setup Firebase project and the correct `google-services.json` file is all you'll need.
277276

278277
### Google Sign In for iOS
279278

280-
1. [First register your application](https://developers.google.com/mobile/add?platform=ios).
281-
2. Make sure the file you download in step 1 is named `GoogleService-Info.plist`.
282-
3. Move or copy `GoogleService-Info.plist` into the `[my_project]/ios/Runner` directory.
283-
4. Open Xcode, then right-click on `Runner` directory and select `Add Files to "Runner"`.
284-
5. Select `GoogleService-Info.plist` from the file manager.
285-
6. A dialog will show up and ask you to select the targets, select the `Runner` target.
286-
7. Then add the `CFBundleURLTypes` attributes below into the `[my_project]/ios/Runner/Info.plist` file.
279+
Lit Firebase Auth uses the [google_sign_in](https://pub.dev/packages/google_sign_in) package for Google Sign in. Please see their documentation if you encounter difficulties.
280+
281+
Please ensure you have done the steps outline in [iOS integration](#ios-integration)
282+
283+
Then add the `CFBundleURLTypes` attributes below into the `[my_project]/ios/Runner/Info.plist` file.
287284

288285
```xml
289286
<!-- Put me in the [my_project]/ios/Runner/Info.plist file -->
@@ -303,16 +300,15 @@ Make sure you've filled out all required fields in the console for [OAuth consen
303300
</array>
304301
<!-- End of the Google Sign-in Section -->
305302
```
306-
### iOS additional requirement
303+
304+
#### iOS additional requirement
307305

308306
Note that according to https://developer.apple.com/sign-in-with-apple/get-started,
309307
starting June 30, 2020, apps that use login services must also offer a "Sign in
310308
with Apple" option when submitting to the Apple App Store.
311309

312-
Consider also using an Apple sign in plugin from pub.dev.
313-
314-
The Flutter Favorite [sign_in_with_apple](https://pub.dev/packages/sign_in_with_apple)
315-
plugin could be an option.
310+
### Apple Sign In for Android
311+
This should be working, but has not been tested. There should be configuration examples in the Firebase documentation.
316312

317313
### Apple Sign In for iOS
318314

@@ -323,6 +319,9 @@ plugin could be an option.
323319
2. Copy Paste your API Key and API Secret into the Twitter Sign In Method in Firebase
324320
3. Enable 3rd party authentication in Twitter Developer Portal and copy past callback URL from Firebase
325321

322+
### Github Sign In for iOS and Android
323+
Similar process to Twitter Sign in.
324+
326325
### Using with Lit Firebase Auth
327326
The supported third-party providers are:
328327
* Google
@@ -504,9 +503,9 @@ The state of the password and email can be cleared manually by calling:
504503
context.resetSignInForm()
505504
```
506505

507-
This will reset the form to it's initial state.
506+
This will reset the form to its initial state.
508507

509-
It's a good idea to do this when you have multiple `EmailTextFormField` and `PasswordTextFormField` widgets in seperate locations, for example when you have a separate Sign-in form and a Registration form.
508+
It's a good idea to do this when you have multiple `EmailTextFormField` and `PasswordTextFormField` widgets in separate locations, for example when you have a separate Sign-in form and a Registration form.
510509

511510
### Icons
512511

0 commit comments

Comments
 (0)