Cordova – foregroundNotification

/*
*  Sets notification for service to run in foreground, required for Android O and above   
*/
exports.foregroundNotification = function( channelId, channelName, title, content, targetAllAPIs )
{
exec( null, null, "BDPointSDK", "foregroundNotification", [ channelId, channelName, title, content, targetAllAPIs ] );  
}

Description

This function needs to be called before making the authenticate() call, to provide the notification to the SDK for foreground notification

This functions sets foreground notification for the Bluedot service for Android Oreo and above devices.  Foreground notification is needed as per the background limitation requirements for Android Oreo and above.

Parameters

channelId (String)

The id of the channel. Must be unique per package. A current channel Id used by the application can be provided.

channelName (String)

The name of the channel, recommended maximum length is 40 characters. A current channel name used by the applicattion can be provided.

title (String)

The title of the notification that will appear when the application is running.

content (String)

The content of the notification that will appear when the application is running.

targetAllAPIs (Bool)

Set flag to true to show foreground service notification on all Android OS.  Set to false only required for apps targeting Android Oreo and above.

Created by Bluedot DevOps on August 27, 2018