Uber Rides iOS SDK (beta)

Overview

Uber Rides iOS SDK

This Swift library allows you to integrate the Uber Rides API into your iOS app.

Requirements

  • iOS 8.0+
  • Xcode 10.0+
  • Swift 4.2+

Installing the Uber Rides SDK

To install the Uber Rides SDK, you may use CocoaPods, Carthage, or add it to your project manually

pod 'UberRides', '~> 0.13'

Carthage

github "uber/rides-ios-sdk" ~> 0.13

Getting Started

SDK Configuration

To begin making calls to the Uber API, you need to register an application on the Uber Developer Site and get credentials for your app.

Then, configure your Xcode with information for the Uber SDK. Locate the Info.plist file for your application. Right-click this file and select Open As > Source Code

Add the following code snippet, replacing the placeholders within the square brackets ([]) with your app’s information from the developer dashboard. (Note: Do not include the square brackets)

<key>UberClientID</key>
<string>[ClientID]</string>
<key>UberServerToken</key>
<string>[Server Token]</string>
<key>UberDisplayName</key>
<string>[App Name]</string>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>uber</string>
    <string>uberauth</string>
</array>

Note: Your Server Token is used to make Price & Time estimates when your user hasn't authenticated with Uber yet. We suggest adding it in your Info.plist only if you need to get estimates before your user logs in.

Ride Request Button

The RideRequestButton is a simple way to show price and time estimates for Uber products and can be customized to perform various actions. The button takes in RideParameters that can describe product ID, pickup location, and dropoff location. By default, the button shows no information.

To display a time estimate, set the product ID and pickup location. To display a price estimate, you need to additionally set a dropoff location.

Request Buttons Screenshot

Import the library into your project, and add a Ride Request Button to your view like you would any other UIView:

// Swift
import UberRides

let button = RideRequestButton()
view.addSubview(button)
// Objective-C
@import UberRides;

UBSDKRideRequestButton *button = [[UBSDKRideRequestButton alloc] init];
[view addSubview:button];

This will create a request button with default behavior, with the pickup pin set to the user’s current location. The user will need to select a product and input additional information when they are switched over to the Uber application.

Adding Parameters with RideParameters

The SDK provides an simple object for defining your ride requests. The RideParameters object lets you specify pickup location, dropoff location, product ID, and more. Creating RideParameters is easy using the RideParametersBuilder object.

// 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 = "Somewhere"
builder.dropoffAddress = "123 Fake St."
let rideParameters = builder.build()

let button = RideRequestButton(rideParameters: rideParameters)
// 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:@"123 Fake St."];
[builder setDropoffNickname:@"Somewhere"];
UBSDKRideParameters *rideParameters = [builder build];

UBSDKRideRequestButton *button = [[UBSDKRideRequestButton alloc] initWithRideParameters:rideParameters];

We suggest passing additional parameters to make the Uber experience even more seamless for your users. For example, dropoff location parameters can be used to automatically pass the user’s destination information over to the driver. With all the necessary parameters set, pressing the button will seamlessly prompt a ride request confirmation screen.

Note: If you are using a RideRequestButton that deeplinks into the Uber app and you want to specify a dropoff location, you must provide a nickname or formatted address for that location. Otherwise, the pin will not display.

You can also use the RideRequestButtonDelegate to be informed of success and failure events during a button refresh.

Ride Request Deeplink

If you don't want to use the Uber-provided button, you can also manually initiate a deeplink in a similar fashion as above:

// Swift
import UberRides
import CoreLocation

let builder = RideParametersBuilder()
// ...
let rideParameters = builder.build()

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

UBSDKRideParametersBuilder *builder = [[UBSDKRideParametersBuilder alloc] init];
// ...
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];

Login with Uber

To use any of the SDK's other features, you need to have the end user authorize your application to use the Uber API.

Setup

First, open up the Uber Developer Dashboard. Go to the Authorizations tab and under App Signatures, put in your iOS application's Bundle ID.

We also need to register a Redirect URL for your application. This ensures that Uber sends users to the correct application after they log in. Make a URL in this format, and save your application: YourApplicationBundleID://oauth/consumer.

In your Xcode project, you need to register your URL scheme as well as the callback URL with the Uber SDK. Copy this into your Info.plist, replacing the relevant values:

Note: If one of the following keys already exists in your Info.plist file, you will have to add the values to them and not duplicate the keys.

<key>UberCallbackURIs</key>
<array>
    <dict>
        <key>UberCallbackURIType</key>
        <string>General</string>
        <key>URIString</key>
        <string>[Your Bundle ID Here]://oauth/consumer</string>
    </dict>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>[Your Bundle ID Here]</string>
        </array>
    </dict>
</array>

You also need to modify your application's App Delegate to make calls to the RidesAppDelegate to handle URLs.

// Swift
// Add the following calls to your AppDelegate
import UberCore
    
@available(iOS 9, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
    let handledUberURL = UberAppDelegate.shared.application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation] as Any)

    return handledUberURL
}
    
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
    let handledUberURL = UberAppDelegate.shared.application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)

    return handledUberURL
}
// Objective-C
// Add the following calls to your AppDelegate
@import UberCore;

