IBM Bluemix iOS 推送通知

IBM Bluemix iOS Push Notifications

我正在使用 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":"Cannot find application 'org.kp.consumer.myhealth'"} 意味着我的配置文件需要与我在 IBM Bluemix 中的应用程序名称匹配吗?

您的应用程序 ID 似乎与 Bluemix 的不匹配。请参考此 documentation 关于使用 Bluemix SDK 设置您的 iOS 应用程序以确保您的应用程序被 Bluemix 识别和授权。确保还检查其他部分,例如 'Getting Started with Push' 以确保您已设置为授权 Bluemix 的推送服务并与之通信。

不可能是这种情况,但您没有 post 您的应用程序配置文件或推送通知代码,所以这是一个最好的猜测。请随时使用此代码更新您的问题,以便给出更具体的答案。

希望对您有所帮助!