firebase clearAllNotifications()在离子3中不工作
我需要删除离子3中的旧通知表单状态栏 我使用过firebase插件(“@ionic native/firebase”:“^4.20.0”和“cordova plugin firebase”:“2.0.5”)。这里是app.component.ts文件firebase clearAllNotifications()在离子3中不工作,firebase,push-notification,ionic3,Firebase,Push Notification,Ionic3,我需要删除离子3中的旧通知表单状态栏 我使用过firebase插件(“@ionic native/firebase”:“^4.20.0”和“cordova plugin firebase”:“2.0.5”)。这里是app.component.ts文件 import { Firebase } from '@ionic-native/firebase'; constructor(private platform: Platform, statusBar: StatusBar,
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')
错误:未处理的承诺拒绝:未定义不是对象(评估'this.fcm.clearAllNotifications().then');区域:;任务:设置超时;值:TypeError:undefined不是对象(计算'this.fcm.clearAllNotifications().then')
我怎样才能实现这个功能,有人能帮我吗
多谢各位
@ionic-native/firebase": "^4.20.0"
没有名为
clearAllNotifications()
的可用方法您必须下载最新版本或需要手动添加编写本机界面并放置处理程序。延迟可能是因为您的ui线程排队的项目太多扫描打开应用程序时请提供android logcat?