Reputation: 3
I'm trying to fetch details of rides that didn't originate in my app but keep getting nil values.
I first login using the Uber iOS SDK and request history / all-trip scopes. I then fetch the ride history. Using request-ids from ride history, I fetch ride details.
In every ride object returned, all values except status, requestID and ProductID are always nil.
I'm aware this is a privileged scope, and haven't requested full access yet. My user should work as it's on the dev dashboard though.
Any idea? Thanks!
let ridesClient = RidesClient()
//Fetch history of most recent rides
ridesClient.fetchTripHistory(offset: 0, limit: 20) { (history, response) in
if (response.error == nil){ //Success
if let history = history {
//Loop into trips
for trip in history.history {
//Fetch trip details
ridesClient.fetchRideDetails(requestID: trip.requestID, completion: { (ride, response) in
//Ride object is valid but everything in it is nil
})
}
}
}
else { //Error
print(response.error?.description as Any)
}
}
Upvotes: 0
Views: 132
Reputation: 857
You are getting a valid response back from the /v1.2/requests/51c4db1d-2f3d-4c8a-8577-e02490c30e22
endpoint call. This trip is completed - so you will be able to get only trip status. If you are getting "null" values when you call this endpoint - there are no any issues with the call and response you are getting back - it is intentionally made to be "null".
Upvotes: 0