-
Notifications
You must be signed in to change notification settings - Fork 93
Conflict with the Splashscreen plugin when starting the app offline #92
Comments
Hi @pauloya it sounds like we are not firing an event that the cordova-plugin-splashscreen is looking for. So for clarity, the splash screen shows instead of the offline page, not on top of it correct? And it fails if it is set to auto and if it is set to timed delay?
|
I'm attaching macOS Safari debugger to the iOS device, and I see that the offline page is there. So when I try to call from the console: |
Just to clarify, is there anything different about the offline page that prevents cordova APIs to work correctly? I noticed that when hooking the Safari devtools with the app there are 2 different instances of browser that show up, is this because the offline page is rendered inside a non standard cordova webview? |
The reason why we use two different webviews is so that when you go back online, we can just switch webviews and keep you in context. With iOS we would often get a page refresh where we would loose the session info. |
I'm sure you know this better than me, but a quick look at the code indicates the offline view is a [UIWebView] which, perhaps doesn't bind access with Cordova even though I include it. [CDVViewController] should work instead. |
Also seeing it. If network status changes after hosted url has been loaded then offline page is shown, but If I start the app while offline then i'm stuck on splashscreen |
Hi @pauloya I do remember some issue with offline, splashscreen and cordova APIs. @f2bo , @DaveVoyles or @jasonshortphd did any of you help fix a problem like this? |
Looks like since url in |
@boyofgreen Yes. We did fix an issue (#59) with offline in iOS, but it was a different scenario. @pauloya Just to confirm, do you mean you see the splashscreen instead of the offline page while the device is offline? |
We found a workaround for this.
Yes, the problem was that the splashscreen stayed on when the device was offline. The workaround is to open a local HTML that does a document.location.href = "..."; to redirect to the remote host. We looked at the splashscreen code and it relies on a pageload event to start any logic of hiding the splashscreen even when using a delay splashscreen. If you use the splashscreen plugin and there is no page load the splashscreen will never go away. We set up a delay of 10s on the splashscreen and we call |
This is my work around: |
Hi,
I'm testing an iOS app, using the cordova-plugin-splashscreen to control when the splashscreen goes away programmatically. The problem is that when the app starts offline I can't hide the asplashscreen, even if I set the configuration to have "AutoHideSplashScreen" to "true", or if I call the hide method:
navigator.splashscreen.hide();
I've tried this both using the default offline page and a custom one.
When I reconnect the device to wifi the splashscreen hides and the remote site is shown correctly.
The text was updated successfully, but these errors were encountered: