nativescript-local-notifications icon indicating copy to clipboard operation
nativescript-local-notifications copied to clipboard

Ability to Create Silent notification channel in Android

Open NikolayBa opened this issue 6 years ago • 0 comments
trafficstars

As a requirement for our app, we needed to create a silent notification channel. (doesn't pop, just stays ongoing)

Whenever creating a Notification channel, we would set it the following way with native code:


let NOTIFICATION_CHANNEL_ID = "org.nativescript.TestAndroidNotification";
let channelName = "Ongoing Test notification";

const chan = new (<any>android.app).NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, (<any>android.app).NotificationManager.IMPORTANCE_LOW);

chan.setLockscreenVisibility((<any>android.app).Notification.VISIBILITY_PRIVATE);

Further, when using the plugin, if I use the same channelName for the "channel" property, this ends up creating a new channel with the same name. So as a workaround, only this notification is created natively.

Just figured it would be useful to have this feature in the plugin, so might as well log it

NikolayBa avatar Aug 26 '19 13:08 NikolayBa