Интегрированное push-уведомление о firebase на ionic 3 - PullRequest
0 голосов
/ 08 июня 2018

Я пытаюсь использовать firebase push, мой код верен, чтобы дать сборку, я помещаю console.log, чтобы посмотреть, есть ли у него разрешение, если все правильно, но когда я отправляю уведомление через firebase.для меня ничего не приходит ..

app.component.ts

.then((res: any) => {

    if (res.isEnabled) {
      console.log('We have permission to send push notifications');

    } else {
      console.log('We do not have permission to send push notifications');
    }

  });
  const options: PushOptions = {
android: {},
ios: {
   alert: 'true',
   badge: true,
   sound: 'false'
},
windows: {},
browser: {
   pushServiceURL: 'http://push.api.phonegap.com/v1/push'
}
};

const pushObject: PushObject = this.push.init(options);


pushObject.on('notification').subscribe((notification: any) => console.log('Received a notification', notification));

pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));

pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error))

Config.xml

<platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
</platform>
<plugin name="phonegap-plugin-push" spec="^2.1.3">
    <variable name="SENDER_ID" value="1064226096335" />
</plugin>

Консоль в xcode

01:30:14.735620-0300 Myapp[4390:567615] FCM Sender ID 1064226096335
2018-06-08 01:30:14.735644-0300 Myapp[4390:567615] Using FCM Notification
2018-06-08 01:30:14.897536-0300 Myapp[4390:567453] FCM token is null
2018-06-08 01:30:14.898198-0300 Myapp[4390:567453] We have permission to send push notifications
2018-06-08 01:30:14.902557-0300 Myapp[4390:567453] Push Plugin register success: <c1e83f2d 3a9c1fd2 0115d192 4f3d27ce 53c217d3 4b861176 ff65cbac c4ceae9d>

База огня

enter image description here

...