我遇到了重大问题,无法找出为什么我的 Android 应用程序在收到推送通知时突然开始崩溃。我正在使用 react-native-push-notification
并且应用程序注册了一个 token 一切正常,但是当推送通知发送到手机时我收到一条错误消息:
W/ReactNativeJS( 917): Warning: Native component for "SharedElementTransition" does not exist
W/ReactNativeJS( 917): Warning: Native component for "MKTouchable" does not exist
W/ReactNativeJS( 917): Warning: Native component for "MKSpinner" does not exist
W/ReactNativeJS( 917): Warning: Native component for "TickView" does not exist
E/ReactNativeJS( 917): undefined is not an object (evaluating 'RNFSManager.RNFSFileTypeRegular')
这一切都非常神秘。 onNotification
方法没有内容,所以这让我怀疑发送的消息是否存在其他错误。
如有任何关于如何解决此问题的建议,我们将不胜感激。
最佳答案
我之前收到了“MKTouchable”和“TickView”不存在的警告,并且能够通过以下步骤解决它:
- 在我的终端中我安装了 rnpm
npm install -g rnpm
rnpm link
或者如果您具体知道哪个库不适合我的情况react-native-material-kit
,请执行rnpm link react-原生 Material 套件
最后使用
react-native run-ios
或react-native run-android
for android 重启你的 react-native packager。- 注意:我在 iOS 的 Mac 上运行,您的系统上的命令可能有所不同。
关于android - React Native Android 应用程序在收到推送通知时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43297863/