Android $cordovaPush:notificationReceived调用了两次
我正在开发一个ionic应用程序,我需要推送通知,所以一切正常。我可以使用ionic推送通知接收通知,但回拨被调用两次,我只收到一个通知 这是我的密码:Android $cordovaPush:notificationReceived调用了两次,android,ios,angularjs,push-notification,ionic-framework,Android,Ios,Angularjs,Push Notification,Ionic Framework,我正在开发一个ionic应用程序,我需要推送通知,所以一切正常。我可以使用ionic推送通知接收通知,但回拨被调用两次,我只收到一个通知 这是我的密码: // the call back $rootScope.$on('$cordovaPush:notificationReceived', function (event, notification) {}); // the push service registration $ionicPush.register({
// the call back
$rootScope.$on('$cordovaPush:notificationReceived', function (event, notification) {});
// the push service registration
$ionicPush.register({
canShowAlert: true, //Can pushes show an alert on your screen?
canSetBadge: true, //Can pushes update app icon badges?
canPlaySound: true, //Can notifications play a sound?
canRunActionsOnWake: true, //Can run actions outside the app,
onNotification: function(notification) {
// Handle new push notifications here
//$rootScope.$broadcast('$cordovaPush:notificationReceived',notification);
return true;
}
});
谢谢您是在使用数据库保存设备令牌还是在每次推送时手动提供@haffanehatimfor现在我只是手动添加它,用于ionic.io的测试通知,但它们将保存在生产数据库中