Phonegap deviceready not firing using Cordova 2.2.0 in iOS

前端 未结 5 2075
失恋的感觉
失恋的感觉 2021-01-02 06:59

I am building a PhoneGap App. Unfortunately, when deploying to iOS devices and simulators the deviceready event never fires. I\'m using Phonegap 2.2.0.

5条回答
  •  情话喂你
    2021-01-02 07:07

    in my html I have a onload that triggers that adding of an event listener to deviceready

          function onDeviceReady() {
            console.log("we are an app");
            MyApp.initialize_phonegap();
          }
    
          function onBodyLoad() {   
            document.addEventListener("deviceready", onDeviceReady, false);
          }
    
        
    
      
    
      
    

提交回复
热议问题