Commit 5afa40a8 authored by Sebastián Katzer's avatar Sebastián Katzer
Browse files

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

parent 56782af0
Loading
Loading
Loading
Loading
+4 −4
Changes for www/local-notification.js: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -208,15 +208,12 @@ LocalNotification.prototype = {
var plugin  = new LocalNotification(),
    channel = require('cordova/channel');

channel.onCordovaReady.subscribe( function () {
    plugin.applyPlatformSpecificOptions();
});

channel.deviceready.subscribe( function () {
    cordova.exec(null, null, 'LocalNotification', 'deviceready', []);
});

channel.onCordovaReady.subscribe( function () {
    channel.onCordovaInfoReady.subscribe( function () {
        if (device.platform != 'iOS') {
            channel.onPause.subscribe( function () {
                cordova.exec(null, null, 'LocalNotification', 'pause', []);
@@ -228,6 +225,9 @@ channel.onCordovaReady.subscribe( function () {

            cordova.exec(null, null, 'LocalNotification', 'resume', []);
        }

        plugin.applyPlatformSpecificOptions();
    });
});

module.exports = plugin;