简体   繁体   中英

React Native: Push notification is freezing up the app on iOS (White Screen)

sadly I am facing problem with One Signal and my react native application. I don't know why but somehow my push notifications aren't working anymore.. But only on iOS.. I have had the same problem with Android too but Android is working again. So, that means that the problem cannot really be the react native code cause it is working on Android.

However, when I receive a notification on my iOS device the screen remains white and the application doesn't crash. This is actually not good cause that means I don't get any crash log.. And you cannot debug iOS devices on a MacBook cause Apple has deactivated to receive push notifications on the iPhone emulator..

So, I don't really know what to do.. All I did was replacing the icons and the splash screen. On both, Android and iOS. Also confusing is, the application gets compiled and build without any problems on XCode..

I have read some issues on GitHub already but none of them are working.. What I am really wondering about is, why it is working on my Android device but not on my iOS device..

I already tried to solve the problem by deleting the node_modules folder and create it again by npm install . However, this didn't fix the problem. I also runned pod install again and checked the OneSignal documentation to double check if everything is correctly installed.. And yes, everything is correctly installed..

You guys have any idea on what to do and how to solve the problem? After I tap on the notification the app launches and then remains on a white screen..

If the app is running in background and I tap on the push notification everything works fine!

But when I am inside the app and I receive a push notification, the app "crashes" and keeps remaining on the white screen. As well when the app is completely closed and I tap on the push notification.. The app "crashes" and keeps remaining on the white screen also...

You guys can help me? Kind regards and Thank You!

If you don't have an IOS-Device, but only an Emulator it will become really hard to debug this.

You can give it a try with output some Test-Strings with respones-values at important points inside of your app (eg function for recieving Notification, for sending notification ... and so on.)

But if you need more help you have to provide more Information. What Library do you use for Firebase-Notifications (fcm, rnfirebase.io or other)... how did you implement it...

If the app is running in background and I tap on the push notification everything works fine! But when I am inside the app and I receive a push notification, the app "crashes" and keeps remaining on the white screen.

Yes, here you have the Point where to start with your debugging. If receiving notifications in Background work, you're issue might be found on the Event-Handler which listen for foreground notifications.

Did you have a clean Code-Structure, where you use try & catch for all your api-based request (notification-methods)? Then it shouldn't be hard to found the issue by echo some catched errors

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM