我正在使用IBM Bluemix推送通知,但在尝试注册我的设备时会出错。
2015-08-03 14:14:57.106 BluemixNotifications[443:251675] [INFO] [IMFPushClient] -[IMFPushClient registerDeviceToken:completionHandler:] in IMFPushClient.m:70 :: Verifying previous device registration.
2015-08-03 14:14:57.239 BluemixNotifications[443:251675] [WARN] [IMF] -[IMFAuthorizationManager cachedAuthorizationHeader] in IMFAuthorizationManager.m:447 :: There is no cached authorization header, use obtainAuthorizationHeaderWithCompletionHandler to get the header
2015-08-03 14:14:59.051 BluemixNotifications[443:251675] [ERROR] [IMF_REQUEST] -[IMFAuthorizationRequest requestFailed:error:] in IMFAuthorizationRequest.m:368 :: Status code='403' error='Expected status code in (200-299), got 403' response='/*-secure-
{"reason":"Cannot find application 'org.kp.consumer.myhealth'"}*/'
2015-08-03 14:14:59.056 BluemixNotifications[443:251675] [ERROR] [IMF] -[IMFAuthorizationRequest requestFailed:error:] in IMFAuthorizationRequest.m:372 :: Error=Error Domain=WLAFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 403" UserInfo=0x1467a850 {NSLocalizedRecoverySuggestion=/*-secure-
{"reason":"Cannot find application 'org.kp.consumer.myhealth'"}*/, NSErrorFailingURLKey=https://testpushnotifications.mybluemix.net/imf-authserver/authorization/v1/apps/XXXXXXXXXXXXXXXXXXXXXXXXX/clients/instance, WLAFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x14692990> { URL: https://testpushnotifications.mybluemix.net/imf-authserver/authorization/v1/apps/XXXXXXXXXXXXXXXXXXXXXXXXX/clients/instance }, WLAFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x14574580> { URL: https://testpushnotifications.mybluemix.net/imf-authserver/authorization/v1/apps/XXXXXXXXXXXXXXXXXXXXXXXXX/clients/instance } { status code: 403, headers {
Connection = "Keep-Alive";
"Content-Type" = "application/json; charset=UTF-8";
Date = "Mon, 03 Aug 2015 21:14:58 GMT";
"Transfer-Encoding" = Identity;
"X-Backside-Transport" = "FAIL FAIL";
"X-Cf-Requestid" = "98e47b88-88c4-41eb-58c6-e64285a1369e";
"X-Client-IP" = "70.197.4.111";
"X-Global-Transaction-ID" = 3589775105;
"X-Powered-By" = "Servlet/3.0";
} }, NSLocalizedDescription=Expected status code in (200-299), got 403}
2015-08-03 14:14:59.121 BluemixNotifications[443:251675] [FATAL] [IMF_OAUTH] -[IMFAuthorizationManager onFailureWithResponse:error:] in IMFAuthorizationManager.m:548 :: {"reason":"Cannot find application 'org.kp.consumer.myhealth'"}
2015-08-03 14:14:59.127 BluemixNotifications[443:251675] [ERROR] [IMFPushClient] __55-[IMFPushClient registerDeviceToken:completionHandler:]_block_invoke in IMFPushClient.m:139 :: Error while verifying previous registration - Error is: Error Domain=WLAFNetworkingErrorDomain Code=-1011 "Failed to register client: Expected status code in (200-299), got 403" UserInfo=0x1458d160 {NSLocalizedRecoverySuggestion=/*-secure-
{"reason":"Cannot find application 'org.kp.consumer.myhealth'"}*/, NSErrorFailingURLKey=https://testpushnotifications.mybluemix.net/imf-authserver/authorization/v1/apps/XXXXXXXXXXXXXXXXXXXXXXXXX/clients/instance, WLAFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x14692990> { URL: https://testpushnotifications.mybluemix.net/imf-authserver/authorization/v1/apps/XXXXXXXXXXXXXXXXXXXXXXXXX/clients/instance }, WLAFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x14574580> { URL: https://testpushnotifications.mybluemix.net/imf-authserver/authorization/v1/apps/XXXXXXXXXXXXXXXXXXXXXXXXX/clients/instance } { status code: 403, headers {
Connection = "Keep-Alive";
"Content-Type" = "application/json; charset=UTF-8";
Date = "Mon, 03 Aug 2015 21:14:58 GMT";
"Transfer-Encoding" = Identity;
"X-Backside-Transport" = "FAIL FAIL";
"X-Cf-Requestid" = "98e47b88-88c4-41eb-58c6-e64285a1369e";
"X-Client-IP" = "70.197.4.111";
"X-Global-Transaction-ID" = 3589775105;
"X-Powered-By" = "Servlet/3.0";
} }, NSLocalizedDescription=Failed to register client: Expected status code in (200-299), got 403}
我在想{“reason”:“找不到应用程序'org.kp.consumer.myhealth'”}表示我的配置文件需要与IBM Bluemix中的应用名称相匹配?
答案 0 :(得分:3)
您的应用程序ID似乎与Bluemix不匹配。有关使用Bluemix SDK设置iOS应用程序的信息,请参考此documentation,以确保您的应用程序得到Bluemix的认可和授权。请务必查看其他部分,例如“推送入门”,以确保您能够设置授权并与Bluemix的推送服务进行通信。
情况并非如此,但您没有发布应用程序配置文件或推送通知代码,因此这是最佳猜测。请随意使用此代码更新您的问题,以便给出更具体的答案。
希望这有帮助!