uaepass_api 0.1.4 copy "uaepass_api: ^0.1.4" to clipboard
uaepass_api: ^0.1.4 copied to clipboard

Flutter UAE PASS package for Authentication API.

uaepass_api #

Un-official UAE PASS Flutter package for authentication capability.

Why uaepass_api? #

  • 🚀 Easy to use
  • ⚡ Supports app installed scenario
  • ❤ Supports app not installed scenario
  • 🛡️ Null safety

Getting Started #

  • Add the plugin to your pubspec.yaml file
uaepass_api: ^0.1.4
  • Run flutter pub get
flutter pub get
  • Import the package
import 'package:uaepass_api/uaepass_api.dart';

UaePassAPI uaePassAPI =UaePassAPI(
    clientId: "<clientId>",
    redirectUri: "<redirectUri>",
    clientSecrete: "<clientSecrete>",
    appScheme: "<Your App Scheme>",
    isProduction: false);
  • Get user code
    String? code =  await uaePassAPI.signIn(context);
  • Get user AccessToken
    String? token =  await uaePassAPI.getAccessToken(code);

iOS Setup #

  • Add the following to your Info.plist file
  <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>uaepass</string>
      <string>uaepassqa</string>
      <string>uaepassdev</string>
      <string>uaepassstg</string>
    </array>
  <key>CFBundleURLTypes</key>
  <array>
    <dict>
      <key>CFBundleTypeRole</key>
      <string>Editor</string>
      <key>CFBundleURLName</key>
      <string>You App URL Scheme here</string>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>You App URL Scheme here</string>
      </array>
    </dict>
  </array>

Android Setup #

  • Update android:launchMode="singleTask" the AndroidManifest.xml file

 <activity
            android:name=".MainActivity"
            android:exported="true"

            android:launchMode="singleTask"

            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            .....

            </activity>

  • Set up the intent filter in your AndroidManifest.xml file
            <intent-filter >
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />


                <data
                    android:host="success"
                    android:scheme="<Your App Scheme>" />

                <data
                    android:host="failure"
                    android:scheme="<Your App Scheme>" />

            </intent-filter>

Note: incase kotlin error, add the following to your build.gradle file

buildscript {
    // update this line
    ext.kotlin_version = '1.7.10'

Read Common issues