// iOS 9+
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options {
    BOOL handledURL = [[UBSDKAppDelegate shared] application:app open:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
    
    return handledURL;
}

// iOS 8
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    BOOL handledURL = [[UBSDKAppDelegate shared] application:application open:url sourceApplication:sourceApplication annotation:annotation];
    
    return handledURL;
}

Login Button

The LoginButton is a simple way to authorize your users. You initialize the button requesting certain scopes, or permissions from Uber. More about scopes. When the user taps the button, the login will be executed.

You can optionally set a LoginButtonDelegate to receive notifications for login/logout success.

// Swift
import UberCore

let scopes: [UberScope] = [.profile, .places, .request]
let loginManager = LoginManager(loginType: .native)
let loginButton = LoginButton(frame: CGRect.zero, scopes: scopes, loginManager: loginManager)
loginButton.presentingViewController = self
loginButton.delegate = self
view.addSubview(loginButton)

// Mark: LoginButtonDelegate
    
func loginButton(_ button: LoginButton, didLogoutWithSuccess success: Bool) {
	// success is true if logout succeeded, false otherwise
}
    
func loginButton(_ button: LoginButton, didCompleteLoginWithToken accessToken: AccessToken?, error: NSError?) {
    if let _ = accessToken {
        // AccessToken Saved
    } else if let error = error {
        // An error occured
    }
}
// Objective-C
@import UberCore;

NSArray<UBSDKScope *> *scopes = @[UBSDKScope.profile, UBSDKScope.places, UBSDKScope.request];

UBSDKLoginManager *loginManager = [[UBSDKLoginManager alloc] initWithLoginType:UBSDKLoginTypeNative];

UBSDKLoginButton *loginButton = [[UBSDKLoginButton alloc] initWithFrame:CGRectZero scopes:scopes loginManager:loginManager];
loginButton.presentingViewController = self;
[loginButton sizeToFit];
loginButton.delegate = self;
[self.view addSubview:loginButton];

#pragma mark - UBSDKLoginButtonDelegate

- (void)loginButton:(UBSDKLoginButton *)button didLogoutWithSuccess:(BOOL)success {
	// success is true if logout succeeded, false otherwise
}

- (void)loginButton:(UBSDKLoginButton *)button didCompleteLoginWithToken:(UBSDKAccessToken *)accessToken error:(NSError *)error {
    if (accessToken) {
		// UBSDKAccessToken saved
    } else if (error) {
		// An error occured
    }
}

Custom Integration

If you want to provide a more custom experience in your app, there are a few classes to familiarize yourself with. Read the sections below and you’ll be requesting rides in no time!

Uber Rides API Endpoints

The SDK exposes all the endpoints available in the Uber Developers documentation. Some endpoints can be authenticated with a server token, but for most endpoints, you will require a bearer token. A bearer token can be retrieved via implicit grant, authorization code grant, or SSO. To authorize privileged scopes, you must use authorization code grant or SSO.

Read the full API documentation at CocoaDocs

The RidesClient is your source to access all the endpoints available in the Uber Rides API. With just your server token, you can get a list of Uber products as well as price and time estimates.

// Swift example
let ridesClient = RidesClient()
let pickupLocation = CLLocation(latitude: 37.787654, longitude: -122.402760)
ridesClient.fetchProducts(pickupLocation: pickupLocation, completion:{ products, response in
    if let error = response.error {
        // Handle error
        return
    }
    for product in products {
        // Use product
    }
})
// Objective-C example
UBSDKRidesClient *ridesClient = [[UBSDKRidesClient alloc] init];
CLLocation *pickupLocation = [[CLLocation alloc] initWithLatitude: 37.787654 longitude: -122.402760];
[ridesClient fetchProductsWithPickupLocation: pickupLocation completion:^(NSArray<UBSDKProduct *> * _Nullable products, UBSDKResponse *response) {
    if (response.error) {
        // Handle error
        return;
    }
    for (UBSDKProduct *product in products) {
        // Use product
    }
}];

Native / SSO Authorization

To get access to more informative endpoints, you need to have the end user authorize your application to access their Uber data.

The easiest form of authorization is using the .native login type. It allows you to request Privileged scopes and, if your user is logged into the Uber app, it doesn't require your user to enter a username and password. It requires the user to have the native Uber application on their device.

Native authentication can occur either through the main Uber rides app or through the Uber Eats app. You can also fallback from one app to another, so that for example if the user does not have the UberEats app installed on their device, you can instead authenticate through the main Uber rides app:

// Swift
let loginManager = LoginManager(loginType: .native, productFlowPriority: [UberAuthenticationProductFlow(.eats), UberAuthenticationProductFlow(.rides)])
// Objective-C
UBSDKUberAuthenticationProductFlow *eatsProduct = [[UBSDKUberAuthenticationProductFlow alloc] init:UberProductTypeEats];
UBSDKUberAuthenticationProductFlow *ridesProduct = [[UBSDKUberAuthenticationProductFlow alloc] init:UberProductTypeRides];
UBSDKLoginManager *loginManager = [[UBSDKLoginManager alloc] initWithLoginType:loginType productFlowPriority:@[ eatsProduct, ridesProduct ]];

