cordova-plugin-ionic-webview icon indicating copy to clipboard operation
cordova-plugin-ionic-webview copied to clipboard

ios app stuck on splashscreen now . if i remove this plugin all working fine.

Open ipehimanshu opened this issue 6 years ago • 44 comments

Hello now something wrong in this plugin or any other but if i remove this plugin then all working fine like app stuck on splashscreen.

screenshot_1 SauceLabs_Log_iPhone_6_free_16-04-2018_12-29-49.txt

ipehimanshu avatar Apr 16 '18 07:04 ipehimanshu

here is my all plugin list

image and we use cli-7.1.0 as ios=4.5.4 and for this web view plugin we use this type configuration

<plugin name="cordova-plugin-ionic-webview" spec="^1.2.0" /> <preference name="WKPort" value="97011" /> <allow-navigation href="http://localhost:97011/*"/> <feature name="CDVWKWebViewEngine"> <param name="ios-package" value="CDVWKWebViewEngine" /> </feature> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

it stuck on splashscreen not able to trace it more.

we are building application using phonegap build

ipehimanshu avatar Apr 16 '18 10:04 ipehimanshu

I have the same issue. If use version "1.1.16" then application works correctly.

Donil avatar Apr 17 '18 10:04 Donil

I am facing the same problem. Tried version 1.1.16 the problem still there. Can solved by uninstall this plugin, any side effect?

dodomui avatar Apr 18 '18 01:04 dodomui

I'm facing a similar problem. I found when I am using wifi, everything goes well, but in 4g the splash screen will stop there for about 30 secs. After I installed cordova-plugin-wkwebview-ionic-xhr, the problem was solved.

murmurwoods avatar Apr 19 '18 03:04 murmurwoods

This issue should be fixed once these issues get merged in: https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/110 https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/41

#110 is already merged, and hopefully, #41 will be done soon (I'm working on it)

jacquesdev avatar Jun 08 '18 13:06 jacquesdev

@jacquesdev Hi, do you know when #41 will be merged ? I also faced this bug on a production app. For now, I reinstalled the plugin on the top of the 1.x branch to get your #110 merged, but still, I wonder if this issues only will fixed that bug.

EDIT : Oh, I just saw that the #117 is for the v2 beta... @jacquesdev Did you switch to v2 ? For now I just can't ...

Thanks

thiphariel avatar Jun 28 '18 11:06 thiphariel

@thiphariel, I have not switched yet, but as I understand it’s basically the same.

So I will be switching soon.

jacquesdev avatar Jun 28 '18 13:06 jacquesdev

