question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On my Google Pixel 3XL (updated to Android 12), when I try to schedule a notification using v9.1.0-preview01, I get the following message:

See original GitHub issue

On my Google Pixel 3XL (updated to Android 12), when I try to schedule a notification using v9.1.0-preview01, I get the following message:

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

I don’t see a notification after I schedule it. I uninstalled my app before trying to deploy the app through visual studio again.

_Originally posted by @gaurakshay in https://github.com/thudugala/Plugin.LocalNotification/discussions/217#discussioncomment-1553234_

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tranb3rcommented, Oct 31, 2021

Adding PendingIntentFlags.Immutable seems to work.

var pendingIntent = PendingIntent.GetActivity(Application.Context, request.NotificationId,
                notificationIntent,
                PendingIntentFlags.CancelCurrent | PendingIntentFlags.Immutable);
1reaction
thudugalacommented, Oct 31, 2021

@tranb3r and @gaurakshay can you try changing PendingIntentFlags.CancelCurrent to see what value works for you?

in Source/Plugin.LocalNotification/Platform/Droid/NotificationServiceImpl.cs

var pendingIntent = PendingIntent.GetActivity(Application.Context, request.NotificationId,
                notificationIntent,
                PendingIntentFlags.CancelCurrent);

Please direct reference the project

Read more comments on GitHub >

github_iconTop Results From Across the Web

Delayed notifications since Android 12 update
For apps that have delayed notifications, enable unrestricted battery use by long pressing on the app shortcut, going to App info, then battery....
Read more >
Get Android 12
You can get Android 12 in any of these ways: Get Android 12 on a Google Pixel device; Set up an Android emulator;...
Read more >
how to stop System out of date update pop-up - XDA Forums
Just letting you know, if it pops up & you accidentally hit the update button, turn off wifi & data, then clear the...
Read more >
Notification delay is driving me crazy!! : r/GooglePixel
It's about two weeks now and I am getting this awful delay of notifications which is quite a bummer because I use those...
Read more >
Factory Images for Nexus and Pixel Devices
This page contains binary image files that allow you to restore your Nexus or Pixel device's original factory firmware. You will find these...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found