MobileFirst Starter - 生产模式下的 Bluemix 推送通知失败 [英] MobileFirst Starter - Bluemix Push Notification failure in Production mode

查看:25
本文介绍了MobileFirst Starter - 生产模式下的 Bluemix 推送通知失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个可以通过 Bluemix 接收远程通知的 iOS 应用程序.我有 Xcode 中的应用程序包标识符与 Apple Portal 中的 AppId 匹配,它也匹配 APN 证书(xxx-sandbox.p12 和 xxx-production.p12).

I am building an iOS app that can receive remote notification through Bluemix. I have the app Bundle Identifier in Xcode matches the AppId in Apple Portal which also match the APN certificate (xxx-sandbox.p12 and xxx-production.p12).

在开发过程中,我使用推送通知和 Bluemix Sandbox(在 MobileFirst Starter 样板下)进行了测试.一切正常.我可以在我的 iPhone 中接收通知.但是,当我在生产模式下进行测试时,我不断收到错误消息:内部服务器错误.未找到设备".

During development I have tested using Push Notification with Bluemix Sandbox (under MobileFirst Starter boilerplate). All work fine. I can receive notification in my iPhone. However when I tested in Production mode, I keep getting error messages: "Internal server error. No devices found".

我已确认我的设备存在(使用 REST API:https://mobile.ng.bluemix.net/imfpushrestapidocs/#!/devices/get_apps_applicationId_devices).

I have confirmed that my device exists (using REST API: https://mobile.ng.bluemix.net/imfpushrestapidocs/#!/devices/get_apps_applicationId_devices).

非常感谢任何建议.

推荐答案

好吧,REST API 显示您尚未在生产模式下注册任何设备.此外,它显示后端应用程序正在沙盒模式下工作,因此让我们先更改它.

Alright the REST API is showing that you have not registered any devices in production mode. Furthermore it is showing that the backend application is working in Sandbox mode, so let's change that first.

为此,您需要 PUT ApplicationID Settings REST API 调用:

To do so you'll want the PUT ApplicationID Settings REST API call:

https://mobile.ng.bluemix.net/imfpushrestapidocs/#!/applications/put_apps_applicationId_settings

与json主体

{ 
  "mode" : "PRODUCTION" 
}

然后我将使用 GET ApplicationID Settings REST API 调用来确认模式切换已经发生(您应该在响应中看到 "mode" : "PRODUCTION")

I would then use the GET ApplicationID Settings REST API call to confirm that the mode switch has occurred (you should see "mode" : "PRODUCTION" in the response)

https://mobile.ng.bluemix.net/imfpushrestapidocs/#!/applications/get_apps_applicationId_settings

切换环境模式后,您将需要重新运行客户端代码以在生产模式下注册您的设备.从那里您应该能够按预期进行推送.

Once the environment mode has been switched you will need to re-run your client code to register your device in production mode. From there you should be able to push as you expect.

这篇关于MobileFirst Starter - 生产模式下的 Bluemix 推送通知失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