Skip to content

Commit

Permalink
AvaloniaUI#97 - fixing native notifications sample
Browse files Browse the repository at this point in the history
  • Loading branch information
gentledepp committed Dec 9, 2024
1 parent 9de6a83 commit e1bd8c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<application android:label="Avalonia.Labs.Catalog" android:icon="@drawable/Icon" />
</manifest>
4 changes: 2 additions & 2 deletions src/Avalonia.Labs.Notifications/Android/NativeNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void Show()
.PutExtras(deleteBundle);

var flags = Build.VERSION.SdkInt >= BuildVersionCodes.S ? PendingIntentFlags.Mutable : PendingIntentFlags.UpdateCurrent;

builder.SetContentIntent(PendingIntent.GetActivity(_activity, pendingIntentId + 1, tapIntent, flags))
.SetDeleteIntent(PendingIntent.GetBroadcast(_activity, pendingIntentId + 2, deleteIntent, flags));

Expand Down Expand Up @@ -130,7 +130,7 @@ public void Show()

var actionIntent = new Intent(_activity, typeof(NotificationBroadcastReceiver))
.PutExtras(actionbundle);
var pendingIntent = PendingIntent.GetBroadcast(_activity, pendingIntentId + 3 + i, actionIntent, replyAction != null ? PendingIntentFlags.UpdateCurrent : flags);
var pendingIntent = PendingIntent.GetBroadcast(_activity, pendingIntentId + 3 + i, actionIntent, flags);
var notificationAction = new NotificationCompat.Action.Builder(icon, action.Caption, pendingIntent);

if (!string.IsNullOrWhiteSpace(ReplyActionTag) && replyAction == action)
Expand Down

0 comments on commit e1bd8c2

Please sign in to comment.