Ver código fonte

Make sure that platform specific properties are added before custom deviceready events were called

Sebastián Katzer 11 anos atrás
pai
commit
5a098fb419
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      www/local-notification.js

+ 4 - 3
www/local-notification.js

@@ -205,10 +205,11 @@ LocalNotification.prototype = {
     oncancel: function (id, state, json) {}
 };
 
-var plugin = new LocalNotification();
+var plugin  = new LocalNotification(),
+    channel = require('cordova/channel');
 
-document.addEventListener('deviceready', function () {
+channel.onCordovaReady.subscribe( function () {
     plugin.applyPlatformSpecificOptions();
-}, false);
+});
 
 module.exports = plugin;