Skip to content

Commit 9546c90

Browse files
docs: add platform instructions
1 parent 0310b49 commit 9546c90

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,45 @@ The two most important widgets are
3333
- `LitAuthInit` - which initializes the package and exposes the services that will be used in your application.
3434
- `LitAuth` - which renders the UI (forms, buttons and dialogs).
3535

36-
### Initialization
36+
### Android integration
37+
38+
Enable the Google services by configuring the Gradle scripts as such.
39+
40+
1. Add the classpath to the `[project]/android/build.gradle` file.
41+
```gradle
42+
dependencies {
43+
// Example existing classpath
44+
classpath 'com.android.tools.build:gradle:3.2.1'
45+
// Add the google services classpath
46+
classpath 'com.google.gms:google-services:4.3.0'
47+
}
48+
```
49+
50+
2. Add the apply plugin to the `[project]/android/app/build.gradle` file.
51+
```gradle
52+
// ADD THIS AT THE BOTTOM
53+
apply plugin: 'com.google.gms.google-services'
54+
```
55+
56+
*Note:* If this section is not completed you will get an error like this:
57+
```
58+
java.lang.IllegalStateException:
59+
Default FirebaseApp is not initialized in this process [package name].
60+
Make sure to call FirebaseApp.initializeApp(Context) first.
61+
```
62+
63+
*Note:* When you are debugging on android, use a device or AVD with Google Play services.
64+
Otherwise you will not be able to authenticate.
65+
66+
### Web integration
67+
68+
In addition to the `firebase_auth` dependency, you'll need to modify the `web/index.html` of your app following the Firebase setup instructions:
69+
70+
* [Add Firebase to your JavaScript project](https://firebase.google.com/docs/web/setup#from-the-cdn).
71+
72+
Read more in the [`firebase_auth_web` README](https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_auth/firebase_auth_web/README.md).
73+
74+
### Lit Firebase Initialization
3775
First, you need to initialize the package with `LitAuthInit`. This should be at the root of your application. Above `MaterialApp`/`CupertinoApp`, and above any widgets that want to access authentication functionality.
3876

3977
For example:

0 commit comments

Comments
 (0)