Search code examples
androidcordovanotificationsionic-frameworkcordova-plugins

How to make cordova local notification on android sticky


I am using this cordova plugin and wondering if it is possible to make the local notifications sticky/non-removable?


Solution

  • It wasn't that bad. Just set the native option "ongoing: true" in the plugin:

    scheduleActiveAlarm = function () {
      cordova.plugins.notification.local.schedule({
          id: 1,
          text: 'Test text',
          ongoing: true
      });
    };
    

    https://github.com/katzer/cordova-plugin-local-notifications/wiki/04.-Scheduling