Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I attach listener to the browser to close the browser after a particular event> #5

Open
nikhil91 opened this issue Nov 13, 2016 · 10 comments

Comments

@nikhil91
Copy link

No description provided.

@mr-e-
Copy link

mr-e- commented Jan 7, 2017

I'm trying to figure this out too... How to listen for certain urls and close the browser?

@dorgold
Copy link

dorgold commented Mar 13, 2017

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).

@washowasho
Copy link

@dorgold Thank you. That worked for me.

@washowasho
Copy link

@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?

@larssn
Copy link

larssn commented Aug 28, 2017

@dorgold Hmm, that doesn't seem to close it on iOS. Works fine on Android though.

@dorgold
Copy link

dorgold commented Aug 31, 2017

@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)

@washowasho
Copy link

@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?

@dorgold
Copy link

dorgold commented Aug 31, 2017

@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.

@larssn
Copy link

larssn commented Aug 31, 2017

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.

@dorgold
Copy link

dorgold commented Aug 31, 2017

We use javascript to redirect: window.location = 'appnames://someting' and it works ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants