Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16961

App crashed when tapping on notification banner when app is at background

$
0
0

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.

enter image description hereCrashed 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


Viewing all articles
Browse latest Browse all 16961

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>