I have followed the exact implementation of Uber iOS SDK in my iOS app as mentioned here https://github.com/uber/rides-ios-sdk, and made sure that Callback URI schemes are registered in the uber developer dashboard which i have used in the app. But its throwing UBSDKRidesClientError. Here is my code for the button:
UBSDKRideRequestButton *button = [[UBSDKRideRequestButton alloc] init];
UBSDKRidesClient *ridesClient = [[UBSDKRidesClient alloc] init];
__block UBSDKRideParametersBuilder *builder = [[UBSDKRideParametersBuilder alloc] init];
builder = [builder setPickupLocation: pickupLocation];
builder = [builder setDropoffLocation: dropoffLocation];
[ridesClient fetchCheapestProductWithPickupLocation: pickupLocation completion:^(UBSDKUberProduct* _Nullable product, UBSDKResponse* _Nullable response) {
if (product) {
builder = [builder setProductID: product.productID];
button.rideParameters = [builder build];
[button loadRideInformation];
}
}];
Will appreciate any help.
It's hard to tell without more information on the error, but I would guess that you aren't authorized. Can you check the .code
of the RidesClientError you get back?
If it is unauthorized
that means you don't have a valid access token to hit the products / estimates endpoint. Either you need to log in first and get a valid access token OR include the UberServerToken
entry in your Info.plist with the value of your Server Token (found on the developer dashboard)