cordova-plugin-inappbrowser
cordova-plugin-inappbrowser copied to clipboard
Inappbrowser opened in iOS goes missing after app open back from background
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
Any updates on this as yet? I'm facing the same issue. @sharafatshah Did you find any relevant solution for this?
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.
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.
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];
i tried the solution but app crashes for me. Is there any other alternative way to fix this problem
Bumping issue as I'm also facing the same, exactly as described by @sharafatshah
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 Thank you for this tip. I can confirm swapping out the plugin solved my issue.