Ios 中心未收到通知响应未被呼叫

Ios 中心未收到通知响应未被呼叫,ios,objective-c,xcode,cocoa,push-notification,Ios,Objective C,Xcode,Cocoa,Push Notification,我已经实现了很多次推送服务,甚至现在它还在工作,我能够收到通知,但不知道为什么下面的方法没有被调用 -(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler 我在谷歌上搜索并试图找到解决方案,

我已经实现了很多次推送服务,甚至现在它还在工作,我能够收到通知,但不知道为什么下面的方法没有被调用

-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler

我在谷歌上搜索并试图找到解决方案,然后我发现了代码中已经存在的所有内容,但我仍然面临这个问题,我需要您的编码人员帮助。对于这个问题,我们可能会错过任何帮助,我们将不胜感激。

此方法是一种委托方法。因此,要调用此函数,您必须在头文件中实现UNUserNotificationCenterDelegate的委托。如果忘记使用委托,请将其放在头文件中。下面的示例显示如何在头文件中放置名为ViewController的UIViewController的委托:

 @interface ViewController : UIViewController<UNUserNotificationCenterDelegate>

希望有帮助:)

看到这个@iShwar了吗?你的问题解决了吗?您能帮助我吗?
[UnuseNotificationCenter currentNotificationCenter].delegate=self在我的案例中这样做:)
self.userNotificationCenter.delegate = self;