2

Was trying to do basic integration of Uber's IOS Ride Request SDK, I followed the instructions here https://developer.uber.com/docs/riders/ride-requests/tutorials/api/ios

When trying to authenticate a user it opens the Uber app then immediately returns to my app. The console prints "code=25 'User cancelled the login process.'" I'm using a real device with IOS 13 and Swift 5.0. It looks like the Uber Developers social media hasn't been updated since 2017, and it doesn't appear very active.

Info.plist

<key>UberClientID</key>
    <string>907YWpr4cTwH9-TWVP0Fq8DX-_HuCxN3</string>
    <key>UberDisplayName</key>
    <string>Wandr</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>uber</string>
        <string>uberauth</string>
    </array>
    <key>UberCallbackURIs</key>
    <array>
        <dict>
            <key>UberCallbackURIType</key>
            <string>General</string>
            <key>URIString</key>
            <string>com.wandrinc.Wandr://oauth/consumer</string>
        </dict>
    </array>

login function

func loginToUber() {
        let loginManager = LoginManager()
        loginManager.login(requestedScopes:[.request], presentingViewController: UIApplication.shared.keyWindow?.rootViewController!, completion: { accessToken, error in
            if let error = error {
                print(error)
                return
            }
            self.requestRide()
        })
    }

App Delegate

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
        let handledUberURL = UberAppDelegate.shared.application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.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
    }

Output

Error Domain=com.uber.rides-ios-sdk.ridesAuthenticationError Code=25 "User cancelled the login process." UserInfo={NSLocalizedDescription=User cancelled the login process.}
Kevin Shiflett
  • 203
  • 1
  • 4
  • 10
  • 1
    Apparently a recent update fixed several people's problem: https://github.com/uber/rides-ios-sdk/issues/263 I was getting the same error as you but after updating to the most recent SDK and Rides app, I am now getting: "Your app is not authorized for the requested scopes", which might be due to my setup not being correct. Anyway, if you haven't yet, try updating. – Nick Jan 06 '20 at 12:50
  • 1
    Thanks Nick! I'll check it out soon and let you know what happens. – Kevin Shiflett Jan 06 '20 at 23:17

0 Answers0