firebase clearAllNotifications () не работает в ионном 3 - PullRequest
2 голосов
/ 29 марта 2019

Мне нужно удалить старую строку состояния формы уведомления в ionic 3.

Я использовал плагин firebase ( "@ ionic-native / firebase": "^ 4.20.0" и "cordova-plugin-firebase": "2.0.5" ).Вот app.component.ts file

  import { Firebase } from '@ionic-native/firebase';

  constructor(private platform: Platform,
      statusBar: StatusBar,
      splashScreen: SplashScreen,
      public firebase: Firebase) {

        platform.ready().then(() => {
            this.firebase.clearAllNotifications().then(clearData => {
                console.log('removed all notification');
            }).catch(err => {
                console.log('error in removing notification');
            });
        });
    }

и выдает ошибку что-то вроде

ERROR: Unhandled Promise rejection: undefined is not an object (evaluating 'this.fcm.clearAllNotifications().then') ; Zone: <root> ; Task: setTimeout ; Value: TypeError: undefined is not an object (evaluating 'this.fcm.clearAllNotifications().then')

как мне добиться этой функциональности, может кто-нибудь, пожалуйста, помогите мне.

Спасибо.

1 Ответ

1 голос
/ 29 марта 2019
@ionic-native/firebase": "^4.20.0"

не имеет метода под названием clearAllNotifications(), вам необходимо загрузить последнюю версию или добавить вручную здесь

...