Cordova 未定义PushNotification错误ecb方法
不知何故,我无法让谷歌服务器调用ecb中定义的函数。 它总是抛出如下错误: processMessage失败:消息:Cordova 未定义PushNotification错误ecb方法,cordova,push-notification,phonegap-plugins,google-cloud-messaging,phonegap-pushplugin,Cordova,Push Notification,Phonegap Plugins,Google Cloud Messaging,Phonegap Pushplugin,不知何故,我无法让谷歌服务器调用ecb中定义的函数。 它总是抛出如下错误: processMessage失败:消息:“Javascript:services.onNotificationGCM({“regid”):“APA91BFYQ0BJCTCHCBGGM0IPQZ0QABSZUQK-EW0BIrF-Tl-dB_H7GAXHHHHXXYUVRZYKG9JVCHZIEPRSPGTIYJ02EWWOFUKXDIMIKFARJIQ2TGEWONDJRP6WX7ZJJ0J1G8LDJLLPMTPR15
“Javascript:services.onNotificationGCM({“regid”):“APA91BFYQ0BJCTCHCBGGM0IPQZ0QABSZUQK-EW0BIrF-Tl-dB_H7GAXHHHHXXYUVRZYKG9JVCHZIEPRSPGTIYJ02EWWOFUKXDIMIKFARJIQ2TGEWONDJRP6WX7ZJJ0J1G8LDJLLPMTPR155PYX9PGT1EWM0ZYZYZYW”,“事件:”,“已注册”
我的代码
var services = angular.module('services', [])
services.factory('services', function() {
var bgGeo;
return {
enablePushNotification: function() {
document.addEventListener("deviceready", function() {
var pushNotification = window.plugins.pushNotification
.register(function(result) {
alert(
'Callback Success! Result = ' +
result)
}, function(error) {
alert("ErrorHandler");
alert(error);
}, {
"senderID": "168615009802",
"ecb": "services.onNotificationGCM"
});
}, false)
},
onNotificationGCM: function(e) {
alert("onNotification extra factory")
}
}
})
我什么都试过了,希望你能帮我!
谢谢!:) 除了这一行,你的日志看起来怎么样?还有其他不一致的地方吗?