cordova-plugin-inappbrowser icon indicating copy to clipboard operation
cordova-plugin-inappbrowser copied to clipboard

Inappbrowser opened in iOS goes missing after app open back from background

Open sharafatshah opened this issue 5 years ago • 8 comments

Issue Type

  • [x] Bug Report
  • [ ] Feature Request
  • [ ] Support Question

Description

I open a link with the inappbrowser plugin. While the inappbrowser is open, I move the app to the background. Then I open it back to foreground and the browser goes missing.

Information

I realise the issue is not appearing after I remove my splashscreen from config.xml where the default Cordova splashscreen image will appear instead.

Command or Code

The line of config that was removed to fix the issue <splash src="res/splashscreen/IOS/Default@2x~universal~anyany.png" />

Environment, Platform, Device

It is happening on iOS physical devices and simulator

Version information

Cordova CLI: 8.1.1 NPM 6.4.1 cordova-ios: 4.5.5 & 5.1.1 cordova-plugin-inappbrowser: 3.0.0 & 3.1.0 cordova-plugin-splashscreen: 5.0.3

Checklist

  • [x] I searched for already existing GitHub issues about this
  • [ ] I updated all Cordova tooling to their most recent version
  • [ ] I included all the necessary information above

sharafatshah avatar Jan 06 '20 01:01 sharafatshah

Any updates on this as yet? I'm facing the same issue. @sharafatshah Did you find any relevant solution for this?

usahunps avatar Jun 11 '20 09:06 usahunps

Any updates on this as yet? I'm facing the same issue. @sharafatshah Did you find any relevant solution for this?

@usahunps I could not find a solution for this. The only way I can find to stop it from happening is to change for iOS from using launch storyboard images to legacy launch images.

sharafatshah avatar Jun 11 '20 09:06 sharafatshah

Any updates on this as yet? I'm facing the same issue. @sharafatshah Did you find any relevant solution for this?

@usahunps I could not find a solution for this. The only way I can find to stop it from happening is to change for iOS from using launch storyboard images to legacy launch images.

Ok... Thank you @sharafatshah. I shall give it a try and bring my code back to use legacy launch images from launch storyboard images.

usahunps avatar Jun 11 '20 10:06 usahunps

I also face the same issue with iOS Cordova 6.1.0 and InAppBrowser 4.0.0. Yet, our project works fine with iOS Cordova 5.1.1 and InAppBrowser 3.2.0. Not sure what's the root cause. But, I just make a workaround for this issue. Declare the below method in CDVWKInAppBrowser:

- (void)onAppWillEnterForeground { if (self.inAppBrowserViewController != nil) { NSLog(@"CDVWKInAppBrowser onAppWillEnterForeground to make InAppBrowser as key and visible"); dispatch_async(dispatch_get_main_queue(), ^{ [self->tmpWindow makeKeyAndVisible]; }); } }

And, register the observer for event 'UIApplicationWillEnterForegroundNotification' in 'pluginInitialize' method of CDVWKInAppBrowser: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];

Joe-song-77 avatar Jul 31 '20 08:07 Joe-song-77

i tried the solution but app crashes for me. Is there any other alternative way to fix this problem

ashishyd avatar Oct 15 '21 07:10 ashishyd

Bumping issue as I'm also facing the same, exactly as described by @sharafatshah

godonovan-jh avatar Jan 14 '22 16:01 godonovan-jh

I had the same issue, but because i was using this plugin too : https://github.com/devgeeks/PrivacyScreenPlugin In an issue, i said that changing privacyscreenplugin make it work again : https://github.com/devgeeks/PrivacyScreenPlugin/issues/65

With this : https://www.npmjs.com/package/cordova-plugin-privacyscreen-storyboard

i remember too, i had the probleme with cordova-ios >=6 With cordiva-ios <6 it was working well with old privacyscreen plugin

I hope all this informations can help you

Stephane84 avatar Jan 17 '22 10:01 Stephane84

@Stephane84 Thank you for this tip. I can confirm swapping out the plugin solved my issue.

godonovan-jh avatar Jan 26 '22 18:01 godonovan-jh