Navigation Menu

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

ios 12 app stuck on splashscreen #157

Closed
ghost opened this issue Sep 18, 2018 · 20 comments
Closed

ios 12 app stuck on splashscreen #157

ghost opened this issue Sep 18, 2018 · 20 comments

Comments

@ghost
Copy link

ghost commented Sep 18, 2018

I have a problem with my app after upgrading to ios 12. On my app i have an check if a user logged in or not if he logged in i route the user with a window.location to his startscreen. If he doesnt log in he get the first side without any redirect. After the upgrade to ios 12 the splashscreen is after the redirect not closing i can see behind the splashscreen that the screens correct loading only the splashscreen is all the time open. If the user not logged in the app is worked correctly. And if i disable the splashscreen plugin the app is also totally worked. Is there a problem with redirects an the splashscreen plugin? With ios 11 all is working.

@janpio janpio added the support label Sep 18, 2018
@janpio
Copy link
Member

janpio commented Sep 18, 2018

How are you closing the splashscreen?

@ghost
Copy link
Author

ghost commented Sep 18, 2018

At the moment we use only this line for closing the splashscreen in the config.xml:

<preference name="AutoHideSplashScreen" value="true" />

This worked smooth before ios 12

@janpio
Copy link
Member

janpio commented Sep 18, 2018

Maybe using https://github.com/apache/cordova-plugin-splashscreen#splashscreenhide at the right moment might already solve your problem?

@ghost
Copy link
Author

ghost commented Sep 18, 2018

We tried this before but the code will be ignored so the splashscreen will not be closed. This will also not worked if we set the <preference name="AutoHideSplashScreen" value="true" /> to false

@janpio
Copy link
Member

janpio commented Sep 18, 2018

Can you reproduce the problem in a new app created with cordova create somehow?

@ghost
Copy link
Author

ghost commented Sep 19, 2018

Yes i can reproduce but now i can figure out that the error based on a custom fonts. When i have the custom font Raleway in my code on the startscreen the splashscreen stucks

@janpio
Copy link
Member

janpio commented Sep 19, 2018

Awesome, so you totally isolated the bug 💯
That is pretty strange though.

How do you include the font?

@flofis
Copy link

flofis commented Oct 5, 2018

I have roughly the same issue, however I am not sure that I am able to pinpoint it to a font.
In my case the CDVPageDidLoadNotification is never received (however the page is available, manually hiding the screen works).

I am currently debugging CDVUIWebViewDelegate code to figure out why.
The state

case STATE_WAITING_FOR_LOAD_FINISH:
if (_loadCount == 1) {
fireCallback = YES;
_state = STATE_IDLE;
}
_loadCount -= 1;
break;

is never achieved. Thus there never is a callback.
I also see strange requests for 'URL=about:blank' while debugging, and suspect this is the reason.

@flofis
Copy link

flofis commented Oct 9, 2018

I am now decently sure that the root cause is a decoding error when loading an image...

@giulians
Copy link

giulians commented Oct 9, 2018

Hi I think I found a patch:

in folder plugin in CDVspashscreen.m

change
[self setVisible:NO andForce:YES];

with
[self setVisible:NO];

and then use the js in your first page

window.setTimeout(function () {

              navigator.splashscreen.hide();
              }, 1000); // choose 1000 or different waiting time

Hope it help ;) !

@flofis
Copy link

flofis commented Oct 10, 2018

I solved it with a similar workaround (i.e. I was using an event) and called hide().
I guess this is a fundamental cordova problem related to when CDVPageDidLoadNotification is fired.

@giulians
Copy link

event? Can u make example?

@lukeschuyler
Copy link

I think I know what you mean @flofis -- I did this too. Instead of placing the hide in a setTimeout, I ran hide in another event. Thanks for the help @giulians!

@vagnerbertoni

This comment has been minimized.

@tishun
Copy link

tishun commented Aug 14, 2019

My team started having the same exact problem. The solution that worked for us was to manually hide the splash screen specifically for iOS (because manually hiding for Android also failed):

<platform name="android">
   ...
</platform>
<platform name="ios">
   <preference name="AutoHideSplashScreen" value="false" />
   ...
</platform>

and then

onDeviceready(){
   window.navigator.splashscreen.hide();
}

@yokins
Copy link

yokins commented Aug 28, 2019

i have the same problem :(

@FireLizard
Copy link

FireLizard commented Jun 5, 2020

Setting AutoHideSplashScreen to false in config.xml and calling navigator.splashscreen.hide(); (on deviceready of course) does not work on my iPhone 7 with iOS 13.3.1

Do you have any hint?

$ npm ls cordova cordova-ios
my-project@0.1.0 ~
├── cordova@9.0.0 
└── cordova-ios@5.1.1

@FireLizard
Copy link

Updating cordova-ios to v6.0.0 solved my problem

@jcesarmobile
Copy link
Member

apps hanging on the splash screen problem is usually caused by javascript problems in the app, has nothing to do with the splash screen plugin
Also, the plugin has been integrated into cordova-ios 6, so no more iOS work will be done here.
If there are still bugs on the cordova-ios 6 implementation, report them on https://github.com/apache/cordova-ios/issues, but if the problem is that the app hangs, please, first check for javascript errors in your apps

@tishun
Copy link

tishun commented Jun 30, 2020

Might also be related to this:

  • Fix invisible SplashScreen bugs (since 6.0.0)

A bug in Cordova iOS 6.0.0 would cause the splashscreen to be invisible unless a BackgroundColor preference was set in config.xml. This was not the intended behaviour, and caused a lot of confusion about not being able to interact with the webview behind the splashscreen.

In Cordova iOS 6.1.0, we've fixed the splashscreen so that it will always have a background colour (defaulting to the system background colour) and so that the launch storyboard image should remain visible.

To customize the background colour of your app and its splashscreen, use the BackgroundColor preference in config.xml.

https://cordova.apache.org/announcements/2020/06/23/cordova-ios-6.1.0.html

If any of you is still having problems you can try updating to 6.1.0 to see if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants