Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Resetting plugins due to page load" when launching Cordova app on iPhone

So I have built this Cordova 4.0 app which works fine on Android, but when running on my iPhone I run into an error.

When launching the app I get a white screen for about two minutes and in the Xcode console it says Resetting plugins due to page load.

On SO I have found some suggested solutions to this error:

1. Resetting plugins due to page load

This one looks reasonable because it suggests it's a problem with jQuery Mobile which I am using. However, I don't use $.changePage(); anywhere in my code. Also, it would appear that this is solved in Cordova 4.0 https://issues.apache.org/jira/browse/CB-2602

2. Phonegap/Cordova 3.1 Resetting plugins due to page load

This one concludes that this is an error message you can safely ignore. In my case, I can't really ignore those two minute of white screen.

Here's the code which is loaded on app-load: http://pastebin.com/zSAYkdUB

What can be done?

like image 945
Jonas Bolin Avatar asked Nov 19 '14 00:11

Jonas Bolin


1 Answers

You'll see this message in every Cordova iOS app. (Try with the sample app.) It's printed when the webView begins to load resources. See the code here.

It also fires the CDVPluginResetNotification at the same time which calls onReset on all of the plugins. According to the code this method should be overridden to cancel long running requests when the webview refreshes.

like image 97
Connor Avatar answered Sep 24 '22 11:09

Connor