-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Android - how to know when the browser was closed by user? #8
Comments
Check the documentation of the WebBrowser https://docs.expo.io/versions/latest/sdk/webbrowser#returns If you want you can propose the change with a pull request to include that into the documentation too (README) |
@jdnichollsc I'm not using Expo, but using this module this seems to be true only for iOS:
On Android it's dismissed automatically, but the promise resolves with Here is a minimal example that reproduces the issue: https://github.com/mlazari/in-app-browser-my-app |
@jdnichollsc I opened a pull request #9 |
@mlazari thanks for your excellent contribution and sorry for the delay! |
@jdnichollsc No problem. Thanks. |
I have an intent filter like this in my Android app:
If I open the browser a page that redirects to
myapp://test
the browser is dismissed and the result type is"cancel"
, which makes impossible to distinguish this situation from the situation when the user closed the browser manually.The promise is resolved with
{ type: 'cancel' }
here when the browser activity is destroyed:react-native-inappbrowser/android/src/main/java/com/proyecto26/inappbrowser/RNInAppBrowser.java
Line 121 in af97246
On iOS when the browser redirects to
myapp://test
the browser is not dismissed automatically. Instead I detect with Linking that the app was opened with that url, and close the browser from there, which I think is fine:The text was updated successfully, but these errors were encountered: