Skip to content

Commit

Permalink
code update
Browse files Browse the repository at this point in the history
  • Loading branch information
thudugala committed Jul 14, 2024
1 parent bacce66 commit 72140b2
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@ public override void DidReceiveNotificationResponse(UNUserNotificationCenter cen
UNNotificationResponse response,
Action completionHandler)
{
// if the Notification is type Plugin.LocalNotification.NotificationRequest
// call the base method, else handel it by your self.
// If the notification is typed Plugin.LocalNotification.NotificationRequest
// Call the base method else handle it by yourself.

var notificationRequest = LocalNotificationCenter.GetRequest(response.Notification.Request.Content);
if (notificationRequest != null)
if (notificationRequest is not null)
{
base.DidReceiveNotificationResponse(center, response, completionHandler);
}
else
{
// Write your code here
}
}

public override void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification,
Action<UNNotificationPresentationOptions> completionHandler)
{
// if the Notification is type Plugin.LocalNotification.NotificationRequest
// call the base method, else handel it by your self.
// If the notification is typed Plugin.LocalNotification.NotificationRequest
// Call the base method else handle it by yourself.

if(notification is null)
if (notification is null)
{
return;
}
Expand All @@ -37,5 +41,9 @@ public override void WillPresentNotification(UNUserNotificationCenter center, UN
{
base.WillPresentNotification(center, notification, completionHandler);
}
else
{
// Write your code here
}
}
}

0 comments on commit 72140b2

Please sign in to comment.