Reputation: 11
I'm trying to redirect back from bankid (swedish authentication app) on ios back to the page in safari where the user came from. The redirect is working, however the web page is reloaded on safari which causes it to lose all state.
I found this question Return to the browser page that launched an app without refreshing which gave me some help in that I can add a random #anchor to the url and the page will not reload. However when there already is an anchor in the url I can't manage to get it working.
I've tried removing the hash before opening the bankid app and adding it back in the redirect url with no success. I've also tried adding another anchor (like http://url#anchor#another-anchor
) which doesn't work either since the bankid app won't redirect at all to the browser in this case.
Is there any way to get around this? Unfortunately I can't change the host url which would be the easiest solution.
Upvotes: 1
Views: 1591
Reputation: 101
Since the default browser on iOS is Safari, the URI starting with "https://" is connected to Safari. Therefor Safari is opened when the BankID app calls starts the return-url, https://www.your-site.com/returnFromBankID
.
That's not a really nice user experience and what you can do is detect what browser is being used (for example Chrome) and adopt the return-URL to use the browser specific URI. If I remember correctly, the browser-specific URI for Chrome is chrome://www.bankid.com
.
Lycka till Jesper!
Upvotes: 0