0

I am using Xamarin.iOS and I know that ReceivedLocalNotification is deprecated on iOS 10+

So I implemented:

 UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();

Which leads to following:

public class UserNotificationCenterDelegate : UNUserNotificationCenterDelegate { 

    public UserNotificationCenterDelegate() { } 

    public override void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification, Action<UNNotificationPresentationOptions> completionHandler) 
    {
        completionHandler(UNNotificationPresentationOptions.Alert); 
    } 

    public override void DidReceiveNotificationResponse(UNUserNotificationCenter center, UNNotificationResponse response, Action completionHandler)
    {
        ....
    }
}

I am using iOS 10/ iOS 11 and the Local Notification fires in background but I am not able to get the event.

Is this even possible to get the event when Local Notification is fired without the user interacting with it?

  • refer to https://stackoverflow.com/questions/45315483/ios-open-page-from-local-notification/45319426#45319426 – ColeX Oct 27 '17 at 12:22
  • How does it help? Push notification stops at WillPresentNotification when appears, but Local Notification is not – Josep95 Oct 27 '17 at 13:31
  • What do you really want? get `DidReceiveNotificationResponse` or `WillPresentNotification` without any user interaction? – ColeX Oct 30 '17 at 02:05

0 Answers0