【发布时间】:2016-12-22 05:41:09
【问题描述】:
我使用 Blow 代码进行离子通知我使用了 fcm(firebase 云消息传递)
当应用程序关闭时我收到推送通知,但当应用程序在 android 中打开(运行)时我没有收到通知
app.js
.config(function($ionicCloudProvider) {
$ionicCloudProvider.init({
"core": {
"app_id": "xxxxxx"
},
"push": {
"sender_id": "xxxxxxxxxxxx",
"pluginConfig": {
"ios": {
"badge": true,
"sound": true
},
"android": {
"badge": true,
"iconColor": "#343434"
}
}
}
});
})
controler.js
$ionicPush.register().then(function(t) {
return $ionicPush.saveToken(t);
}).then(function(t) {
console.log('Token saved:', t.token);
alert(t.token);
});
$rootScope.$on('cloud:push:notification', function(data) {
console.log("dbhfd")
var msg = data.message;
console.log("dbhfd")
alert(msg.title + ': ' + msg.text);
$state.go('message');
});
【问题讨论】:
标签: android angularjs ionic-framework push-notification