【发布时间】:2017-10-04 17:50:03
【问题描述】:
当时在 IOS 设备上收到通知时,应更改徽章并在打开应用前设置徽章。
我检查了这个 onNotificationOpen() 方法。但是当我点击通知时它会调用。
我使用cordova-plugin-firebase。
这是链接https://github.com/arnesson/cordova-plugin-firebase
但是有没有在IOS设备收到通知时调用的方法?
$ionicPlatform.ready(function() {
if (typeof FirebasePlugin != 'undefined') {
window.FirebasePlugin.subscribe("notficationsubscribe");
// Below method calls when i tap on notifcation and sets the badge number
window.FirebasePlugin.onNotificationOpen(function(data) {
window.FirebasePlugin.setBadgeNumber(4);
}
}
}
当我点击通知并设置徽章编号时调用 FirebasePlugin.onNotificationOpen() 方法,但我想在收到通知时设置徽章。
有人有想法吗?我怎样才能实现它?
【问题讨论】:
标签: ios firebase cordova-plugins