搜尋套件、儲存庫與 APP 分類

套件詳情v1.1.1

flutter_uae_pass

支援 iOS、Android 和 Web 平台的 Flutter UAE Pass 插件。這是非官方版本。

AndroidiOSWeb
近 30 天下載
108
喜歡數
17
Pub 分數
130

安裝套件

flutter pub add flutter_uae_pass

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 外掛程式,可實現與阿聯酋電子通行證(UAE Pass)的整合,適用於 Android、iOS 與 Web 平台的身份驗證。此非官方實作允許使用者使用其阿聯酋電子通行證憑證進行驗證,簡化訪問阿聯酋政府與私人服務的流程。該外掛程式支援安全權杖取得,並處理平台特定設定,讓開發者更容易在其應用程式中實作可信的身份驗證。專為需要符合阿聯酋數位身分標準的應用程式設計。

適用情境

  • 阿聯酋基於政府服務應用程式
  • 需要身份驗證的私營部門應用程式
  • 數位開戶工作流程
  • 阿聯酋居民的安全登入
  • Web 和移動應用驗證

主要特色

  • 跨平台支援(Android、iOS、Web)
  • 非官方但功能完整的實現
  • 基於令牌的驗證
  • 支援阿聯酋通行證身分驗證
  • 透過 pub.dev 的簡單整合

適合對象

  • 開發面向阿聯酋應用程式的開發者
  • 需要符合數位身分解決方案的應用程式
  • 需要安全用戶認證的專案
  • 針對阿聯酋市場的初創企業
  • 前端團隊整合第三方認證

使用建議

  • 未獲得阿聯酋通行證官方認可
  • 可能需要針對新的阿聯酋通行證API變更進行更新
  • 與官方外掛相比,文件有限
  • 可能需要額外的後端驗證
  • 特定於平台的設定步驟可能會有所不同

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_uae_pass

Un-official UAE Pass Flutter plugin for iOS, Android, and Web.

Demo

Platform Screenshots

Android iOS Web
Android iOS Web

Platform Support

Platform Supported Implementation
iOS ✅ WKWebView with full screen modal
Android ✅ Custom WebView Activity
Web ✅ OAuth2 popup authentication

Getting Started

  • Add the plugin to your pubspec.yaml file
flutter_uae_pass: ^1.0.6
  • Run flutter pub get
flutter pub get
  • Import the package
import 'package:flutter_uae_pass/flutter_uae_pass.dart';
final _uaePassPlugin = UaePass();


  • Initialize the plugin - Sandbox
  await _uaePassPlugin.setUpSandbox();
  • Initialize the plugin - Production
    await _uaePassPlugin.setUpEnvironment(
      clientId: "<clientId>",
      clientSecret: "<clientSecret>",
      urlScheme: "myappscheme",
      redirectUri: "<redirectUri>",
      isProduction: true,
      language : "en",
    );

Scopes are as follows

  • urn:uae:digitalid:profile:general
  • urn:uae:digitalid:profile

Main features

  • signIn()
  • getAccessToken(String authCode)
  • getProfile(String token)
  • signOut()

Call the authenticate method

  String? authCode = await _uaePassPlugin.signIn();

To get access token

  String? accessToken = await _uaePassPlugin.getAccessToken(authCode);

To get public profile data

you can fetch this information from profile

  • idn
  • email
  • firstnameAR
  • firstnameEN
  • fullnameEN
  • gender
  • lastnameAR
  • lastnameEN
  • mobile
  • nationalityAR
  • nationalityEN
  • sub
  • userType
  • uuid
  ProfileData? profileData = await _uaePassPlugin.getProfile(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>myappscheme</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>myappscheme</string>
				</array>
			</dict>
		</array>

Android Setup

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

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

            </activity>

  • Set up the queries in your AndroidManifest.xml file (To make our app open UAE Pass App)
    <queries>
        <package android:name="ae.uaepass.mainapp" />
        <package android:name="ae.uaepass.mainapp.qa" />
        <package android:name="ae.uaepass.mainapp.stg" />
    </queries>

  • Set up the intent filter in your AndroidManifest.xml file (To Reopen our application after uaepass done)
            <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="myappscheme" />

                <data
                    android:host="failure"
                    android:scheme="myappscheme" />

            </intent-filter>

Web Setup

For web applications, no additional configuration is required! The plugin automatically uses a popup-based OAuth2 flow that works in all modern browsers.

Web-Specific Features:
  • Popup Authentication: Opens UAE Pass login in a secure popup window
  • Automatic Redirect Handling: Automatically detects and processes the authorization callback
  • CORS Compliance: Uses proper HTTP requests for token exchange and profile retrieval
  • Session Management: Handles cookies and localStorage for proper logout functionality
Browser Requirements:
  • Modern browsers with popup support (Chrome, Firefox, Safari, Edge)
  • JavaScript enabled
  • Cookies enabled for proper session management
Production Considerations:
  • Ensure your redirect URI is properly configured in the UAE Pass dashboard
  • For production, make sure your domain is whitelisted in UAE Pass configuration
  • Test popup blockers - inform users to allow popups for your domain if needed

References

Thanks for Faisal for this repo uae_pass_flutter i improve the code and create this package

所屬分類

依賴

依賴清單 1 項

  • plugin_platform_interface^2.0.2

原始碼儲存庫

使用此套件的專案

暫無相關資料。