This section shows the way to configure all Sign In features: SMS, Google, Facebook, Email, Apple; show/ hide Login options, add Forgot Password. Most of these features require Firebase to be set.

You can do these steps to configure the new App when using any service for Firebase:

  1. Using the Firebase Console, add an Android app to your project: Follow the assistant, download the generated google-services.json file, and place it inside android/app.
  2. Using the Firebase Console, add an iOS app to your project: Follow the assistant, download the generated GoogleService-Info.plist file, open ios/Runner.xcworkspace with Xcode, and within Xcode place the file inside ios/Runner.

When installing, if you get issue, please go to Common Questions or Common Issues to find the solutions.

1. SMS Sign In

1.1 Integrate with the SMS Login:

Please follow this guide to integrate with the SMS Login. More detailed document, refer to https://pub.dev/packages/firebase_auth

For android, Open project on firebase console. Then move to Settings/General. You need to upload SHA key to firebase project. You can follow this guide to generate SHA key https://developers.google.com/android/guides/client-auth

Packages_get

In case you meet this issue: after creating APK and releasing the app in App Stores, you get error when login with SMS Login. You need to go to the App stores and copy the SHA-1 key and past to your Firebase setting:

FDK path

FDK path

1.2 Change SMS default country:

Open lib/screens/login_sms/login_sms_constants.dart and change the default country: (if not found, please check lib/common/constants/general.dart)

class LoginSMSConstants {
  static const String countryCodeDefault = 'VN';
  static const String dialCodeDefault = '+84';
  static const String nameDefault = 'Vietnam';
}
  • countryCodeDefault: default country IOS Code.
  • dialCodeDefault: default country phone IOS Code when login as SMS Login feature.
  • nameDefault: default name of country.

2. Facebook Sign In

This part shows the way to set up Facebook login on your Flutter application. This needs to use the FlutterFacebookLogin package

Please check the manual guide for the detailed steps.

Video guide:

3. Google Sign In

We have added this library google_sign_in from pub.dev and upgrade new mstore-api plugin to support for this feature, you need to update Firebase setting to activate this feature from the app (also make sure update the google-service file to Fluxstore project).

Please check the manual guide for the detailed steps.

Video guide:

4. Require user login

There is also a new feature to require strict user login at On Borading Screen only before using the app by enabling IsRequiredLogin in the file lib/common/config.dart

const kAdvanceConfig = {
...
"IsRequiredLogin": true,
...
};

5. Add Forgot password

To enable the native forgot password screen, we just only set forgetPassword: "" in the lib/common/config.dart file.

/// set blank to use as native screen
"forgetPassword": "http://news.inspireui.com/wp-login.php?action=lostpassword"