[英]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.