Commit 5afa40a8 by Sebastián Katzer

Hotfix: device plugin isnt available before the onCordovaInfoReady event. (Fixes #126)

parent 56782af0
...@@ -208,26 +208,26 @@ LocalNotification.prototype = { ...@@ -208,26 +208,26 @@ LocalNotification.prototype = {
var plugin = new LocalNotification(), var plugin = new LocalNotification(),
channel = require('cordova/channel'); channel = require('cordova/channel');
channel.onCordovaReady.subscribe( function () {
plugin.applyPlatformSpecificOptions();
});
channel.deviceready.subscribe( function () { channel.deviceready.subscribe( function () {
cordova.exec(null, null, 'LocalNotification', 'deviceready', []); cordova.exec(null, null, 'LocalNotification', 'deviceready', []);
}); });
channel.onCordovaReady.subscribe( function () { channel.onCordovaReady.subscribe( function () {
if (device.platform != 'iOS') { channel.onCordovaInfoReady.subscribe( function () {
channel.onPause.subscribe( function () { if (device.platform != 'iOS') {
cordova.exec(null, null, 'LocalNotification', 'pause', []); channel.onPause.subscribe( function () {
}); cordova.exec(null, null, 'LocalNotification', 'pause', []);
});
channel.onResume.subscribe( function () {
cordova.exec(null, null, 'LocalNotification', 'resume', []);
});
channel.onResume.subscribe( function () {
cordova.exec(null, null, 'LocalNotification', 'resume', []); cordova.exec(null, null, 'LocalNotification', 'resume', []);
}); }
cordova.exec(null, null, 'LocalNotification', 'resume', []); plugin.applyPlatformSpecificOptions();
} });
}); });
module.exports = plugin; module.exports = plugin;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment