我正在尝试使用 Cordova 插件将 Bluemix 推送通知服务集成到 Cordova 应用程序中。按照这个http://mbaas-gettingstarted.ng.bluemix.net/hybrid#push-operations。但是,当我按如下方式注册设备时,我遇到了以下错误,
var push = IBMPush.getService();
var alertNotification = function(message) {
IBMBluemix.getLogger().info("Received notification");
console.log(JSON.stringify(message));
}
//Register the device
push.registerDevice("MyDeviceName", "UserName", "alertNotification").done(function(response) {
console.log("device registration done successfully with response : ", response);
}, function(err) {
console.log("ERROR in device registration : ", err);
});
设备注册错误:状态代码:403,状态行:禁止
- 我能够成功地初始化 IBMPush 服务。这确认我使用了正确的应用程序 ID 和应用程序密码。
- 我还交叉检查了我在 Bluemix 推送服务中使用了正确的发件人 ID(来自 Google 控制台的项目编号)和 API 密钥(API 凭据下的服务器密钥),并确保已启用 Google Cloud Messaging for Android API。
任何帮助表示赞赏!