[英]Redirecting from BankID app with custom URL scheme in iOS (Flutter) not working
在用戶輸入安全代碼后,我試圖從 BankId 應用程序重定向到我的 Flutter 應用程序。
它在 Android 中運行良好,但在 iOS 中,當我將 URL 重定向到我的自定義 URL 方案時,它不會自動返回到應用程序。
if (Platform.isIOS) {
const redirect = "rememberapp://";
url = "https://app.bankid.com/?autostarttoken=[$autoToken]&redirect=$redirect";
if (await canLaunch(url)) {
await launch(url, forceSafariVC: false);
} else {
throw 'Could not launch $url';
}}
當我在 safari 中添加 URL 方案時,它會打開該應用程序,但當我嘗試從另一個應用程序重定向時它不起作用。
對於 IOS 中的重定向 URL,您需要首先在您的應用程序中設置深度鏈接。 腳步:
最后,使用以下格式啟動您的 Swedish BankID 應用程序:
let url = URL(string: "https://app.bankid.com/?redirect=https://com.sampleapp.deeplink.app/") UIApplication.shared.open(url,: 選項。[:universalLinksOnly: true]) { (success) in / handle success/failure }
首先,嘗試在不使用令牌且不創建 bankiD 測試帳戶的情況下進行此 BankId 重定向,因為銀行 ID 會生成“不存在帳戶”的錯誤,但它會自動將您重定向回您的應用程序。
成功測試您的深層鏈接后,創建一個測試 BankID 帳戶並使用 Signicat Express 身份驗證 REST API 開始用戶驗證(請參閱此處的高級文檔: https://developer.signicat.com/express/docs/identification/#guides和詳細信息API 參考: https://developer.signicat.com/express/apis/authentication.html#tag/Sessions )
或者您使用 Signicat 所謂的“無頭”流程開始用戶驗證https://api.signicat.io/identification/v2/sessions
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.