Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public virtual void OnReceived(IDictionary<string, object> parameters)
resultIntent.SetFlags(AzurePushNotificationManager.NotificationActivityFlags.Value);
}
int requestCode = new Java.Util.Random().NextInt();
var pendingIntent = PendingIntent.GetActivity(context, requestCode, resultIntent,PendingIntentFlags.UpdateCurrent);
var pendingIntent = PendingIntent.GetActivity(context, requestCode, resultIntent, PendingIntentFlags.UpdateCurrent | PendingIntentFlags.Immutable);

var chanId = AzurePushNotificationManager.DefaultNotificationChannelId;
if (parameters.TryGetValue(ChannelIdKey, out object channelId) && channelId != null)
Expand All @@ -318,7 +318,7 @@ public virtual void OnReceived(IDictionary<string, object> parameters)
notificationBuilder.SetLargeIcon(largeIconBitmap);
}
var deleteIntent = new Intent(context,typeof(PushNotificationDeletedReceiver));
var pendingDeleteIntent = PendingIntent.GetBroadcast(context, requestCode, deleteIntent,PendingIntentFlags.CancelCurrent);
var pendingDeleteIntent = PendingIntent.GetBroadcast(context, requestCode, deleteIntent, PendingIntentFlags.CancelCurrent | PendingIntentFlags.Immutable);
notificationBuilder.SetDeleteIntent(pendingDeleteIntent);

if (Build.VERSION.SdkInt < Android.OS.BuildVersionCodes.O)
Expand Down Expand Up @@ -428,15 +428,15 @@ public virtual void OnReceived(IDictionary<string, object> parameters)

extras.PutString(ActionIdentifierKey, action.Id);
actionIntent.PutExtras(extras);
pendingActionIntent = PendingIntent.GetActivity(context, aRequestCode, actionIntent, PendingIntentFlags.UpdateCurrent);
pendingActionIntent = PendingIntent.GetActivity(context, aRequestCode, actionIntent, PendingIntentFlags.UpdateCurrent | PendingIntentFlags.Immutable);

}
else
{
actionIntent = new Intent(context, typeof(PushNotificationActionReceiver));
extras.PutString(ActionIdentifierKey, action.Id);
actionIntent.PutExtras(extras);
pendingActionIntent = PendingIntent.GetBroadcast(context, aRequestCode, actionIntent, PendingIntentFlags.UpdateCurrent);
pendingActionIntent = PendingIntent.GetBroadcast(context, aRequestCode, actionIntent, PendingIntentFlags.UpdateCurrent | PendingIntentFlags.Immutable);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
using System.Linq;

using Android.App;
using Android.Content;
using Firebase.Messaging;

namespace Plugin.AzurePushNotification
{
[Service]
[Service(Exported = false)]
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })]
// ReSharper disable once InconsistentNaming
public class PNMessagingService : FirebaseMessagingService
{
public override void OnMessageReceived(RemoteMessage message)
Expand Down