每当我的应用程序处于“退出”或“背景”状态时,我都会点击iPhone中收到的通知。方法didReceiveNotificationResponse
中的应用程序崩溃,发生以下错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWindow userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:]: unrecognized selector sent to instance 0x11be51e40'
是否由于仅 handle the selection of Custom Actions 这种方法而发生? ?因为我的通知只是纯通知,没有任何操作按钮。用户只能点击它以启动应用程序。
在第94行崩溃。如果我注释掉整个方法
didReceiveNotificationResponse
,它将执行第96行而不会崩溃。
我的目标是确定应用程序是在QUIT
还是BACKGROUND
状态下启动的。然后,我将相应地处理Deeplink。我可能可以用...来检查这个……
PushNotificationIOS.getInitialNotification();
-退出状态
PushNotificationIOS.addEventListener('notification', (notification) =>)
-背景状态
更新