[英]Push Notification Android with ionic framework
我正在尝试从服务器向我的Android设备发送推送通知。 使用插件PushNotification Cordova,我的代码是什么。
var androidConfig = {
"senderID": "inspired-berm-101218",
};
document.addEventListener("deviceready", function(){
$cordovaPush.register(androidConfig).then(function(result) {
// Success
}, function(err) {
// Error
})
$rootScope.$on('$cordovaPush:notificationReceived', function(event, notification) {
switch(notification.event) {
case 'registered':
if (notification.regid.length > 0 ) {
alert('registration ID = ' + notification.regid);
sessionService.set("token_device",notification.regid);
根据我的个人资料,我遵循了该论坛的建议,并且教程很好,这些是:
api密钥:AIzaSyDtZndyGvmWXF0TpYe83KVDgxRZ4MR3zK8
ID del proyecto:启发性的床-101218
Numero del proyecto:805573676421
我在应用程序和服务器上使用的所有代码都是相同的代码,但是仍然收到错误消息:
{"multicast_id":7843752850335107662,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}
尝试在手机上卸载该应用程序并重新安装,但没有任何帮助,这对我来说不起作用。
使用此网站可以立即创建并再次运行该应用程序,它会提供准确的数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.