Add hidden flag - Fixes #224
This commit is contained in:
parent
35c1e63baf
commit
5bc07f17fb
@ -24,7 +24,7 @@
|
|||||||
- Other apps audio interruption on iOS
|
- Other apps audio interruption on iOS
|
||||||
- __Changes__
|
- __Changes__
|
||||||
- Deprecate event callbacks
|
- Deprecate event callbacks
|
||||||
- Notification not visible anymore on lock screen
|
- Notification not visible by default on lock screen
|
||||||
- Remove ticker property on Android
|
- Remove ticker property on Android
|
||||||
- Remove unexpected back button handler
|
- Remove unexpected back button handler
|
||||||
- Remove support for wp8 platform
|
- Remove support for wp8 platform
|
||||||
|
@ -165,9 +165,12 @@ public class ForegroundService extends Service {
|
|||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setContentText(text)
|
.setContentText(text)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setPriority(Notification.PRIORITY_MIN)
|
|
||||||
.setSmallIcon(getIconResId(settings));
|
.setSmallIcon(getIconResId(settings));
|
||||||
|
|
||||||
|
if (settings.optBoolean("hidden", true)) {
|
||||||
|
notification.setPriority(Notification.PRIORITY_MIN);
|
||||||
|
}
|
||||||
|
|
||||||
if (bigText || text.contains("\n")) {
|
if (bigText || text.contains("\n")) {
|
||||||
notification.setStyle(
|
notification.setStyle(
|
||||||
new Notification.BigTextStyle().bigText(text));
|
new Notification.BigTextStyle().bigText(text));
|
||||||
|
@ -336,10 +336,10 @@ exports._isActive = false;
|
|||||||
exports._defaults = {
|
exports._defaults = {
|
||||||
title: 'App is running in background',
|
title: 'App is running in background',
|
||||||
text: 'Doing heavy tasks.',
|
text: 'Doing heavy tasks.',
|
||||||
ticker: 'Running in background',
|
|
||||||
bigText: false,
|
bigText: false,
|
||||||
resume: true,
|
resume: true,
|
||||||
silent: false,
|
silent: false,
|
||||||
|
hidden: true,
|
||||||
color: undefined,
|
color: undefined,
|
||||||
icon: 'icon'
|
icon: 'icon'
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user