Hello,
This Microsoft.Toolkit.Uwp.Notifications
nuget package apply for the WPF, UWP, WinForms, console, you cannot use it in the mac catalyst.
if you want to pusho notification in the Mac catalyst, you can use native iOS api: UNUserNotificationCenter, you can refer to the following code.
#if MACCATALYST
var content = new UserNotifications.UNMutableNotificationContent
{
Title = "Warning! ",
Body = "This is an alert!",
CategoryIdentifier = "WARNING_ALERT",
Sound = UserNotifications.UNNotificationSound.DefaultCriticalSound
};
var trigger = UserNotifications.UNTimeIntervalNotificationTrigger.CreateTrigger(5, false);
var request = UserNotifications.UNNotificationRequest.FromIdentifier("ALERT_REQUEST", content, trigger);
UserNotifications.UNUserNotificationCenter.Current.AddNotificationRequest(request, (error) =>
{
if (error != null)
{
Console.WriteLine("Error: " + error);
}
});
#endif
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.