mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-15 03:54:54 +00:00
Update existing intent rather than replace it
For the use case of using the notification as a timer. If you update the notification frequently, then tapping it would typically not resume the app as the PendingIntent had been cancelled. Instead updates to the notification now update the PendingIntent rather than replacing it, which makes sense for most cases.
This commit is contained in:
parent
cd1fb46dcc
commit
6d58038046
@ -177,7 +177,7 @@ public class ForegroundService extends Service {
|
|||||||
if (intent != null && settings.optBoolean("resume")) {
|
if (intent != null && settings.optBoolean("resume")) {
|
||||||
|
|
||||||
PendingIntent contentIntent = PendingIntent.getActivity(
|
PendingIntent contentIntent = PendingIntent.getActivity(
|
||||||
context, NOTIFICATION_ID, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
context, NOTIFICATION_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
notification.setContentIntent(contentIntent);
|
notification.setContentIntent(contentIntent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user