The LoginManager defaults to using the Native login type using the main Uber rides app, so you can simply instantiate a LoginManager and call login() with your requested scopes.

// Swift
let loginManager = LoginManager()
loginManager.login(requestedScopes:[.request], presentingViewController: self, completion: { accessToken, error in
    // Completion block. If accessToken is non-nil, you’re good to go
    // Otherwise, error.code corresponds to the RidesAuthenticationErrorType that occured
})
// Objective-C
UBSDKLoginManager *loginManager = [[UBSDKLoginManager alloc] init];
[loginManager loginWithRequestedScopes:@[ UBSDKScope.request ] presentingViewController: self completion: ^(UBSDKAccessToken * _Nullable accessToken, NSError * _Nullable error) {
    // Completion block. If accessToken is non-nil, you're good to go
    // Otherwise, error.code corresponds to the RidesAuthenticationErrorType that occured
}];

Note: The presentingViewController parameter is optional, but if provided, will attempt to intelligently fallback to another login method. Otherwise, it will redirect the user to the App store to download the Uber app.

Auth Method Token Type Allowed Scopes
None Server None (can access products and estimates)
Implicit Grant Bearer General
Authorization Code Grant Bearer Privileged and General
SSO Bearer Privileged and General

Custom Authorization / TokenManager

If your app allows users to authorize via your own customized logic, you will need to create an AccessToken manually and save it in the keychain using the TokenManager.

// Swift
let accessTokenString = "access_token_string"
let token = AccessToken(tokenString: accessTokenString)
if TokenManager.save(accessToken: token) {
    // Success
} else {
    // Unable to save
}
// Objective-C
NSString *accessTokenString = @"access_token_string";
UBSDKAccessToken *token = [[UBSDKAccessToken alloc] initWithTokenString: accessTokenString];
if ([UBSDKTokenManager saveWithAccessToken: token]) {
	// Success
} else {
	// Unable to save
}

The TokenManager can also be used to fetch and delete AccessTokens

// Swift
TokenManger.fetchToken()
TokenManager.deleteToken()
// Objective-C
[UBSDKTokenManager fetchToken];
[UBSDKTokenManager deleteToken];

Getting help

Uber developers actively monitor the Uber Tag on StackOverflow. If you need help installing or using the library, you can ask a question there. Make sure to tag your question with uber-api and ios!

For full documentation about our API, visit our Developer Site.

Contributing

We ❤️ contributions. Found a bug or looking for a new feature? Open an issue and we'll respond as fast as we can. Or, better yet, implement it yourself and open a pull request! We ask that you include tests to show the bug was fixed or the feature works as expected.

Note: All contributors also need to fill out the Uber Contributor License Agreement before we can merge in any of your changes.

Please open any pull requests against the develop branch.

License

The Uber Rides iOS SDK is released under the MIT license. See the LICENSE file for more details.