@jacquesdev I tried the v2 beta (without ionic-native wrapper cause I can't upgrade this one) with the @ghenry22 fork (#117), but I still have this bug... Could it be plugins incompatibility ? This bug is really random and I can't reproduce it myself yet (just clients echoes for now)

Here is my cordova plugin ls :

com.googlemaps.ios 2.6.0 "Google Maps SDK for iOS"
cordova-background-geolocation 2.11.0-beta.4 "BackgroundGeolocation"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-fetch 5.3.0 "CDVBackgroundFetch"
cordova-plugin-badge 0.8.7 "Badge"
cordova-plugin-cocoalumberjack 0.0.4 "CocoaLumberjack"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-email-composer 0.8.15 "EmailComposer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-googlemaps 2.1.1 "cordova-plugin-googlemaps"
cordova-plugin-inapppurchase 1.1.0 "In App Purchase"
cordova-plugin-ionic-webview 2.0.0-beta.1 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-nativestorage 2.3.1 "NativeStorage"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.1 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
onesignal-cordova-plugin 2.3.1 "OneSignal Push Notifications"

thiphariel avatar Jun 29 '18 06:06 thiphariel

@thiphariel, I have the same issue. It looks like the changes that @ghenry22 made did not make the issue go away unfortunately.

I know there were a couple of additional settings to be done in xcode which (i assumed) I did, but my clients still experience it, and I can’t recreate it. It also seems to slow things down for the app when resumed so that some ui elements don’t load properly.

jacquesdev avatar Jul 03 '18 17:07 jacquesdev

@jacquesdev Yup, same for me. Except the resume thing, I did not experienced a behaviour like that

thiphariel avatar Jul 03 '18 17:07 thiphariel

My changes are to allow background operation of javascript processing for the web view.

I don’t have any issues with the splashscreen at all in my apps.

I have seen this behaviour once before when the app is triggered in the background by a notification and doesn’t fully launch. On the next clean launch the app is already in a broken state and will hang at the splashscreen.

To fix this particular scenario there is another PR related that was just a small javascript change that addressed this exact issue where someone was experiencing it with a VOIP app where a notification would wake the app in the background but it wouldn’t fully load and would then be in a broken state.

ghenry22 avatar Jul 03 '18 18:07 ghenry22

@ghenry22 Are you talking about #45 ? Do you know why it's not totally merged into this repo ?

thiphariel avatar Jul 04 '18 08:07 thiphariel

I have also recently been experiencing this issue with the plugin when the app is booted in the background via a VoIP push. After looking here I noticed the pull request #58 that upon trying out resolved my problems. I was therefore happy to see that that the pull request was closed due to #117. I noticed that this has been merged into the master branch so I pulled from the latest code on master hoping for the fix to be in but I am back to having the app not fully load again.

If it helps, I have though found that I can repeat the situation of the app not fully loading in the background via a VoIP push if either the phone has been rebooted and the app has NOT been opened already or the app has been force killed by me. If however the app is been started already and then killed by the OS after going into the background then the app fully loads in the background with a VoIP push.

RichardLewin87 avatar Jul 04 '18 09:07 RichardLewin87

https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/58

this is the one I was talking about. This is a tiny change to the javascript only and resolved the problem I mentioned above which can cause the symptoms with the splash screen hanging.

ghenry22 avatar Jul 04 '18 14:07 ghenry22

So basically, #58 has never been merged into this repo ? I gonna try this and see if it solve the splashscreen bug. Thanks

thiphariel avatar Jul 04 '18 15:07 thiphariel

@thiphariel - any luck on this? I also read about this possible solution: https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/95#issuecomment-382599735

Will try that in the meantime

jacquesdev avatar Jul 16 '18 10:07 jacquesdev

Hi. I switched to the beta v2 webview and the problem is nearly gone on iOS side. Still got some issues but they are really few so I'm ok with this right now.

thiphariel avatar Jul 16 '18 10:07 thiphariel

I have submitted a new PR to beta2 which merges the changes from that other PR which should resolve this. You will also need to set the suspend in background value to FALSE in your config.xml. Once done this should be resolved.

Provided of course that background launching of the app was the cause of your issue. There may of course be other causes of the issue but this is the only time I have seen it and this resolved the issue in an app I was working on.

ghenry22 avatar Jul 17 '18 15:07 ghenry22

Are we going to get any feedback on any of these issues? Or is it going to be typical Ionic Team where breaking issues in the framework go ignored for years until the next version is released? Hoping for a fix for this by Ionic v5.

Bengejd avatar Aug 09 '18 18:08 Bengejd

On cold-start of the application I can confirm this issue exists. But if you start the app, force close as it's stalled on splash screen, and restart, then it loads perfectly fine. I'm using v1.1.16 of this plugin, and as I don't typically enjoy updating all packages when a product is operating fine (since newer versions always tend to come with a host of new issues of their own), can anyone confirm that a newer version of this plugin solves the issue? Thanks!

kevryan2 avatar Aug 17 '18 12:08 kevryan2

If you install the latest version directly from the github repo it has a fix for this merged now.

You must set the WKSuspendInBackground option to FALSE in your config.xml when you have the latest version installed and you should be good to go.

ghenry22 avatar Aug 17 '18 12:08 ghenry22

@ghenry22 thanks for the quick response, will try this upgrade today and post confirmation it's fixed as soon as I am able to test

kevryan2 avatar Aug 17 '18 12:08 kevryan2

I can confirm that this seems to fix this issue (will continue to test as sometimes it takes 12+ hours of an app being closed to experience this, but so far so good!), upgrading and adding <preference name="WKSuspendInBackground" value="false" /> to config.xml should be the accepted answer here so far.

(P.S. this is a topic for a different thread I just started (https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/148), but upgrading does however cause significant issues using locally stored assets on iOS which will be a huge issue for us and I will need to switch back asap if I can't find a workaround, even after following the suggested switch from normalizeURL to convertFileSrc; note that this does work on Android) @ghenry22 have you guys run into this at all/have suggestions?)

kevryan2 avatar Aug 22 '18 12:08 kevryan2

Oh God... 16 Apr - 26 Sep now and issue is still there... I'm praying for the above solution to magically fix it.

LufoX11 avatar Sep 26 '18 20:09 LufoX11

Get the latest version of the plugin, set the config.xml values to enable background mode, add the appropriate background mode capability for what your app is doing in Xcode (ie remote notifications, geolocation, background fetch etc).

That should resolve the issue, it has for me in every case where I was seeing this.

It resolves the case where your app is triggered in background by a remote notification and then is hung when you bring it to the foreground.

It also resolved the case where after the operating system suspends the app in the background and you bring it back to the foreground some hours or a day later where open sockets to the built in web server get stuck in an error State and not reset so again it would hang at the splashscreen.

ghenry22 avatar Sep 30 '18 04:09 ghenry22

@KevRyan2, try the latest version there were a few bugs fixed related to access to local resources, particularly audio/video resources and errors when trying to access a file that didn’t exist.

ghenry22 avatar Sep 30 '18 04:09 ghenry22

@ghenry22 awesome thank you, I will test that this asap when I return to this project. excited to be able to fully upgrade and take advantage of all the optimizations that have been made

kevryan2 avatar Oct 01 '18 13:10 kevryan2

Hi @ghenry22 I am facing the below issue when using WKSuspendInBackground=false. Any help on this would be greatly appreciated.

https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/189

write2sv avatar Oct 09 '18 15:10 write2sv

Note: I've seen the stuck splashscreen (ios) when I have two versions (different environments) of my app installed on the same device. Switching between them and doing things like showing toast while backgrounding seems to cause a crash. After that the crashed app gets stuck on splash each time it starts until I force close the other, however ensuring I have a different WKPort for each environment seems to cure it.

https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/165

graemeenglish avatar Oct 18 '18 14:10 graemeenglish

I'm experiencing the same issue with this plugin. I've narrowed it down to the following scenario:

  • let the app listen for geofences (https://github.com/cowbell/cordova-plugin-geofence)
  • make sure the app is killed
  • trigger the geofence via the simulator
  • the app will start in the background to handle the geofence
  • as a side effect the webview get's loaded (I think this shouldn't happen)
  • manually start the app and it will stays stuck on the splash screen

Above scenario is observed by setting various breakpoints in the CDVWKWebViewEngine class:

  • pluginInitialize
  • loadRequest
  • didFailNavigation

larsvliet avatar Nov 21 '18 22:11 larsvliet