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

InAppBrowser does not close on android 5.1.1 #60

Closed
Daha62 opened this issue Apr 8, 2019 · 28 comments
Closed

InAppBrowser does not close on android 5.1.1 #60

Daha62 opened this issue Apr 8, 2019 · 28 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Daha62
Copy link

Daha62 commented Apr 8, 2019

Hi there,

I am using your plugin, but suddenly faced with problem on android 5.1.1. InAppBrowser opens link correctly with type - dismiss, but every time u want to close it it opens again. If i want to make a force close - it does nothing.

React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 39.18 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.7.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 23.0.3, 26.0.0, 26.0.2, 26.0.3, 27.0.3, 28.0.3
System Images: android-19 | ARM EABI v7a, android-19 | Google APIs ARM EABI v7a, android-25 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4670197
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.2 => 0.59.2
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

@rizwanellahi
Copy link

I am also facing this issue on Android 6.0.1

@jdnichollsc
Copy link
Member

I'm going to check that at weekend, Any pull request is welcome in the meantime! 👍

@jdnichollsc jdnichollsc added bug Something isn't working help wanted Extra attention is needed labels Apr 12, 2019
@jdnichollsc
Copy link
Member

I need a demo to reproduce this issue, please let me know

@Daha62
Copy link
Author

Daha62 commented Apr 18, 2019

@jdnichollsc, I've just use
InAppBrowser.open('SOME_LINK')

And got unclosable browser.
And the BrowserResult type is dismiss instead of cancel (I checked it on other android and ios devices)

@jdnichollsc
Copy link
Member

I can't reproduce this issue from Android 5.1.1 with the example project of this plugin, please attach a reproducible demo
Captura de Pantalla 2019-04-18 a la(s) 3 21 34 a  m

@Daha62
Copy link
Author

Daha62 commented Apr 18, 2019

Of course,
Снимок экрана 2019-04-18 в 14 32 29

@jdnichollsc
Copy link
Member

What's that?

@Daha62
Copy link
Author

Daha62 commented Apr 22, 2019

It's the answer of response as in ur screenshot.
InAppBrowser.open(link).then((response) => console.log(response))

Response returns: {type: 'dismiss'}

May be, if it helps: it reproduces on Samsung j-320. I don't know how to explain better.

@jdnichollsc
Copy link
Member

@Daha62 try with the last version please and let me know 👍

@Daha62
Copy link
Author

Daha62 commented May 6, 2019

@jdnichollsc thank u for ur updates. But the problem is still is still exist (

image

When I try to close it - browser opens again.

@jdnichollsc
Copy link
Member

Are you using android:launchMode="singleTask"?

@jdnichollsc
Copy link
Member

Can you attach a reproducible demo? I can't help you without that, sorry

@Daha62
Copy link
Author

Daha62 commented May 6, 2019

Are you using android:launchMode="singleTask"?

yep

@Daha62
Copy link
Author

Daha62 commented May 6, 2019

https://drive.google.com/open?id=1EYdVV9C8dRicbHJANdOK3HowGgKCHoWI

@jdnichollsc
Copy link
Member

try without android:launchMode="singleTask", let me check your link at night 👍

@Daha62
Copy link
Author

Daha62 commented May 7, 2019

tried without singleTask mode, but on this device - the same behaviour.
On others - works as it should.

@jdnichollsc
Copy link
Member

Yeah... and I can't reproduce this issue, so try debugging the plugin and let me know what you find, in the meantime it would be closed 👍

@ssuchanowski
Copy link
Contributor

Happens to me as well - API 28, Nexus 5X but only on device - emulator seems to be working fine. I will try to investigate more.

@jdnichollsc
Copy link
Member

jdnichollsc commented Jun 23, 2019

Thanks @ssuchanowski, because I can't reproduce this issue and I can't help without a demo or logs of the issue :)

@WildyDS
Copy link

WildyDS commented Jul 23, 2019

I've also had this issue.
Investigated a lot, found a bug - ChromeTabsManagerActivity activity doesn't restore it's state after onDestroy which may happen even when visually it was not destroyed.

Steps to reproduce (tried on Samsung j320 and Samsung A5 (2016)):

  1. Open developer options
  2. Turn on "Do not keep activities" in "applications" part
  3. Open example app
  4. Open browser (here goes our "onDestroy")
  5. Try to close browser

The fix is in implementing "onSaveInstanceState" and checking for savedInstanceState in "onCreate" (also some related changes may be needed)

@jdnichollsc jdnichollsc reopened this Jul 23, 2019
@jdnichollsc
Copy link
Member

@Daha62 @Rizwanilahi @ssuchanowski @WildyDS what happen if you try opening the browser with the forceCloseOnRedirection property enabled? Just to know

@jdnichollsc
Copy link
Member

@WildyDS honestly I don't know, but any pull request is welcome mate! 👍

@Luke-Rogerson
Copy link

@WildyDS So you're talking about the activity lifecycle, right? I'd like to help, but don't know enough about native Android code!

@WildyDS
Copy link

WildyDS commented Jul 31, 2019

@WildyDS honestly I don't know, but any pull request is welcome mate! 👍

I can actually do it in my spare time but in won't be soon

@WildyDS
Copy link

WildyDS commented Jul 31, 2019

@WildyDS So you're talking about the activity lifecycle, right? I'd like to help, but don't know enough about native Android code!

Exactly

@marudy
Copy link

marudy commented Nov 3, 2019

Hey guys, just run into this as well. Any work around or patch suggested? Thanks

@jdnichollsc
Copy link
Member

@WildyDS thanks for your help, it was fixed in the last version 3.3.0, let me know 👍 https://github.com/proyecto26/react-native-inappbrowser/releases/tag/v3.3.0

@jdnichollsc
Copy link
Member

And guys, let me know what you think v3.2.0...v3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants