You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,45 @@ The two most important widgets are
33
33
-`LitAuthInit` - which initializes the package and exposes the services that will be used in your application.
34
34
-`LitAuth` - which renders the UI (forms, buttons and dialogs).
35
35
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
37
75
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.
0 commit comments