简体   繁体   English

IBM Bluemix iOS推送通知

[英]IBM Bluemix iOS Push Notifications

I am using IBM Bluemix push notifications but get errors when trying to register my device. 我正在使用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}

I am thinking {"reason":"Cannot find application 'org.kp.consumer.myhealth'"} means that my provisioning profile needs to match my app name within IBM Bluemix? 我在考虑{“ reason”:“找不到应用程序'org.kp.consumer.myhealth'”}意味着我的配置文件需要与IBM Bluemix中的应用程序名称匹配吗?

It appears your Application ID is not matching what Bluemix has. 看来您的Application ID与Bluemix的ID不匹配。 Please reference this documentation about setting up your iOS app with the Bluemix SDK to ensure your application is recognized and authorized by Bluemix. 请参考本文档有关设置您的iOS应用与Bluemix SDK,以确保您的应用程序识别和Bluemix授权。 Make sure to also check the other sections such as 'Getting Started with Push' to ensure you are setup to authorize and communicate with Bluemix's push service. 确保还检查其他部分,例如“ Push入门”,以确保您已设置为授权并与Bluemix的push服务进行通信。

This could not be the case but you did not post your application configuration file or push notification code, so this is a best guess. 情况并非如此,但是您没有发布应用程序配置文件或推送通知代码,因此这是一个最佳猜测。 Feel free to update your question with this code so a more specific answer can be given. 随时使用此代码更新您的问题,以便给出更具体的答案。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM