Skip to content

Commit d14b700

Browse files
author
Amateur Coder
committed
Updated with Auth information
1 parent d4bfbbe commit d14b700

File tree

1 file changed

+82
-36
lines changed

1 file changed

+82
-36
lines changed

README.md

Lines changed: 82 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,14 @@ Or take a look at a [live demo](https://funwithflutter.github.io/lit_firebase_ex
3636

3737
### Android integration
3838

39-
Enable the Google services by configuring the Gradle scripts as such.
40-
41-
1. Add the classpath to the `[project]/android/build.gradle` file.
42-
```gradle
43-
dependencies {
44-
// Example existing classpath
45-
classpath 'com.android.tools.build:gradle:3.2.1'
46-
// Add the google services classpath
47-
classpath 'com.google.gms:google-services:4.3.0'
48-
}
49-
```
50-
51-
2. Add the apply plugin to the `[project]/android/app/build.gradle` file.
52-
```gradle
53-
// ADD THIS AT THE BOTTOM
54-
apply plugin: 'com.google.gms.google-services'
55-
```
56-
57-
*Note:* If this section is not completed you will get an error like this:
58-
```
59-
java.lang.IllegalStateException:
60-
Default FirebaseApp is not initialized in this process [package name].
61-
Make sure to call FirebaseApp.initializeApp(Context) first.
62-
```
39+
Follow normal [Firebase Initialization](https://firebase.flutter.dev/docs/installation/android)
6340

6441
*Note:* When you are debugging on android, use a device or AVD with Google Play services.
6542
Otherwise you will not be able to authenticate.
6643

44+
### iOS integration
45+
Follow normal [Firebase Initialization](https://firebase.flutter.dev/docs/installation/ios)
46+
6747
### Web integration
6848

6949
You'll need to modify the `web/index.html` of your app following the Firebase setup instructions:
@@ -243,6 +223,72 @@ Should only be used in the build method.
243223

244224
## Authentication Providers
245225

226+
### Initialization
227+
Enable the sign-in method you want to use in firebase console
228+
229+
### Google Sign In for Android
230+
231+
To access Google Sign-In, you'll need to make sure to [register your
232+
application](https://developers.google.com/mobile/add?platform=android).
233+
234+
You don't need to include the google-services.json file in your app unless you
235+
are using Google services that require it. You do need to enable the OAuth APIs
236+
that you want, using the [Google Cloud Platform API
237+
manager](https://console.developers.google.com/). For example, if you
238+
want to mimic the behavior of the Google Sign-In sample app, you'll need to
239+
enable the [Google People API](https://developers.google.com/people/).
240+
241+
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.
242+
243+
### Google Sign In for iOS
244+
245+
1. [First register your application](https://developers.google.com/mobile/add?platform=ios).
246+
2. Make sure the file you download in step 1 is named `GoogleService-Info.plist`.
247+
3. Move or copy `GoogleService-Info.plist` into the `[my_project]/ios/Runner` directory.
248+
4. Open Xcode, then right-click on `Runner` directory and select `Add Files to "Runner"`.
249+
5. Select `GoogleService-Info.plist` from the file manager.
250+
6. A dialog will show up and ask you to select the targets, select the `Runner` target.
251+
7. Then add the `CFBundleURLTypes` attributes below into the `[my_project]/ios/Runner/Info.plist` file.
252+
253+
```xml
254+
<!-- Put me in the [my_project]/ios/Runner/Info.plist file -->
255+
<!-- Google Sign-in Section -->
256+
<key>CFBundleURLTypes</key>
257+
<array>
258+
<dict>
259+
<key>CFBundleTypeRole</key>
260+
<string>Editor</string>
261+
<key>CFBundleURLSchemes</key>
262+
<array>
263+
<!-- TODO Replace this value: -->
264+
<!-- Copied from GoogleService-Info.plist key REVERSED_CLIENT_ID -->
265+
<string>com.googleusercontent.apps.861823949799-vc35cprkp249096uujjn0vvnmcvjppkn</string>
266+
</array>
267+
</dict>
268+
</array>
269+
<!-- End of the Google Sign-in Section -->
270+
```
271+
### iOS additional requirement
272+
273+
Note that according to https://developer.apple.com/sign-in-with-apple/get-started,
274+
starting June 30, 2020, apps that use login services must also offer a "Sign in
275+
with Apple" option when submitting to the Apple App Store.
276+
277+
Consider also using an Apple sign in plugin from pub.dev.
278+
279+
The Flutter Favorite [sign_in_with_apple](https://pub.dev/packages/sign_in_with_apple)
280+
plugin could be an option.
281+
282+
### Apple Sign In for iOS
283+
284+
1. [Configure your app](https://help.apple.com/developer-account/#/devde676e696) in Xcode to add the "Sign In with Apple" capability
285+
286+
### Twitter Sign In for iOS and Android
287+
1. Register your app as a developer application in [Twitter Developer Portal](https://developer.twitter.com/en)
288+
2. Copy Paste your API Key and API Secret into the Twitter Sign In Method in Firebase
289+
3. Enable 3rd party authentication in Twitter Developer Portal and copy past callback URL from Firebase
290+
291+
### Using with Lit Firebase Auth
246292
The supported third-party providers are:
247293
* Google
248294
* Apple
@@ -455,18 +501,18 @@ This will display a column of icons (images).
455501
## Planned features
456502

457503

458-
| | State | |
459-
| ----------------- | ---------- | ---------------------------------------------------------------- |
460-
| Platforms | | Support more platforms (Windows, macOS, Linux) |
461-
| Auth providers | | Support more authentication providers (Facebook, Microsoft) |
462-
| Cupertino | | Cupertino look and feel |
463-
| Password reset | | Add services and UI to reset password/email |
464-
| Email confirmation| | Add UI to notify users they need to confirm their email address |
465-
| Support UI | | Assist users who cannot authenticate with support links |
466-
| Custom dialogs | ✔️ | Add support to customize dialog messages |
467-
| Adaptive layouts | | Adaptive layouts to support multiple screen sizes |
468-
| Customization | ✔️ | Even more, or easier, customization |
469-
| Testing | | Add testing |
504+
| | State | |
505+
| ------------------ | ----- | --------------------------------------------------------------- |
506+
| Platforms || Support more platforms (Windows, macOS, Linux) |
507+
| Auth providers || Support more authentication providers (Facebook, Microsoft) |
508+
| Cupertino || Cupertino look and feel |
509+
| Password reset || Add services and UI to reset password/email |
510+
| Email confirmation || Add UI to notify users they need to confirm their email address |
511+
| Support UI || Assist users who cannot authenticate with support links |
512+
| Custom dialogs | ✔️ | Add support to customize dialog messages |
513+
| Adaptive layouts || Adaptive layouts to support multiple screen sizes |
514+
| Customization | ✔️ | Even more, or easier, customization |
515+
| Testing || Add testing |
470516

471517
## Dart Versions
472518

0 commit comments

Comments
 (0)