简体   繁体   中英

Redirecting from BankID app with custom URL scheme in iOS (Flutter) not working

I'm trying to redirect from BankId app to my Flutter app after the user enters the security code.

It's working fine in Android but in iOS when I set URL redirect to my custom URL scheme, it doesn't return back to the app automatically.

 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';
 }}

When I add the URL scheme in safari, it opens up the app but it's not working when I try to redirect from another app.

For redirect URL in IOS, you need to first setup deep linking in your application. Steps:

  • Register a custom URL
  • listen for your custom URL inside application by configuring scheme, host, and path
  • Finally, now that your application is set up to listen for specific url, add that url as redirect.

Finally, launch your Swedish BankID application with this format:

let url = URL(string: "https://app.bankid.com/?redirect=https://com.sampleapp.deeplink.app/") UIApplication.shared.open(url,: options. [:universalLinksOnly:true]) { (success) in / handle success/failure }

First of all, try this BankId redirect without a token and without creating a bankiD test account as Bank id will generate an error of no existing account but it will redirect you back to your application automatically.

After successfully testing your deep link, create a test BankID account and start user verification with Signicat Express Authentication REST API (see high-level documentation here: https://developer.signicat.com/express/docs/identification/#guides and detailed API reference here: https://developer.signicat.com/express/apis/authentication.html#tag/Sessions )

Or you start user verification with Signicat so-called “headless” flow https://api.signicat.io/identification/v2/sessions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM