【发布时间】:2016-12-23 02:26:14
【问题描述】:
我正在关注 ionic 文档来创建 ionic push notifications。当应用程序处于活动状态时,这可以正常工作。当应用程序在后台接收推送通知时,我需要运行一个函数。
$ionicPush.register({
canShowAlert: false, //Should new pushes show an alert on your screen?
canSetBadge: true, //Should new pushes be allowed to update app icon badges?
canPlaySound: false, //Should notifications be allowed to play a sound?
canRunActionsOnWake: true, // Whether to run auto actions outside the app,
onNotification: function(notification) {
// Called for each notification.
}
});
我面临的问题是onNotification 回调函数在应用程序处于后台时不会触发。如何使用离子推送通知 API 实现这一目标?
【问题讨论】:
标签: ionic-framework ionic cordova-plugins