gpt4 book ai didi

ios - iOS SDK 中的 Uber 错误代码

转载 作者:行者123 更新时间:2023-11-29 00:03:49 27 4
gpt4 key购买 nike

我已经集成了 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com