【发布时间】:2016-09-01 14:55:17
【问题描述】:
即使应用程序被终止,我也会收到 FCM 控制台发送的通知。 这是我的客户端代码:
$ionicPlatform.ready(function() {
FCMPlugin.onNotification(
function(data){
if(data.wasTapped){
//Notification was received on device tray and tapped by the user.
alert( JSON.stringify(data) );
}else{
//Notification was received in foreground. Maybe the user needs to be notified.
alert( JSON.stringify(data) );
}
},
function(msg){
console.log('onNotification callback successfully registered: ' + msg);
},
function(err){
console.log('Error registering onNotification callback: ' + err);
}
);
})
问题是没有收到通知回调。日志数据显示:
View not ready. SAVED NOTIFICATION: javascript:FCMPlugin.onNotificationReceived()
【问题讨论】:
标签: ionic-framework firebase firebase-cloud-messaging