Search code examples
androidcordovacordova-plugins

Cordova Push Notification Plugin not working properly in android 6.0


I am developing a cordova android app in which i have used cordova notification plugin (https://github.com/katzer/cordova-plugin-local-notifications). Everything is working fine in all android version except marshmallow. it is not working on their time when I set its interval "week" or if I set minutes value of week(10080). But it is working fine on marshmallow when i set the interval value 1. This is my code.

cordova.plugins.notification.local.schedule({
                id: id,
                title: merchName,
                text: h_name,
                firstAt:d,
                every: "week",
                sound: sound,
                badge: id
            });  

Solution

  • In de.appplant.cordova.notification.Notification.java just have to change

            getAlarmMgr().set(AlarmManager.RTC_WAKEUP, triggerTime, pi);
    

    To

           getAlarmMgr().setExact(AlarmManager.RTC_WAKEUP, triggerTime, pi);