我按照以下链接中给出的步骤进行操作。
但是我在登录时无法注册推送通知。
function registerDeviceForMCSPush(mcsBackend) {
var defer = $.Deferred();
if (typeof PushNotification !== 'undefined') {
try {
var push = PushNotification.init({
"android": {
// TODO replace Google Project Number here
senderID: "55926"
}
});
push.on('registration', function (data) {
var regId = data.registrationId;
deviceHandshakeforCordova(mcsBackend, regId);
});
push.on('notification', function (data) {
alert("Push Notification from Oracle MCS: " + data.message);
});
push.on('error', function (e) {
alert("Push Notification Error=" + e.message);
});
} catch (ex) {
alert("Error registering device with MCS" + ex);
defer.reject();
}
} else {
alert("PushNotification NOT Defined!");
defer.reject();
}
return $.when(defer);
}
我从代码中收到警报消息“未定义推送通知”