Open nikhil91 opened 7 years ago
You can do that using custom urls (https://github.com/EddyVerbruggen/Custom-URL-scheme) Have the webpage navigate to a custom URL that your app is registered with, it will close the browsertab for you (And will allow you to pass data in using query params).
@dorgold Thank you. That worked for me.
@dorgold , I decided to take the Universal Links approach since Apple doesn't seem to be supporting Custom URL Scheme anymore. I have this working for Android fine... but Universal Links doesn't seem to be working for me. Do you have this implemented?
@dorgold Hmm, that doesn't seem to close it on iOS. Works fine on Android though.
@washowasho @larssn sorry for the late response. I have double checked, we use a custom URL scheme on iOS and it works fine (closes the tab). Make sure you use a custom URL (app-identifier://something) and not a universal link (http://www.something.com)
@dorgold Yes, I ended up using custom URL scheme as well. Any idea on how long that will be good for as universal links seem to be taking over?
@washowasho I didn't see any publication stating that Apple are planning to deprecate this feature. They do seem to favor universal links, but i don't think they are going to remove support for custom urls anytime soon.
Hm, I can only get the browser-tab to close when I physically click our custom url scheme link. Not when I redirect to it. It's in the form appname://
. We're using InAppBrowser for now, but I'd prefer to use this.
FYI I'm building an OAuth1 flow.
We use javascript to redirect: window.location = 'appnames://someting'
and it works ok.
I'm trying to figure this out too... How to listen for certain urls and close the browser?