Comments
  • Add Swift 3 / Xcode 8 support

    Add Swift 3 / Xcode 8 support

    When I add github "https://github.com/uber/rides-ios-sdk" ~> 0.5 , and do a carthage update, I get the following error:

    The following build commands failed:
        Check dependencies
    (1 failure)
    A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/Carthage/Checkouts/ObjectMapper/ObjectMapper.xcworkspace -scheme ObjectMapper-iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
    ** CLEAN FAILED **
    
    
    The following build commands failed:
        Check dependencies
    (1 failure)
    ** BUILD FAILED **
    

    Using Xcode 8 Beta 3 , macOS El Capitan 10.11.6.

    opened by Dershowitz011 46
  • Currency issue

    Currency issue

    Hi, I'm Vietnamese developer.

    When I requested this API:

    https://developer.uber.com/docs/rides/api/v1-estimates-price

    It returned different unit for estimate, high_estimate, low_estimate values:

    { prices = ( { "currency_code" = VND; "display_name" = uberMOTO; distance = "1.18"; duration = 360; estimate = "10.000\U00a0\U20ab"; "high_estimate" = 10; "localized_display_name" = uberMOTO; "low_estimate" = 10; minimum = 10000; "product_id" = "9988f406-d98b-48eb-a4b7-a1645fa78e8e"; "surge_multiplier" = 1; }, { "currency_code" = VND; "display_name" = uberX; distance = "1.18"; duration = 360; estimate = "15.171-18.616\U00a0\U20ab"; "high_estimate" = 18; "localized_display_name" = uberX; "low_estimate" = 15; minimum = 5000; "product_id" = "4e6b60d5-8e3a-4772-86b5-324d09b0ce39"; "surge_multiplier" = 1; }, { "currency_code" = VND; "display_name" = UberBLACK; distance = "1.18"; duration = 360; estimate = "25.751-32.771\U00a0\U20ab"; "high_estimate" = 32; "localized_display_name" = UberBLACK; "low_estimate" = 25; minimum = 5000; "product_id" = "995a3c4a-fd8b-4a99-92f7-bb341b0addc6"; "surge_multiplier" = 1; }, { "currency_code" = VND; "display_name" = SUV; distance = "1.18"; duration = 360; estimate = "25.751-32.771\U00a0\U20ab"; "high_estimate" = 32; "localized_display_name" = SUV; "low_estimate" = 25; minimum = 5000; "product_id" = "9da8622e-e084-4a53-96d1-e510c4838b56"; "surge_multiplier" = 1; } ); }

    The values in "estimate" field is correct, the values in high_estimate and low_estimate must be multiplied by 1000.

    Please fix it soon.

    opened by quanghd 19
  • Dubious

    Dubious "User cancelled the login process" errors

    (Using UberRides 0.5.2 via CocoaPods, tested on iPhone6 with iOS 9.3.4)

    Immediately after obtaining a valid access token via deep link, our login methods themselves will sometimes return a nil accessToken with the following error:

    com.uber.rides-ios-sdk.ridesAuthenticationError Code=25 "User cancelled the login process."
    

    Note that I definitely did not cancel anything as the user. All I did was press "Allow". This has happened with both of the following methods (with AllTrips request):

    (void)loginButton:(UBSDKLoginButton * _Nonnull)button didCompleteLoginWithToken:(UBSDKAccessToken * _Nullable)accessToken error:(NSError * _Nullable)error
    
    [loginManager loginWithRequestedScopes:@[ UBSDKRidesScope.AllTrips ] presentingViewController: self completion: ^(UBSDKAccessToken * _Nullable accessToken, NSError * _Nullable error)
    

    If we ignore the error and use the valid access token we had already received beforehand, everything seems ok.

    bug 
    opened by regosen 17
  • ClientLoginError UberSDK

    ClientLoginError UberSDK

    I have followed the exact implementation of Uber iOS SDK in my iOS, 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

    opened by adeelasim 17
  • Uber opens Safari when i click on uberButton

    Uber opens Safari when i click on uberButton

    I have not installed uber in my iPhone, so uber is opening a URL in Safari. It is okay, Safari says could not load URL. Why ??

    Really i don't wanna open Safari if it is not opening a proper page. I don't wanna create a bad user experience.

    Would you give a chance for developers to decide choose way to open the URL ? via Uber app or via Safari.

    question 
    opened by speaktoalvin 17
  • Swift 3/Xcode 8 conversion

    Swift 3/Xcode 8 conversion

    Ran the conversion to Swift 3.0 against a current project using the UberRides Cocoapod. Starting point was the swift-3-dev branch.

    Updated ObjectMapper spec to ~> 2.0 to have the Swift 3 version of the dependency.

    Objects with type Mappable were updated to to require the named parameter and not '_' in order to match specifications in the current version of ObjectMapper

    After porting the source code, the project in this repo and test files were converted in Xcode to Swift 3.0 but not built/tested

    opened by long 15
  • not getting PRIVILEGED SCOPES

    not getting PRIVILEGED SCOPES

    Hi, i am using UberRide iOS SDK V 0.5.2 beta , i am making https://sandbox-api.uber.com/v1/requests/currentcall to get the current Ride details but every time i am getting following errors -

    • If request not included in scope:
    error msg- 
    {
      "message": "Missing scope: request",
      "code": "unauthorized"
    }
    
    • If request is included in scope:
    error msg-
    ridesAuthenticationErrorType -> rawValue -> invalid_scope
    Printing description of error:
    Error Domain=com.uber.rides-ios-sdk.ridesAuthenticationError Code=15 "Your app is not authorized for the requested scopes." UserInfo={NSLocalizedDescription=Your app is not authorized for the requested scopes.}
    

    For Implicit Grant/ Login Manager Only getting following scopes :ride_widgets, profile, places, history any help will be appreciated.

    opened by anupammishra1989 15
  • RideRequestView doesn't display a map.

    RideRequestView doesn't display a map.

    Hi all! I tried to use Ride Request Widget. I did all steps as described in doc : https://developer.uber.com/docs/riders/ride-requests/tutorials/widget/ios

    When I add RideRequestView or present RideRequestViewController , there is no map on screen :

    img_2222

    Any ideas how to fix it?

    Thank you in advance.

    The same issue on example project from : https://github.com/uber/rides-ios-sdk on branch : "swift-3-dev" The same issue on Android sample application

    enhancement 
    opened by Igorsnaki 10
  • Single Sign On Only Works for Users with Uber app?

    Single Sign On Only Works for Users with Uber app?

    I tried implementing the SDK and running it in the simulator, got this on my logs

    2016-09-08 15:36:26.932 GlydeApp[49019:1232400] -canOpenURL: failed for URL: "uberauth://connect?third_party_app_name=Glyde&callback_uri_string=glyde://uber&client_id=[secret...]&login_type=default&scope=profile%20places%20request&sdk=ios&sdk_version=0.5.2" - error: "(null)"

    Isn't there a fallback option to use the SafariViewController / web interface for people who don't have the app on their phone?

    opened by bennettl 10
  • Uber SSO login issue in iOS 8 Swift 2.2

    Uber SSO login issue in iOS 8 Swift 2.2

    I am trying to integrate Uber Ride SDK in my app.

    Use this code to add Uber login button

    whiteLoginButton = LoginButton(frame: CGRectZero , scopes: [.Profile, .Places], loginManager: LoginManager(loginType: .Native))
    whiteLoginButton.presentingViewController = self
    whiteLoginButton.delegate = self
    whiteLoginButton.colorStyle = .White
    blackView.addSubview(whiteLoginButton)
    

    and for delegation use this

    extension ViewController : LoginButtonDelegate{
        func loginButton(button: LoginButton, didLogoutWithSuccess success: Bool) {
            self.showMessage("Logout Success")
        }
     func loginButton(button: LoginButton, didCompleteLoginWithToken accessToken: AccessToken?, error: NSError?) {
            if accessToken != nil {
     self.showMessage("Got an AccessToken!")
       } else {
                // Error
        }
    }
    

    Code not working for native type login in app. In details SSO login not redirect from official uber app back to my app with access token.

    all callback URL and settings are verified from other sample and working in IOS 9+

    bug in progress 
    opened by ERbittuu 10
  • UBSDKLoginManager shows error

    UBSDKLoginManager shows error

    I tried to login with that code which is give below - with or without using redirect_URI but it always show error orderly 1.The Redirect URI provided did not match what was expected. 2. Invalid Redirect URI provided. or The server was unable to understand your request. most of time its crashes. even I tried the example code It shows same error. I checked my whole project but there is no any other issue I found. Please help me to solve my issue. Thanks

    UBSDKLoginManager *loginManager = [[UBSDKLoginManager alloc]init];
    NSArray<UBSDKRidesScope *> *requestedScopes = @[ UBSDKRidesScope.RideWidgets, UBSDKRidesScope.Profile, UBSDKRidesScope.Places ];
    [loginManager loginWithRequestedScopes:requestedScopes presentingViewController:self completion:^(UBSDKAccessToken * _Nullable accessToken, NSError * _Nullable error) {
        if (accessToken) {
            //[self _showMessage:UBSDKLOC(@"Saved access token!")];
        } else {
            //[self _showMessage:error.localizedDescription];
        }
    }];
    
    opened by akki6230 10
  • "User cancelled the login process"

    I've seen this issue posted and supposedly fixed, but I am getting this error every time I try to login. I've followed every setup instruction precisely. I don't see any activity on this project in years, does this SDK still work?

    opened by coderkid9090 1
  • CocoaPods install Xcode 12.4

    CocoaPods install Xcode 12.4

    Multiple commands produce '../../testApp.app/Assets.car':

    1. Target 'testApp' (project 'testApp') has compile command with input '.../testApp/testApp/Assets.xcassets'
    2. That command depends on command in Target 'testApp' (project 'testApp'): script phase “[CP] Copy Pods Resources”
    opened by m-alnafisah 0
  • App Privacy Details (aka Nutrition Labels) information/policy for the SDK

    App Privacy Details (aka Nutrition Labels) information/policy for the SDK

    Hi,

    Users of this SDK now need to provide Apple with privacy details for their apps, which includes any data sent to Uber's servers by embedded SDKs. Since these details must include what the data is/may be used for as well as what the data is, it cannot be inferred from an audit of the SDK code and can only come from Uber itself.

    Can we have an eta as to when these details will be provided?

    Thanks.

    Context: https://developer.apple.com/app-store/app-privacy-details/

    opened by aufflick 2
  • Bitcode Processing failed

    Bitcode Processing failed

    While processing your iOS app, errors occurred in the app thinning process, and your app couldn’t be thinned. If your app contains bitcode, bitcode processing may have failed. Because of these errors, this build of your app will not be able to be submitted for review or placed on the App Store.

    opened by ghost 0
  • Server tokens ungeneratable

    Server tokens ungeneratable

    From the developer dashboard, the documentation states to simply generate a server token. Now it says you can only generate one by "reach[ing] out to your Uber Business Development representative for server token access."

    My use case requires displaying realtime info on the Uber request a ride button in my app. Any ideas on how to generate the server token required to enable this SDK?

    opened by Ludotrico 2
Releases(v0.12.0)
  • v0.11.0(Oct 22, 2018)

  • v0.10.0(Apr 27, 2018)

  • v0.9.0(Feb 15, 2018)

    Changes

    • Pull #213 All model properties are now Optionals.
      • In Objective-C, Double, Int, and Bool are represented by NSNumber boolValue, intValue, and doubleValue. The UBSDKDistanceUnavailable, UBSDKEstimateUnavailable, and UBSDKBearingUnavailable constants are now removed.
    • Pull #217 Add fallback to m.uber.com for Ride Request Deeplinks -- you can now have the Ride Request Deeplink fallback to Uber's web experience instead of using the App Store.

    Deprecated

    • The Ride Request Widget is now deprecated. New apps will not be able to add the Ride Request Widget, and existing apps have until 05/31/2018 to migrate. See the Uber API Changelog for more details.
    Source code(tar.gz)
    Source code(zip)
  • v0.8.2(Feb 6, 2018)

  • v0.8.1(Jan 31, 2018)

  • v0.8.0(Nov 28, 2017)

    0.8 separates the Uber Rides SDK into two modules, UberRides and UberCore. It also contains a number of authentication-related changes to simplify the Login with Uber flows.

    When migrating to 0.8, you may need to add import UberCore to files previously importing just UberRides, and rename usage of some classes below.

    Changes

    • LoginManager now uses SFAuthenticationSession, SFSafariViewController, or external Safari for web-based OAuth flows.
    • Deeplinking protocol simplified. Public properties from the previous protocol is now available under the .url property.
    • UberAuthenticating protocol simplified.
    • AccessToken adds two new initializers intended to make custom OAuth flows easier. Fixes Issue #187

    Moved to UberCore

    • Configuration
    • TokenManager
    • RidesAppDelegate -> UberAppDelegate
    • UberAPI -> APIEndpoint
    • RidesError -> UberError
    • RidesScope -> UberScope
    • Deeplinking, BaseDeeplink, AppStoreDeeplink, AuthenticationDeeplink
    • UberAuthenticating, BaseAuthenticator, AuthorizationCodeGrantAuthenticator, ImplicitGrantAuthenticator, NativeAuthenticator
    • UberButton
    • UBSDKConstants

    Removed

    • LoginView - initiate the login process via LoginManager instead.
    • LoginViewAuthenticator - initiate the login process via LoginManager instead.
    • OAuthViewController - initiate the login process via LoginManager instead.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Sep 18, 2017)

    0.7 makes the Uber Rides iOS SDK compatible with iOS 11 and Swift 4.

    Added

    Fixed

    Removed

    • Pull #175 China support is now removed
    • RidesClient.fetchCheapestProduct is removed since the Ride Request API no longer supports it with upfront fares.
    • Pull #179 UberRides no longer depends on ObjectMapper
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Nov 23, 2016)

  • v0.5.3(Nov 19, 2016)

    Uber Rides iOS SDK (Beta) v0.5.3

    This will be the final release using Swift 2.2

    Fixed

    • Issue #51 Added Information about Server Token in README
    • Issue #58 Updated README examples to correctly use pickup & dropoff
    • Issue #76 Update Ride Request Button Delegate to always fire. The RideRequestButtonDelegate will now always fire didLoadRideInformation once information has been loaded. Including if it encounters an error. Any errors that are encountered will still fire didReceiveError. didReceiveError will always be called before didLoadRideInformation
    • Issue #86 via Pull #114 Fix RideScope not mapping for all cases
    • Issue #94 Make ride status available in Objective-C
    • Issue #127 Shared Credentials across iOS app and extension
    • Pull #105 Fixing typos
    • Pull #72 Updates to make README more clear
    • Pull #73 Updates to README about info.plist
    • Pull #65 Example of how to run samples without Carthage
    Source code(tar.gz)
    Source code(zip)
    Obj-C-SDK-example.zip(87.57 KB)
    Swift-SDK-example.zip(75.43 KB)
  • v0.5.2(Aug 2, 2016)

    Uber Rides iOS SDK (Beta) v0.5.2

    Added

    The Ride Request Widget now attempts to refresh expired access tokens automatically. If you are using the RideRequestViewController, the SDK will attempt to hit the Refresh endpoint with your current Access Token's Refresh Token. If that fails, the user will be redirected to the appropriate login

    Fixed

    • Issue #64 Refresh Endpoint returning error
    • Issue #57 Client login errors from expired access tokens.
    • Issue #52 Carthage setup incorrectly copying frameworks
    Source code(tar.gz)
    Source code(zip)
    Obj-C-SDK-example.zip(105.59 KB)
    Swift-SDK-example.zip(90.53 KB)
  • v0.5.1(Jun 14, 2016)

  • v0.5.0(Jun 3, 2016)

    Uber Rides iOS SDK (Beta) v0.5.0

    Added

    SSO (Native login with Uber)

    Introducing SSO. Allows a user to sign in & authorize your application via the native Uber app. Users no longer have to remember their username & password as long as they are signed into the Uber app.

    • Added LoginType.Native
    • Added NativeLoginAuthenticator
    • Added LoginButton

    LoginButton

    Added a built in button to make login easier. Uses a LoginManager to initiate the login process when the user taps the button. Reflects the logged in / logged out state of the user

    Support all REST API Endpoints

    Updated RidesClient to support all of the REST API endpoints. See https://developer.uber.com/docs/api-overview for a complete overview of the endpoints

    UberAuthenticating Classes

    Added Authenticating classes to handle the possible login types

    • ImplicitGrantAuthenticator
    • AuthorizationCodeGrantAuthenticator
    • NativeAuthenticator

    These classes should be created with your requested scopes (and potentially other information) and will handle making the correct login call for you. LoginView and LoginManager have been updated to use these new classes

    Deeplinks

    All deeplink objects now subclass the BaseDeeplink which encapsulates shared logic for executing a deeplink.

    Added new Deeplinking objects, AuthenticationDeeplink which is used for SSO, and AppStoreDeeplink which is used to fallback to the Uber App on the App Store

    Changed

    Swift 2.2

    Updated to using Swift 2.2. XCode 7.3+ is now required

    Info.plist

    There has been an update in how you define your callback URIs in your Info.plist. We now support callbackURIs for different login types. Anything that is not defined will use the General type (if you still use the old UberCallbackURI key, that will be treated as General)

    We have also added UberDisplayName. This should contain the name of your application. See an example of the new format below

        <key>UberClientID</key>
        <string>YOUR_CLIENT_ID</string>
        <key>UberDisplayName</key>
        <string>YOUR_APP_NAME</string>
        <key>UberCallbackURIs</key>
        <array>
            <dict>
                <key>UberCallbackURIType</key>
                <string>General</string>
                <key>URIString</key>
                <string>callback://your_callback_uri</string>
            </dict>
            <dict>
                <key>UberCallbackURIType</key>
                <string>AuthorizationCode</string>
                <key>URIString</key>
                <string>callback://optional_authorization_code_uri</string>
            </dict>
        </array>
    

    You also need to add a new Application Query Scheme on iOS 9+ in order to use SSO

        <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>uberauth</string>
            <string>uber</string>
        </array>
    

    RideRequestButton

    The RideRequestButton has been updated to show information about your Uber ride. Requires setting a product ID in your RideParameters and optionally a dropoff address.

    • If only a productID is set, the button will update with a time estimate of how far away a car is
    • If dropoff address & productID are set, the button will show a time estimate and a price estimate of the trip

    Ride Request Widget Button

    The Ride Request Widget Button now defaults to using the .Native LoginType instead of the previous .Implicit. If Native login is unavailable, it will automatically fallback to Implicit

    Breaking

    LoginBehavior -> LoginType

    LoginBehavior has been removed, replaced by LoginType. Available login types:

    • .Implicit
    • .AuthorizationCode
    • .Native

    LoginManager

    LoginManager now takes a LoginType instead of a LoginBehavior

    LoginView

    LoginView is now initialized using the new UberAuthenticating classes rather than an array of RidesScope

    RidesClient

    Renamed getAccessToken() to fetchAccessToken()

    Fixed

    • Issue #29 Carthage Compatible. Updated the SDK to work with Carthage
    • Issue #25 AllTrips scope missing. With the addition of Authorization Code Grant & Native it is now possible to request privileged scopes
    • Issue #17 Warnings with Xcode 7.3. Selector syntax has been updated for Swift 2.2
    • Issue #1 Unclear documentation. Updated README to be more clear
    Source code(tar.gz)
    Source code(zip)
    sso-objc-example.zip(109.36 KB)
    sso-swift-example.zip(97.43 KB)
  • v0.4.2(Apr 19, 2016)

  • v0.4.1(Apr 19, 2016)

  • v0.4.0(Apr 14, 2016)

    Uber Rides iOS SDK (Beta) v0.4.0

    Added

    Configuration

    Handles SDK Configuration, including ClientID and RedirectURI. Values are pulled from your app's Info.plist

    LoginManager / Implicit Grant flow

    Added implicit grant (i.e. token) login authorization flow for non-privileged scopes (profile, history, places, ride_widgets)

    • Added OAuthViewController & LoginView
    • Added LoginManager to handle login flow
    • Added TokenManager to handle access token management

    Ride Request Widget

    Introducing the Ride Request Widget. Allows for an end to end Uber experience without leaving your application.

    • Requires the ride_widgets scope
    • Base view is RideRequestView
    • RideRequestViewController & ModalRideRequestViewController for easy implementation that handles presenting login to the user

    RideParameters

    All ride requests are now specified by a RideParameters object. It allows you to set pickup/dropoff location, nickname, formatted address & product ID. Use the RideParametersBuilder to easily create RideParameters objects

    RideRequestButton Updates

    RequestButton has been renamed to RideRequestButton

    RideRequestButton now works by using a RideParameters and a RequestingBehavior. The RideParameters defines the parameters for the ride and the requestingBehavior defines how to execute it. Currently available requestingBehaviors are:

    • DeeplinkRequestingBehavior
      • Deeplinks into the Uber app to request a ride
    • RideRequestViewRequestingBehavior
      • Presents the Ride Request Widget modally in your app to provide and end to end Uber experience

    Fixed

    • Issue #13 Using CLLocation for ride parameters
    • Issue #16 Added new Uber logo for RideRequestButton

    Breaking

    • ClientID must now be set in your app's Info.plist under the UberClientID key
    • RequestButton --> RideRequestButton
      • Removed init(colorStyle: RequestButtonColorStyle) use init(rideParameters: RideParameters, requestingBehavior: RideRequesting)
      • Removed all setting parameter methods (setPickupLocation(), setDropoffLocation(), ect) use a RideParameters object instead
      • Removed RequestButtonError, only used to indicate no ClientID which is now handled by Configuration
      • uberButtonTapped() no longer public
    • RequestDeeplink
      • Removed init(withClientID: String, fromSource: SourceParameter) use init(rideParameters: RideParameters) instead
      • Removed all setting parameter methods (setPickupLocation(), setDropoffLocation, ect) use a RideParameters object instead
      • SourceParameter removed
    • Removed Carthage support
    Source code(tar.gz)
    Source code(zip)
    ride-request-widget-objc-example.zip(67.68 KB)
    ride-request-widget-swift-example.zip(55.26 KB)
  • v0.3.0(Feb 2, 2016)

  • v0.2.1(Feb 1, 2016)

  • v0.2.0(Jan 19, 2016)

