MobileFirst Starter - Bluemix Push Notification failure in Production mode

感情迁移 提交于 2019-12-20 04:56:13

问题


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).

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".

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

Any suggestion is greatly appreciated.


回答1:


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.

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

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

With the json body

{ 
  "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.



来源:https://stackoverflow.com/questions/34008742/mobilefirst-starter-bluemix-push-notification-failure-in-production-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!