【问题标题】:react-native-pusher-push-notifications application crash when receive notificationreact-native-pusher-push-notifications 收到通知时应用程序崩溃
【发布时间】:2019-07-03 12:01:40
【问题描述】:

我正在使用 react-native-pusher-push-notifications 在 react native android 应用程序中获取通知 应用程序注册正确,当我从推送梁发送通知时仪表板应用程序崩溃并关闭

我正在使用:

compile project(':react-native-pusher-push-notifications')
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.pusher:push-notifications-android'

【问题讨论】:

标签: android react-native push-notification


【解决方案1】:

已修复!

这是 firebase 消息传递版本的问题,看到这个,它修复了崩溃

https://github.com/b8ne/react-native-pusher-push-notifications/issues/41

【讨论】:

    【解决方案2】:

    这不是一个答案,但它可能会有所帮助。同样的事情发生在我身上,当我向设备(已注册)发送测试推送通知时,应用程序崩溃了,所以它接收了通知,但在这个过程中,它崩溃了。

    这里的主要区别是我没有使用 react-native-pusher-push-notifications 库。我按照 pusher 告诉我的去做,例如在 MainApplication.java 中:

    import com.pusher.pushnotifications.PushNotifications;
    
    
    
    PushNotifications.start(getApplicationContext(), "xxxxxx-ccccc-4234-8ba8-cccsadadasdas");
      PushNotifications.addDeviceInterest("hello");
    

    所以我认为这可能与库版本等有关,但与您正在使用的包无关(顺便说一句,我还没有解决问题,我很幸运找到了解决方案并且您的问题出现了)。

    【讨论】:

    • 我的问题是我在我的项目中使用了另一个包(react-native-push-notification),然后我尝试使用(react-native-pusher-push-notification)所以我的应用程序崩溃了。我通过从 AndroidManifest.xml 中删除旧的包配置并更改我的 firebase 消息传递版本来解决它
    猜你喜欢
    • 2020-07-09
    • 1970-01-01
    • 2021-01-19
    • 2019-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-21
    相关资源
    最近更新 更多