简体   繁体   English

在Cordova App中注册设备时Bluemix Push Service Error

[英]Bluemix Push Service Error while registering device in Cordova App

I'm trying to integrate Bluemix Push Notification Service in Cordova app using Cordova plugin. 我正在尝试使用Cordova插件将Bluemix Push Notification Service集成到Cordova应用程序中。 Following this http://mbaas-gettingstarted.ng.bluemix.net/hybrid#push-operations . 遵循此http://mbaas-gettingstarted.ng.bluemix.net/hybrid#push-operations However, I'm facing the following error when I register device as follows, 但是,我在注册设备时遇到以下错误,

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);
});

ERROR in device registration : Status Code : 403, Status Line : Forbidden 设备注册错误:状态代码:403,状态行:禁止

  1. I'm successfully able to initialize IBMPush service. 我能够成功初始化IBMPush服务。 This confirms that I'm using the right app id and app secret. 这确认我使用了正确的应用程序ID和应用程序密钥。
  2. I also cross checked that I'm using the right Sender Id (Project number from Google Console) and API Key (Server key under API Credentials) in Bluemix Push Service and also ensured Google Cloud Messaging for Android API is Enabled. 我还交叉检查了我是否在Bluemix Push Service中使用了正确的发件人ID(Google控制台中的项目编号)和API密钥(API凭据下的服务器密钥),并确保启用了适用于Android API的Google Cloud Messaging。

Any help is appreciated! 任何帮助表示赞赏!

Our new Bluemix Mobile Services Hybrid SDK has been released which works with the latest version of Cordova. 我们已经发布了新的Bluemix移动服务混合SDK,可与最新版本的Cordova一起使用。 Following this the old "mbaas" Cordova SDK has been deprecated in favor of the new and improved version. 在此之后,不赞成使用旧的“ mbaas” Cordova SDK,而是使用新的改进版本。

You can find the new open source cordova plugins on our Github at https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-core and https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-push 您可以在我们的Github上找到新的开源cordova插件,网址为https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-corehttps://github.com/ibm-bluemix -mobile-services / bms-clientsdk-cordova-plugin-push

For utilizing push I would recommend taking a look at our HelloPush Cordova sample and running through the README found there, do note that you will need to create a new backend with the new services to properly utilize the new SDK. 对于利用推,我建议您看一下我们的HelloPush Cordova示例,并运行在那里找到的自述文件,请注意,您将需要使用新服务创建一个新后端以正确利用新SDK。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Bluemix Cordova iOS推送通知-看不到设备-内部服务器错误。 找不到设备 - Bluemix Cordova iOS Push notifications - Don't see device - Internal server error. No devices found 在设备上运行我的应用程序时出现Ionic / Cordova错误 - Ionic/Cordova error while running my app on device 在Cordova中执行应用程序时出错 - Error while executing an app in cordova 建立Cordova应用程式时发生错误 - Error while building cordova app 在Windows设备上运行Cordova项目时出错? - Error while running Cordova project to Windows device? 在Android设备上的Cordova应用中进行代码推送自动回滚 - code-push auto rollback in cordova app on android device 在将cordova应用程序部署到连接的设备时无法部署到设备 - Failed to deploy to device while deploying cordova app to a connected device 安装cordova-mfp-push插件后,为什么不能在真正的ios设备上运行cordova应用程序? - Why can I not run a cordova app on a real ios device, after the installation of the cordova-mfp-push plugin? Cordova-应用程序在后台模式下时推送通知行为 - Cordova - Push notification behavior while app is on background mode Cordova-更改设备上的推送通知 - Cordova - Alter Push Notifications on the device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM