Search code examples
ibm-mobilefirstandroid-notificationsnotificationcenter

Does Worklight have an API for adding local notifications to the Android notification bar / iOS notification center?


Does Worklight have an API for adding local notifications to the Android notification bar / iOS notification center?

Use case - If the app is in the background, and if there is some information to be updated to the user, I would like to add a local notification to the notification bar. This is not a push notification use case since this is not triggered by server.


Solution

  • Worklight does not provide API for local notifications in either Android or iOS.
    To add this functionality you will need to either:

    • Implement on your own native API provided by the platform by implementing a Cordova plug-in to interface with it, or
    • Find an existing Cordova plug-in that does this and use it in your application

    You can read through the following questions which touch base on the same topic:

    The Katzer Cordova plug-in mentioned above is not trivial to implement (because Worklight also does not support using Cordova Plug-man to 'install' some existing Cordova plug-ins, so it requires extra manual tinkering), but it does work (tested at least in Android).