简体   繁体   English

React Native:推送通知冻结了iOS(白屏)上的应用程序

[英]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. 不幸的是,我面临One Signal和我的本机应用程序问题。 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. 我不知道为什么,但是以某种方式我的推送通知不再起作用了。.但是仅在iOS上..Android也遇到了同样的问题,但是Android又可以工作了。 So, that means that the problem cannot really be the react native code cause it is working on Android. 因此,这意味着问题实际上不是真正的反应本机代码,因为它可以在Android上运行。

However, when I receive a notification on my iOS device the screen remains white and the application doesn't crash. 但是,当我在iOS设备上收到通知时,屏幕保持白色,并且应用程序不会崩溃。 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.. 这实际上不是很好的原因,这意味着我没有任何崩溃日志。而且您无法在MacBook上调试iOS设备,因为Apple已停用,无法在iPhone模拟器上接收推送通知。

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. 在Android和iOS上都可以。 Also confusing is, the application gets compiled and build without any problems on XCode.. 同样令人困惑的是,该应用程序在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.. 我已经在GitHub上阅读了一些问题,但是没有一个起作用。.我真正想知道的是,为什么它可以在我的Android设备上运行,而不在我的iOS设备上运行。

I already tried to solve the problem by deleting the node_modules folder and create it again by npm install . 我已经尝试通过删除node_modules文件夹并通过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.. 我还再次运行了pod install ,并检查了OneSignal文档以再次检查是否正确安装了所有内容。是的,所有内容均正确安装了..

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. 如果您没有IOS设备,而只有模拟器,则调试起来将变得非常困难。

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... 您将什么库用于Firebase通知(fcm,rnfirebase.io或其他)...您是如何实现的...

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)? 您是否有一个干净的代码结构,可以在其中使用try&catch来处理所有基于api的请求(通知方法)? Then it shouldn't be hard to found the issue by echo some catched errors 然后,不难通过回显一些捕获的错误来发现问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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