Search code examples
iosobjective-cuber-api

Uber native login flagging error


I am currently running the example codes provided by Uber SDK (Objective C version).

I encounter a problem when I clicked on the Native Login and Ride Request Widget Button provided by the Objective C example.

After setting up the app in Uber and also copied the Client ID to the info.plist, I counter the error below:

When I click at the Ride Request Widget Button, the app will load a new view with the "Ride there with Uber" button. After clicking the "Ride there with Uber" button, the example app will flag a UIAlert with a message of "There seems to be a problem connecting to Uber. Please go back to AppName and try again". What could be the problem?

Btw, I fill in the redirect URL as "myapp://oauth/callback" on both the dashboard and the app info.plist.

Anything I miss out during the setup of this example?

Thanks.


Solution

  • Make sure the URL Scheme in Targets > Info is set to something like sampleApp, and not sampleApp://uberSSO. This solved my problem.

    For reference, here is the snippet from the Info.plist:

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>MySampleAppName</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>sampleApp</string>
            </array>
        </dict>
    </array>