Browse Source

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

Sebastián Katzer 11 years ago
parent
commit
5a098fb419
1 changed files with 4 additions and 3 deletions
  1. 4 3
      www/local-notification.js

+ 4 - 3
www/local-notification.js

@@ -205,10 +205,11 @@ LocalNotification.prototype = {
     oncancel: function (id, state, json) {}
     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();
     plugin.applyPlatformSpecificOptions();
-}, false);
+});
 
 
 module.exports = plugin;
 module.exports = plugin;