Option to turn off notification timer
Android notifications have a "how long ago was this notification set" timer. Now there's an option to turn that off (the default is true, so it's shown, matching current behavior).
This commit is contained in:
parent
167245b0b9
commit
79e8150d3e
@ -155,7 +155,8 @@ cordova.plugins.backgroundMode.setDefaults({
|
|||||||
channelDescription: String, // Shown when the user views the channel's settings
|
channelDescription: String, // Shown when the user views the channel's settings
|
||||||
allowClose: Boolean, // add a "Close" action to the notification
|
allowClose: Boolean, // add a "Close" action to the notification
|
||||||
closeIcon: 'power', // An icon shown for the close action
|
closeIcon: 'power', // An icon shown for the close action
|
||||||
closeTitle: 'Close' // The text for the close action
|
closeTitle: 'Close', // The text for the close action
|
||||||
|
showWhen: Boolean //(Default: true) Show the time since the notification was created
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -199,7 +199,8 @@ public class ForegroundService extends Service {
|
|||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setContentText(text)
|
.setContentText(text)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setSmallIcon(getIconResId(settings));
|
.setSmallIcon(getIconResId(settings))
|
||||||
|
.setShowWhen(settings.optBoolean("showWhen", true));
|
||||||
|
|
||||||
if (!subText.equals("")) {
|
if (!subText.equals("")) {
|
||||||
notification.setSubText(subText);
|
notification.setSubText(subText);
|
||||||
|
@ -395,7 +395,8 @@ exports._defaults = {
|
|||||||
channelDescription: 'cordova-plugin-background-moden notification',
|
channelDescription: 'cordova-plugin-background-moden notification',
|
||||||
allowClose: false,
|
allowClose: false,
|
||||||
closeIcon: 'power',
|
closeIcon: 'power',
|
||||||
closeTitle: 'Close'
|
closeTitle: 'Close',
|
||||||
|
showWhen: true
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user