RN Firebase: методы оповещения не запущены; методы сообщения - PullRequest
0 голосов
/ 05 ноября 2018

Я использую React Native Firebase для обработки наших push-уведомлений. При тестировании на устройстве iOS правильно появляются уведомления, когда приложение фоновое , поэтому я знаю, что токены устройства работают.

Однако ни один из методов модуля Notification не запускается ни в одной точке:

// DOES properly fire when message is sent w/o "notification" body (just "data"
this.messageListener = firebase
  .messaging()
  .onMessage(msg => console.log('message', msg));

// doesn't fire when notification is received
this.notificationListener = firebase
  .notifications()
  .onNotification(notification => console.log('on', notification));

// doesn't fire when notification is displayed
this.notificationDisplayedListener = firebase
  .notifications()
  .onNotificationDisplayed(notification => console.log('displayed', notification));

// doesn't fire when notification is tapped and app is opened
this.notificationOpenedListener = firebase
  .notifications()
  .onNotificationOpened(notification => console.log('opened', notification));

Из документации RN Firebase все выглядит прямо с нашей стороны. Есть мысли?

Data payload:

{
  "to": "XXXXXXXXX", // deviceToken
  "notification": {
    "title":"Notification Title",
    "body":"testing testing"
  },
  "data": {
    "user_id": 123,
    "foo": "bar"
  }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...