Owner
Uber Open Source
Open Source Software at Uber
Uber Open Source
Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter 45 Nov 29, 2022
Native iOS implementation of RadarCOVID tracing client using DP3T iOS SDK

RadarCOVID iOS App Introduction Native iOS implementation of RadarCOVID tracing client using DP3T iOS SDK Prerequisites These are the tools used to bu

Radar COVID 146 Nov 24, 2022
TelegramStickersImport — Telegram stickers importing SDK for iOS

TelegramStickersImport — Telegram stickers importing SDK for iOS TelegramStickersImport helps your users import third-party programaticaly created sti

null 35 Oct 26, 2022
Muxer used on top of Feed iOS SDK for airplay

FeedAirplayMuxer Muxer used on top of Feed iOS SDK for airplay purposes. Demo Project --> https://github.com/feedfm/AirplayDemo Feed Airplay Muxer is

Feed Media 0 May 6, 2022
Basispay IOS SDK Version 2

BasisPay-IOS-KIT BasisPay IOS Payment Gateway kit for developers INTRODUCTION This document describes the steps for integrating Basispay online paymen

null 0 Oct 21, 2021
Release repo for Gini Bank SDK for iOS

Gini Bank SDK for iOS The Gini Bank SDK provides components for capturing, reviewing and analyzing photos of invoices and remittance slips. By integra

