Un-official UAE Pass Flutter plugin for Android and iOS.
- Add the plugin to your pubspec.yaml file
uae_pass_flutter: ^0.0.1
or
uae_pass_flutter:
git:
url: https://github.com/Faisalkc4u/uae_pass.git
ref: main
- Run flutter pub get
flutter pub get
- Import the package
import 'package:uae_pass/uae_pass.dart';
final _uaePassPlugin = UaePass();
- Initialize the plugin - Sandbox
await _uaePassPlugin.setUpSandbox();
- Initialize the plugin - Production
await _uaePassPlugin.setUpEnvironment(
"< client Id here >",
"< client secret here >",
"< redirect url scheme here >",
isProduction: true, // set to false for sandbox
);
- Call the authenticate method
final result = await _uaePassPlugin.signIn();
- Check the result
if (result != null) {
if (result is UaePassError) {
print("Error: ${result.message}");
} else if (result is UaePassSuccess) {
print("Success: ${result.accessToken}");
}
}
- 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> // e.g. uaepassdemoappDS (use for Sandbox )
<key>CFBundleURLSchemes</key>
<array>
<string>You App URL Scheme here</string>// e.g. uaepassdemoappDS (same as above)
</array>
</dict>
</array>
- Update android:launchMode="singleTask" the AndroidManifest.xml file
<activity
android:name=
6F8B
".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'
[https://docs.uaepass.ae/faq/common-integration-issues](Read Common issues)
curl --location 'https://stg-id.uaepass.ae/idshub/userinfo' \
--header 'Authorization: Bearer token_here' \