【发布时间】:2019-03-29 06:14:13
【问题描述】:
我需要删除 ionic 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,
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')
如何实现这个功能,谁能帮帮我。
谢谢。
【问题讨论】:
-
编写一个原生接口并放置 handler.delay 可能是你的 ui 线程排队的项目太多
-
你能在打开应用时提供android logcat吗?
标签: firebase push-notification ionic3