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

3.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. 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:

3. 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:

4. Apple Sign In

FDK path

If your app using third-party login service, it will require to use Apple Sign In to get approval from Apple. To enable this features on Fluxstore please make sure following config:

  1. Enable the config section to enable Apple Sign In (the default is active).
  2. Enable the the Apple Login option on Firebase - https://tppr.me/yd1Yv - this option is used to register Apple user account with the Firebase app.

Important Note:

  • Apple Sign In is only available for device with iOS 13 and up (not work with the iOS Simulator): you might need to open Xcode to make sure you have enable Sign in with Apple in capabilities in Runner target of ios/Runner.xcworkspace.
FDK path

If Sign in with Apple capability is not enabled, please enable it. You can follow this guide on adding capabilities to your app.

  • 🐞Bug Login: revoke the account access on your iOS device if could not login on Fluxstore, by opening the Setting on iOS in your iPhone and tap on your name at the top, press Password & Security, then you could see list the Apps that using Apple ID, you can delete any of them to revoke access

5. Show/hide the Login options

Update the lib/common/config/general.dart to show/hide the Login options:

/// Option to show/hide the Social Login
const kLoginSetting = {
  "IsRequiredLogin": false,
  'showAppleLogin': true,
  'showFacebook': true,
  'showSMSLogin': true,
  'showGoogleLogin': true,
};
/// Enable the Start Rating features
"EnableRating": true,
/// If the Start Rating is empty, we could hide it or keep with blank star
"hideEmptyProductListRating": false,

/// set to true if you have finish running Re-generate image plugin
"kIsResizeImage": false,

File lib/common/config/general.dart:

fluxstore-1

6. Add Forgot password

This native forgot password feature is available for the WooCommerce only. To enable the Native forgot password screen, we just only set forgetPassword: "" in the lib/common/config.dart. Otherwise, using the external Forgot password URL to open the screen as the Webview screen.

/// set blank to use as native screen
"forgetPassword": "http://demo.mstore.io/wp-login.php?action=lostpassword"