react-native-firebase - 收到推送通知后应用程序崩溃 (Android)

react-native-firebase - App Crash after Push Notification Received (Android)

我有一个 NodeJS 服务器,当我的 React Native 应用程序 收到来自服务器的推送通知时,应用程序停止工作。

In the Emulator the app just close and in the Cellphone with a Release APK isntalled the app close and show an alert saying that the application stop working.

在这里,我可以展示我在 Android 应用程序

中添加的一些配置

android/build.gradle

classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'

build.gradle

implementation project(':react-native-firebase')
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'

通知侦听器

export const configureMessaging = async () => {
  try {
    const enabled = await FirebaseMessaging.hasPermission();
    log('Push Notifications enabled?', enabled);
    return enabled;
  } catch (err) {
    return false;
  }
}; // This is returning true

export const configureOnNotificationDisplayed = () => FirebaseNotifications.onNotificationDisplayed((notification) => {
  // Process your notification as required
  // ANDROID: Remote notifications do not contain the channel ID.
  // You will have to specify this manually if you'd like to re-display the notification.
  console.log(notification);
});

export const configureOnNotification = () => FirebaseNotifications.onNotification((notification) => {
  // Process your notification as required
  console.log(notification);
});

export const configureOnNotificationOpened = () => FirebaseNotifications.onNotificationOpened((notificationOpen) => {
  // Get the action triggered by the notification being opened
  // Get information about the notification that was opened
  console.log(notification);
});

我在 AVM 中附加了一个调试器,没有抛出任何错误

Connected to the target VM, address: 'localhost:8624', transport: 'socket'

Disconnected from the target VM, address: 'localhost:8624', transport: 'socket'

备注

I do not know what happened in iOS because the app is not configured to use iOS

问题是我有另一个使用推送通知的依赖项。我删除了它,一切正常