Three lines

Uber

Developers

Introduction to Deep Links

Deep linking provides application interoperability between a native app or web view and the native Uber application. Deep links are simply URLs that reference the Uber app and support query parameters to affect the Uber app’s behavior once launched.

There are two available actions via deep links:

There are three types of deep links:

Ride Requests

Migrating from the Ride Request Widget? See the migration guide to deep link to a ride request with the best Uber rider experience.

The setPickup action is a very powerful deep linking feature which allows you to launch the Uber app and do any combination of setting pickup, drop-off, and product selection.

When specifying the pickup or dropoff details, it is recommended to provide as many query parameters as possible to achieve the best user experience. With every additional parameter, the Uber app will provide a bit more context to the user.

Examples

To try out deep linking, tap one of the following URLs in the native browser on a mobile device where the Uber app is installed and observe the behavior:

Set pickup and dropoff locations with latitude and longitude pairs, nicknames, and formatted addresses. Select Uber product by passing product_id returned from the Products endpoint. Keep in mind that the Uber product is specific to the location and the product_ids may vary for different locations even though the Uber products have the same name.

https://m.uber.com/ul/?client_id=<CLIENT_ID>&action=setPickup&pickup[latitude]=37.775818&pickup[longitude]=-122.418028&pickup[nickname]=UberHQ&pickup[formatted_address]=1455%20Market%20St%2C%20San%20Francisco%2C%20CA%2094103&dropoff[latitude]=37.802374&dropoff[longitude]=-122.405818&dropoff[nickname]=Coit%20Tower&dropoff[formatted_address]=1%20Telegraph%20Hill%20Blvd%2C%20San%20Francisco%2C%20CA%2094133&product_id=a1111c8c-c720-46c3-8534-2fcdd730040d
Query Parameters
Name Type Description
action string The intent of this deeplinking action.
client_id string Client ID of the requesting application.
product_id string Uber Product to be populated. Requires a pickup location. This does not work if you want to use the current user location.
payment_method_id string The UUID of the desired payment method, which should be pre-selected for this trip.
pickup[latitude] float Latitude coordinate for pickup. Trying to set the current user location instead?
pickup[longitude] float Longitude coordinate for pickup
pickup[nickname] string URL encoded pickup location nickname. Either this or pickup[formatted_address] is required
pickup[formatted_address] string URL encoded address to display purposes. This will not override the latitude/longitude. Either this or pickup[nickname] is required
dropoff[latitude] float Latitude coordinate for dropoff
dropoff[longitude] float Longitude coordinate for dropoff
dropoff[nickname] string URL encoded dropoff location nickname. Either this or dropoff[formatted_address] is required
dropoff[formatted_address] string URL encoded address to display purposes. This will not override the latitude/longitude. Either this or dropoff[nickname] is required

Universal links are the ideal way to link to Uber and provide the best rider experience.

Universal links are a type of deep links that work seamlessly between the mobile web and native apps. We recommend implementing universal links when linking from the following types of applications:

  • Mobile websites
  • Messaging apps, including text messaging (depends on the app)
  • Email (depends on the app)

Universal links for Uber start with the following URL:

https://m.uber.com/ul/

Your app can launch specific actions in the Uber app with additional parameters. See the setPickup and applyPromo documentation for parameter details.

For any existing standard deep link, replace uber:// with https://m.uber.com/ul/. For example, here’s a comparison between a standard deep link and universal link for the setPickup action:

When a user taps taps an universal link:

  • If the Uber app is installed on the device, the user will be deep linked into the app
  • If the Uber app is not installed and the user is on iOS or Android, the user will be directed to the App Store or Google Play Store to download Uber
  • On all other devices, the user will be redirected to the Uber account sign-up page: https://m.uber.com/ul/?client_id=<CLIENT_ID>

There are some OS/browser combinations in which the system cannot determine if the Uber app is installed. In this scenario, a web page will be rendered providing the user two options:

  • Open the app - this is a standard deep link to the app
  • Download the app - this will open the App Store or Google Play

A minimum OS level of iOS 9 is required for Universal Links support. Universal links will work on all versions of Android. There are some apps that do not fully support universal links (e.g., Gmail as of May 2016).

iOS

// Swift
import UberRides
import CoreLocation

let builder = RideParametersBuilder()
let pickupLocation = CLLocation(latitude: 37.787654, longitude: -122.402760)
let dropoffLocation = CLLocation(latitude: 37.775200, longitude: -122.417587)
builder.pickupLocation = pickupLocation
builder.dropoffLocation = dropoffLocation
builder.dropoffNickname = "UberHQ"
builder.dropoffAddress = "1455 Market Street, San Francisco, California"
let rideParameters = builder.build()

let deeplink = RequestDeeplink(rideParameters: rideParameters, fallbackType: .mobileWeb)
deeplink.execute()
// Objective-C
@import UberRides;
@import CoreLocation;

UBSDKRideParametersBuilder *builder = [[UBSDKRideParametersBuilder alloc] init];
CLLocation *pickupLocation = [[CLLocation alloc] initWithLatitude:37.787654 longitude:-122.402760];
CLLocation *dropoffLocation = [[CLLocation alloc] initWithLatitude:37.775200 longitude:-122.417587];
[builder setPickupLocation:pickupLocation];
[builder setDropoffLocation:dropoffLocation];
[builder setDropoffAddress:@"1455 Market Street, San Francisco, California"];
[builder setDropoffNickname:@"UberHQ"];
UBSDKRideParameters *rideParameters = [builder build];