Gini GmbH 1 Dec 6, 2022
Da Xue Zhang Platform Lvb iOS SDK

Cloud_Lvb_SDK iOS API Reference Dxz Meeting iOS SDK是为 iOS 平台用户音视频服务的开源 SDK。通过大学长开放平台自研RTC,RTM系统,为客户提供质量可靠的音视频服务。 类 类名 描述 CLS_PlatformManager SDK的音视频主要

null 8 Jan 10, 2022
PayPal iOS SDK

PayPal iOS SDK Welcome to PayPal's iOS SDK. This library will help you accept card, PayPal, Venmo, and alternative payment methods in your iOS app. Su

PayPal 25 Dec 14, 2022
Unofficial Notion API SDK for iOS & macOS

NotionSwift Unofficial Notion SDK for iOS & macOS. This is still work in progress version, the module interface might change. API Documentation This l

Wojciech Chojnacki 59 Jan 8, 2023
150,000+ stickers API & SDK for iOS Apps.

English | 한국어 Stipop UI SDK for iOS Stipop SDK provides over 150,000 .png and .gif stickers that can be easily integrated into mobile app chats, comme

Stipop, Inc. 19 Dec 20, 2022
Spotify SDK for iOS

Spotify iOS SDK Overview The Spotify iOS framework allows your application to interact with the Spotify app running in the background on a user's devi

