I have implemented the push service many times even right now its working i am able to receive the notification but don't know why method below is not getting called
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler
I googled and tried to find the solution, then I came across the things that all are already there in my code, but still I am facing this problem, I need you coders help is any thing that we could miss for this issue, Any help will be appreciated.
This method is a delegate method. So to get this called, you have to implement the delegate of UNUserNotificationCenterDelegate in the header file. If you have forgot to use delegate, place it in header file. The example below shows to place delegate for a UIViewController of name ViewController in header file:
@interface ViewController : UIViewController<UNUserNotificationCenterDelegate>
And in the method or implementation file(ViewController.m), in its method viewDidLoad, place
self.userNotificationCenter.delegate = self;
Hope it helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With