8000 GitHub - taghassan/uae_pass
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

taghassan/uae_pass

 
 

Repository files navigation

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

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}");
    }
  }

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>

Android Setup

  • 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)

Access User Data

curl --location 'https://stg-id.uaepass.ae/idshub/userinfo' \
--header 'Authorization: Bearer token_here' \

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 70.4%
  • Kotlin 14.6%
  • Dart 12.4%
  • Ruby 2.6%
0