Spotify 522 Jan 6, 2023
Headless iOS/Mac SDK for saving stuff to Pocket.

This SDK is deprecated Howdy all! ?? Thanks for checking out this repo. Your ?? mean a lot to us. ?? Unfortunately, this project is deprecated, and th

Pocket 230 Mar 18, 2022
Evernote Cloud SDK for iOS

Evernote Cloud SDK 3.0 for iOS This is the official Evernote SDK for iOS. To get started, follow the instructions bellow. Additional information can b

Evernote 256 Oct 6, 2022
iOS SDK for the Box Content API

Box iOS SDK Getting Started Docs: https://developer.box.com/guides/mobile/ios/quick-start/ NOTE: The Box iOS SDK in Objective-C (prior to v3.0.0) has

Box 112 Dec 19, 2022
OneDrive SDK for iOS

Get started with the OneDrive SDK for iOS Integrate the OneDrive API into your iOS app! 1. Installation Install via Cocoapods Install Cocoapods - Foll

OneDrive 101 Dec 19, 2022
Stripe iOS SDK

Stripe iOS SDK The Stripe iOS SDK makes it quick and easy to build an excellent payment experience in your iOS app. We provide powerful and customizab

Stripe 1.8k Jan 5, 2023
AWS SDK for iOS. For more information, see our web site:

AWS SDK for iOS The AWS SDK for iOS provides a library and documentation for developers to build connected mobile applications using AWS. Features / A

AWS Amplify 1.6k Dec 26, 2022
Zendesk Mobile SDK for iOS

⚠️ This Repository has been deprecated, please go to here for the Zendesk Support SDK ⚠️ Zendesk Mobile SDK for iOS Zendesk SDK for mobile is a quick,

Zendesk 113 Dec 24, 2022
PlayKit: Kaltura Player SDK for iOS

Kaltura Player SDK Demo: Demo repo. If you are a Kaltura customer, please contact your Kaltura Customer Success Manager to help facilitate use of this

Kaltura 77 Jan 3, 2023