我似乎无法在为推送通知托管的远程服务器 (MobileFirst Platform Server) 上注册我的 iOS 设备。
这是我注册设备的代码
MFPPush.registerDevice(
{},function(successResponse) {
},
function(failureResponse) {
alert("Failed to register "+failureResponse);
});
我总是收到失败响应
"Error Domain=com.ibm.mfp.push Code=5 \"Request failed: internal server error (500)\" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x156663e80> { URL: http://<server-ip:port>/imfpush/v1/apps/<app-bundleidentifier>/devices/FFF2867D-D43A-4FC0-A9C7-CBECF26BFFD6 } { status code: 500, headers {
Connection = Close;
\"Content-Length\" = 0;
\"Content-Type\" = \"application/json\";
Date = \"Mon, 20 Mar 2017 03:57:45 GMT\";
\"X-Powered-By\" = \"Servlet/3.0\";
}}, NSErrorFailingURLKey=http://<server-ip:port>/imfpush/v1/apps/<app-bundleidentifier>/devices/FFF2867D-D43A-4FC0-A9C7-CBECF26BFFD6, com.alamofire.serialization.response.error.data=<>, NSLocalizedDescription=Request failed: internal server error (500)}"
其他信息:
- 我的服务器 IP 是 http://52 ..:9080
- 我已经设置了带有自定义安全检查的“push.mobileclient”范围,我还在 secret 客户端设置了“push.application.app-bundleidentifier”和“messages.write”
- 我也为 MobileFirst 服务器的应用程序上传了 apns-certificate-sandbox.p12 证书
- 当我在本地主机上注册时注册成功。
希望提供的数据足够。
提前致谢
最佳答案
我已设法通过将服务器和客户端移动优先平台版本更新为同一版本来解决此问题。
关于ios - 移动设备优先 - 无法为推送通知注册设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42895797/