ios - iOS SDK 中的 Uber 错误代码

标签 ios uber-api

我已经集成了 Uber iOS SDK,现在可以在沙盒模式下工作。这是我的乘车请求代码。

[[UberHelper sharedInstance].ridesClient requestRideWithParameters:_rideParameters completion:^(UBSDKRide * _Nullable ride, UBSDKResponse * _Nonnull response) {NSLog(@"ERROR %@",response.error.title); NSLog(@"ERROR %@",response.error.code); NSLog(@"ERROR %ld",(long)response.statusCode);}];

但我期望的错误代码是这样的

"errors":[
      {
         "status": 409,
         "code": "surge",
         "title": "Surge pricing is currently in effect for this product."
      }
   ].

目前我只得到 "status"(response.error.status) 和 "code"(response.error.code) 和 "title"(response.error.title) 是 "null"。我需要这个“标题”来显示错误警报。 这些数据在生产模式下是否可用?

最佳答案

请按照此方式获取UBSDKError。

    if(response.error.errors){

                UBSDKError *uberError = [response.error.errors objectAtIndex:0];

                NSLog(@"title %@",uberError.title);
                NSLog(@"code %@",uberError.code);
}

关于ios - iOS SDK 中的 Uber 错误代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48680774/

相关文章:

ios - 你如何在 iOS Swift 中执行 "wrap_content"(Android XML 语法)

授权后,Uber-api 历史记录端点无法工作

ios - 设备进入后台时触发 TCPresenceEvent?

ios - 收集/访问 ResearchKit 结果并保存到文件

ios - 滚动多个单元格类型时 UITableView 滞后

ios - 使用 Uber iOS SDK 从 tokenString 创建 AccessToken 失败

google-app-engine - 在 golang 上执行 post 请求以获取 uber 身份验证不起作用

ios - Uber 身份验证失败 "HTTP Status 401: Unauthorized, Response: {"错误“: "invalid_client"}"

ios - 如何在 iOS 中使用 UIView 的 UIViewAnimationCurveEaseIn?

objective-c - 核心数据委托(delegate)保存模式