Skip to content

Commit 063baf8

Browse files
rajveermalviyagnprice
authored andcommitted
notif: Remove legacy PendingIntentFlag.updateCurrent flag
Docs: https://developer.android.com/reference/android/app/PendingIntent#FLAG_UPDATE_CURRENT According to the documentation, this flag is only necessary when we want to update the extras data without causing a new PendingIntent entry to be created. Since we no longer pass any extras data, this flag is no longer required.
1 parent 2a86727 commit 063baf8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/notifications/display.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ class NotificationDisplayManager {
192192
// The intent data URL is distinct for each conversation, so this value
193193
// doesn't matter.
194194
requestCode: 0,
195-
196-
// TODO is setting PendingIntentFlag.updateCurrent OK?
197-
// (That's a legacy of `flutter_local_notifications`.)
198-
flags: PendingIntentFlag.immutable | PendingIntentFlag.updateCurrent,
195+
flags: PendingIntentFlag.immutable,
199196
intent: AndroidIntent(
200197
action: IntentAction.view,
201198
dataUrl: intentDataUrl.toString(),

test/notifications/display_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ void main() {
225225
final expectedGroupKey = '${data.realmUrl}|${data.userId}';
226226
final expectedId =
227227
NotificationDisplayManager.notificationIdAsHashOf(expectedTag);
228-
const expectedIntentFlags =
229-
PendingIntentFlag.immutable | PendingIntentFlag.updateCurrent;
228+
const expectedIntentFlags = PendingIntentFlag.immutable;
230229
final expectedSelfUserKey = '${data.realmUrl}|${data.userId}';
231230
final expectedIntentDataUrl = NotificationOpenPayload(
232231
realmUrl: data.realmUrl,

0 commit comments

Comments
 (0)