Whenever my app is in either QUIT or BACKGROUND state, I tap on the notification received in iPhone. App crashed at method didReceiveNotificationResponse
with the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWindow userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:]: unrecognized selector sent to instance 0x11be51e40'
Does this happen because this method only handle the selection of Custom Actions? 🤔Because my notification is just a pure notification without any actions button. User can only tap on it to launch the app.
Crashed at line 94. If I comment out the entire method
didReceiveNotificationResponse
, it will execute line 96 without crashes.
My goal is to find out whether the app is launched in QUIT
or BACKGROUND
state. Then I'll process the Deeplink accordingly. I could probably check the this with ...
PushNotificationIOS.getInitialNotification();
- Quit state
PushNotificationIOS.addEventListener('notification', (notification) =>)
- Background state