瀏覽代碼

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

Sebastián Katzer 11 年之前
父節點
當前提交
5a098fb419
共有 1 個文件被更改,包括 4 次插入3 次删除
  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;