注册客户端IBM Mobile First时出错

时间:2015-11-27 02:55:21

标签: ios ibm-cloud ibm-mobilefirst ibm-mobile-services

我使用IBM Mobile First Starter包,但无法找到解决错误的方法"错误注册客户端"。有没有办法调试这个?这开始于昨天出现在我的移动应用程序上,从今天早上开始在我的模拟器上。我怀疑我的模拟器工作,因为它是缓存凭据。

2015-11-26 18:44:54.835 bluelist-objective-c[32334:2189606] Intializing IMFCLient
2015-11-26 18:44:54.836 bluelist-objective-c[32334:2189606] IapplicationRoute [appurl]
2015-11-26 18:44:54.836 bluelist-objective-c[32334:2189606] IapplicationId [app id]
2015-11-26 18:44:55.286 bluelist-objective-c[32334:2189606] [ERROR] [IMF_REQUEST] -
[IMFAuthorizationRequest requestFailed:error:] in IMFAuthorizationRequest.m:368 :: 
Status code='400' error='Expected status code in (200-299), got 400' response='Error 
registering client'
2015-11-26 18:44:55.289 bluelist-objective-c[32334:2189606] [ERROR] [IMF] -
[IMFAuthorizationRequest requestFailed:error:] in IMFAuthorizationRequest.m:372 :: 
Error=Error Domain=WLAFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), 
got 400" UserInfo={WLAFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 
0x7ff9714135b0> { URL: [appurl]/imf-authserver/authorization/v1/apps/
6e88ec09-fa48-4848-aeef-8fe59c3226e9/clients/instance }, NSLocalizedRecoverySuggestion=
Error registering client, NSErrorFailingURLKey=[appurl]/imf-authserver/authorization/v1/
apps/6e88ec09-fa48-4848-aeef-8fe59c3226e9/clients/instance, 
WLAFNetworkingOperationFailingURLResponseErrorKey
=<NSHTTPURLResponse: 0x7ff971536660> { URL: [appurl]/imf-authserver/authorization/v1/apps/
6e88ec09-fa48-4848-aeef-8fe59c3226e9/clients/instance } { status code: 400, headers {
    Connection = "Keep-Alive";
    "Content-Type" = "text/plain";
    Date = "Fri, 27 Nov 2015 02:44:55 GMT";
    "Transfer-Encoding" = Identity;
    "X-Backside-Transport" = "FAIL FAIL";
    "X-Cf-Requestid" = "aad33684-69d5-4535-433a-216e141a3d2d";
    "X-Client-IP" = "50.174.210.191";
    "X-Global-Transaction-ID" = 1566005617;
    "X-Powered-By" = "Servlet/3.0";
} }, NSLocalizedDescription=Expected status code in (200-299), got 400}

2 个答案:

答案 0 :(得分:0)

重置模拟器或删除应用程序并重新安装。然后不应再发生错误:https://developer.ibm.com/answers/questions/206025/imfauthorizationrequest-error-invalid-grant/

答案 1 :(得分:0)

canOpenURL: failed for URL:"fbauth2://"错误表示您的Info.plist安全设置存在问题。首先,我确认或将以下LSApplicationQueriesSchemes值添加到Info.plist中。

根据Facebook的推荐outlined here

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fbapi20130214</string>
    <string>fbapi20130410</string>
    <string>fbapi20130702</string>
    <string>fbapi20131010</string>
    <string>fbapi20131219</string>    
    <string>fbapi20140410</string>
    <string>fbapi20140116</string>
    <string>fbapi20150313</string>
    <string>fbapi20150629</string>
    <string>fbauth</string>
    <string>fbauth2</string>
    <string>fb-messenger-api20140430</string>
</array>

如果这不能解决问题,我也会考虑在Info.plist中替换您的应用程序传输安全定义。为了测试,您可能希望用

替换完整的ATS
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>

有关ATS和iOS9的一般使用Bluemix的IBM博客文章中有更多信息可以找到herehere