UBSDKRequestDeeplink *deeplink = [[UBSDKRequestDeeplink alloc] initWithRideParameters:rideParameters];
[deeplink executeWithCompletion:nil];

With the Ride Request deeplink, you can specify a fallback for users that don’t have the Uber app installed. With a fallback, they’ll get redirected to either the mobile web version of Uber, or the App Store. To do so, simply add the fallbackType parameter:

// Swift
let deeplink = RequestDeeplink(rideParameters: rideParameters, fallbackType: .mobileWeb) // Or .appStore

// Objective-C
UBSDKRequestDeeplink *requestDeeplink = [[UBSDKRequestDeeplink alloc] initWithRideParameters:rideParameters
                                          fallbackType:UBSDKDeeplinkFallbackTypeMobileWeb];

Find out more in the iOS SDK readme.

Android


SessionConfiguration config = new SessionConfiguration.Builder()
    .setClientId("<CLIENT_ID>")
    .setClientSecret("<CLIENT_SECRET>")
    .setServerToken("<SERVER_TOKEN>")
    .build();

RideParameters rideParams = new RideParameters.Builder()
  .setProductId("a1111c8c-c720-46c3-8534-2fcdd730040d")
  .setPickupLocation(37.775304, -122.417522, "Uber HQ", "1455 Market Street, San Francisco, California")
  .setDropoffLocation(37.795079, -122.4397805, "Embarcadero", "One Embarcadero Center, San Francisco")
  .build();

RideRequestDeeplink deeplink = new RideRequestDeeplink.Builder(context)
                        .setSessionConfiguration(config)
                        .setRideParameters(rideParams)
                        .build();

deeplink.execute();

After configuring the Ride Parameters, pass them into the RideRequestDeeplink builder object to construct and execute the deeplink. The Ride Request Deeplink will prefer to use deferred deeplinking by default, where the user is taken to the Play Store to download the app, and then continue the deep link behavior in the app after installation. However, an alternate fallback may be used to prefer the mobile web experience instead.

To prefer mobile web over an app installation, set the fallback on the builder:


SessionConfiguration config = new SessionConfiguration.Builder()
    .setClientId("<CLIENT_ID>")
    .setClientSecret("<CLIENT_SECRET>")
    .setServerToken("<SERVER_TOKEN>")
    .build();

RideRequestDeeplink deeplink = new RideRequestDeeplink.Builder(context)
                        .setSessionConfiguration(config)
                        .setFallback(Deeplink.Fallback.MOBILE_WEB)
                        .setRideParameters(rideParams)
                        .build();

// to launch as a custom tab with browser fallback
deeplink.execute();

// to get the mobile deep link as a string
String uri = deeplink.getUri();

Find out more in the Android SDK readme.

We recommend always implementing universal links so riders get the best Uber experience on their device.

m.uber.com is our mobile web optimized rider experience. Just like our native mobile app our mobile web app enables you to link seamlessly between the mobile web experiences. The link format is the same as universal links without the /ul/ prefix. If you use the direct m.uber.com link the app will always open in the default web browser.

Find out more about how to use our mobile SDKs to generate deep links in our migration guide.

On iOS, Android, or Windows Phone app the Uber rider app can be opened using the uber:// schema. Your app can launch specific actions in the Uber app with additional parameters.

uber://?client_id=<CLIENT_ID>&action=setPickup&pickup[latitude]=37.775818&pickup[longitude]=-122.418028&pickup[nickname]=UberHQ&pickup[formatted_address]=1455%20Market%20St%2C%20San%20Francisco%2C%20CA%2094103&dropoff[latitude]=37.802374&dropoff[longitude]=-122.405818&dropoff[nickname]=Coit%20Tower&dropoff[formatted_address]=1%20Telegraph%20Hill%20Blvd%2C%20San%20Francisco%2C%20CA%2094133&product_id=a1111c8c-c720-46c3-8534-2fcdd730040d&link_text=View%20team%20roster&partner_deeplink=partner%3A%2F%2Fteam%2F9383

We recommend using universal links whenever you want to link from a non-native app (e.g., a mobile website, a text message, etc.) to the Uber app.

Tips
Notes
  • On Android, destination information passed in through parameters will not appear until the user clicks on “Set Pickup Location”.
  • The query parameter keys for pickup and dropoff are both nested.
  • You can set the pickup location to be the user’s current location by setting pickup to my_location. With that, you don’t need to provide latitude/longitude query parameters.
Known Limitations
  • Universal Links do not work in the iOS simulator. They only work on physical test devices with iOS 9+.
  • Pasting universal link URLs directly in Safari’s address bar does not work.
  • Multiple actions cannot be executed at once; for example, you cannot execute an applyPromo action and a setPickup action at the same time with the same deep link.

Congratulations! You have finished the Ride Request Deep Links tutorial and you are able to request rides!

Uber

Developers
© 2023 Uber Technologies Inc.