Prajeet Shrestha Prajeet Shrestha - 3 months ago 31x
Swift Question

Uber iOS Integration Access Token Missing

I have created a developer account in Uber, got the client ID.
Configured the following setting in



Not sure what to put in UberCallbackURI but followed a tutorial in the link:

Also I have in appDidFinishLauncing following setting configured:


Just put a simple button to call uber.

let behavior = RideRequestViewRequestingBehavior(presentingViewController: self)
behavior.modalRideRequestViewController.rideRequestViewController.delegate = self
// Optional, defaults to using the user’s current location for pickup
let location = CLLocation(latitude: 37.787654, longitude: -122.402760)
let parameters = RideParametersBuilder().setPickupLocation(location).build()
let button = RideRequestButton(rideParameters: parameters, requestingBehavior: behavior)

I have also implemented following delegates in viewController :

extension ViewController : RideRequestViewControllerDelegate {
func rideRequestViewController(rideRequestViewController: RideRequestViewController, didReceiveError error: NSError) {
let errorType = RideRequestViewErrorType(rawValue: error.code) ?? .Unknown
// Handle error here
switch errorType {
case .AccessTokenMissing:
print("Access Token Missing")
// No AccessToken saved
case .AccessTokenExpired:
print("Access Token Expired")
// AccessToken expired / invalid
case .NetworkError:
print("Network error")
// A network connectivity error
case .NotSupported:
print("Not Supported")
// The attempted operation is not supported on the current device
case .Unknown:
// Other error

When I click the button the SDK sends me to loginscreen in UBER. When I sign in.

It always prints 'Access Token Missing ' which is from the delegate.

Can someone help me?


You're getting that error because the login is failing. I think your problem has to do with your UberCallbackURI. On the Authorizations tab in the developer dashboard you need to set a redirect URL. You need also put this as the value for UberCallbackURI in your Info.plist.

I would suggest using a unique url scheme that is specific to your app (as described in the link you provided)