在Android上使用新的更新文档GCM,我已经按照本教程进行了操作:https://developers.google.com/cloud-messaging/android/client。
它工作正常,但有时我收到一个自动通知,记录onMessageReceived(String from, Bundle data)
上的包数据,我得到了:
捆绑[{breaking_news_payload_extra = CoUGCgJlbhICdWsa + gUKUEplcmVteSBDb3JieW46IE5hdGlvbmFsIGFudGhlbSByb3cgaXMgJ2RlbWVhbmluZyB0aXR0bGUgdGF0dGxlJyAtIGxpdmUgYWhlYWQgLi4uEu4CaHR0cDovL25ld3MuZ29vZ2xlLmNvbS9uZXdzL3VybD9zYT10JmZkPVImY3QyPXVrJnVzZz1BRlFqQ05FbTV5ZEpPSHRUWFlISlpGbHdYVG04SVVLLUN3JmNubT03ZWZmZmI2ZWM3Y2VhN2Q2ZmZhMmFjNWU3MGNhMjE0MSZjbGlkPTdlZmZmYjZlYzdjZWE3ZDZmZmEyYWM1ZTcwY2EyMTQxJmNpZD01Mjc3ODk0NjkxNDk3OCZlaT1Zel81VmJIcEstblE4Z0hXdm8yNENRJnJpZD01NzZmMGZjMC05ZGEwLTQ2NmQtYTYyYS02N2JmYmU4NjhiMTAmdXJsPWh0dHA6Ly93d3cudGVsZWdyYXBoLmNvLnVrL25ld3MvcG9saXRpY3MvSmVyZW15X0NvcmJ5bi8xMTg2Nzg4OS9qZXJlbXktY29yYnluLWRhdmlkLWNhbWVyb24tcG1xcy1saXZlLmh0bWwmemR4dz0xGKLVh / OIgAwg2sLczueQgpI7Kg9UZWxlZ3JhcGguY28udWsyiwIaiQEigAFodHRwczovL2VuY3J5cHRlZC10Ym4zLmdzdGF0aWMuY29tL2ltYWdlcz9xPXRibjpBTmQ5R2NTbzdNV2IxYktrU0ZxRjEwN09LT2dKYVhmV0xVNVlZVFJ6YXZod2FwUGd3Qk5rMmZiRmxLaUxCWVU0a203d2w3VmlCYjNUZXJFUChkMGQ4AiJZIlFodHRwOi8vaS50ZWxlZ3JhcGguY28udWsvbXVsdGltZWRpYS9hcmNoaXZlLzAzNDQxL2RhdmlkLWNhbWVyb24tY29yYl8zNDQxN TY0Yi5qcGco7AQwgwMqIkFGUWpDTkVtNXlkSk9IdFRYWUhKWkZsd1hUbThJVUstQ3c4ovjkrwU =, collapse_key的= do_not_collapse}]
我的正常推送捆绑数据是:
捆绑[{message =来自MyApp的消息,collapse_key = do_not_collapse}]
发生了什么事?
答案 0 :(得分:0)
我仍然无法弄清楚问题,但我目前的解决方案是检查字符串from
是否等于我的Google项目ID。如果angular.module('eFile.shared')
.directive('kcInputComparer', function() {
return {
restrict: "A",
require: "ngModel",
link: function(scope, element, attributes, ngModel) {
ngModel.$validators.lessThan = function(modelValue) {
if (modelValue && scope.lessThan) {
return parseFloat(modelValue) < parseFloat(scope.lessThan);
}
return true;
};
},
scope: {
lessThan: '=lessThan'
}
};
});
与Google项目ID不相等,则不执行任何操作。