简体   繁体   中英

phonegap android app only showing connecting to device

I AM creating a phonegap android app. I am creating this app using help of this tutorial . When i am istalling this app on device its onDeviceReady function is not working. It is only showing coneecting to device. My onDeviceReady function is below:-

onDeviceReady: function() {
    app.receivedEvent('deviceready');
    alert('device ready');
    try {
        var pushNotification = window.plugins.pushNotification;
        pushNotification.register(app.successHandler, app.errorHandler,{"senderID":"41327727848","ecb":"app.onNotificationGCM"});
    } catch (ex) {
        alert('error: ' + ex);
    }
},

It does not alert anything. I can't find the error.

Here are the suggestions you can try:

  • make sure you have added cordova.js into your html file.
  • deviceready function should be called after cordova.js is loaded.

the link you've provided is using old version version of plugin.( link-old plugin ).I advice you to follow the new one which is this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM