5 Replies Latest reply on Sep 12, 2016 3:54 PM by sabrina.84616718

    Device Ready / On Device Ready in iOS - Not firing

    sabrina.84616718 Level 1

      Fires fine in android, doesn't fire in iOS.

       

      ideas? likely problem areas?

       

      It's stopping e being able to use any of the plugins - I've taken apart the .ipa file and the plugin files are there in the right place.

       

      I have script src="cordova.js" type="text/javascript" charset="utf-8"  in my index.html

       

      I only have ondeviceready in one place in my js

       

      alert("testalert");

      document.addEventListener("deviceready", function(){

      alert("deviceready");

      //CODE HERE

        }, false);

       

      Fine in Android. Test alert shows up fine in both, but deviceready never fires

       

      I'm a bit of an amateur so please bear with me but I'd really appreciate some help.

       

      I heard elsewhere that the content security policy can be an issue

       

      I have tried

      - no policy (completely removed - i have to have it removed in android to get device ready to work)

      -meta http-equiv="Content-Security-Policy" content="default-src * data: gap: 'unsafe-inline' 'unsafe-eval'; style-src * 'unsafe-inline'; media-src *" /

      -meta http-equiv="Content-Security-Policy" content="default-src 'self' data:* gap://* tel:* 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'" /

       

      none helped.

       

      Please help me!