uae_pass_flutter

Creator: coderz1093

Last updated:

Add to Cart

Description:

uae pass flutter

uae_pass #
Un-official UAE Pass Flutter plugin for Android and iOS.
Getting Started #

Add the plugin to your pubspec.yaml file

uae_pass_flutter: ^0.0.1
copied to clipboard
or
uae_pass_flutter:
git:
url: https://github.com/Faisalkc4u/uae_pass.git
ref: main
copied to clipboard

Run flutter pub get

flutter pub get
copied to clipboard

Import the package

import 'package:uae_pass/uae_pass.dart';
final _uaePassPlugin = UaePass();


copied to clipboard

Initialize the plugin - Sandbox

await _uaePassPlugin.setUpSandbox();
copied to clipboard

Initialize the plugin - Production

await _uaePassPlugin.setUpEnvironment(
"< client Id here >",
"< client secret here >",
"< redirect url scheme here >",
isProduction: true, // set to false for sandbox
redirect_url: "< redirect url here >",
scope: "< scope here >",// by default urn:uae:digitalid:profile
);
copied to clipboard
Scopes are as follows #


urn:uae:digitalid:profile:general


urn:uae:digitalid:profile


Call the authenticate method


final result = await _uaePassPlugin.signIn();
copied to clipboard

Check the result

if (result != null) {
if (result is UaePassError) {
print("Error: ${result.message}");
} else if (result is UaePassSuccess) {
print("Success: ${result.accessToken}");
}
}
copied to clipboard
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> // 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>
copied to clipboard
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>

copied to clipboard

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>

copied to clipboard
Note: incase kotlin error, add the following to your build.gradle file
buildscript {
// update this line
ext.kotlin_version = '1.7.10'
copied to clipboard
Read Common issues
Access Token #



curl --location --request POST 'https://stg-id.uaepass.ae/idshub/token?grant_type=authorization_code&redirect_uri=https://stg-selfcare.uaepass.ae&code=bfe96299-83f4-3ee9-80e4-56c24f5265d3' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: Basic c2FuZGJveF9zdGFnZTpzYW5kYm94X3N0YWdl'
copied to clipboard
Refer to Official Documentation
Access User Data #
curl --location 'https://stg-id.uaepass.ae/idshub/userinfo' \
--header 'Authorization: Bearer token_here' \
copied to clipboard
Refer to Official Documentation

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.