Мне нужно удалить старую строку состояния формы уведомления в 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')
как мне добиться этой функциональности, может кто-нибудь, пожалуйста, помогите мне.
Спасибо.