Dilip V
Dilip V

Reputation: 1

Integrating Uber iOS demo sdk

I tried to install uber iOS demo sdk and changed the bundle id(A) in it for demo testing. Few of the scenarios don't work I don't why. I have changed the environment to sandbox environment. List of changes I made : 1] I created a sample app in dashboard with bundle id(A) and replaced the client id in Info.plist

I want a scenario where I want to request a ride on user behalf so I went to Authorization code grant /Login manager section. When I tried to login then it said opened a web view where it asked for permission access for various scopes. (request scope was included). I granted the permission and it came back to the demo app and throwed a error "unable to interpret the data from server" . What should I do here ?

I have marked all scopes in dashboard also.

Then I tried to login via native login (which is the last section in table) and it was working fine. I tried to change scope in native login (added request scope) and it throwed a error "Your app is not authorized for the requested scope" . How to test it in sandbox environment ? I know that I have to send uber the request for getting privileged scope access but how can I test it without that ?

Then I tried to login via implicit grant/Login manager with request scope and it throwed error that I requested scope not valid for implicit grant. (Which was as expected )

I have a requirement of booking cab on behalf of customer in app so that my user don't need to enter the entire information. Which is the correct way to do it ? Authorization or native login ? . How to test it both the scenarios .

I also saw the generate access token in dashboard for testing various scopes without getting permission from uber. How to use that token in iOS demo app ?

I have did a lot of research but cannot figure it out.

Thanks in advance.

Deeplinking work and ride request widget button works . (First two section of the table).

Upvotes: 0

Views: 167

Answers (1)

Sasa Jovanovic
Sasa Jovanovic

Reputation: 857

Related to Authorization Code Grant/Login Manager - I reproduced the problem when I was running it on the simulator. When I used my device to test this scenario all was working as expected. So looks like there are some limitations when this is used in the simulator.
Take a note that your Users will need to provide Clients credentials when they authenticate from their devices - if you want to do authentication on users behalf - you will need to know it for each of your User's Uber account's in order to get a valid access_token for the user. So creating ride request on the user's behalf is not a solution we will recommend. There is not a directly publicly available API to pay for other's rides currently. You can maybe take a look at : https://www.uber.com/business/how-it-works

Related to testing the "request" privileged scope on the Sandbox environment - you are right - this supposes to work for developers accounts even if the scope is not whitelisted. Unfortunately, there is a bug on Uber sandbox environment that disables this functionality - and we are aware of the issue - and this is going to be resolved soon - no ETA at the moment.

Related to the right way to authenticate your Users - I will suggest you to use Authorization code grant and SSO process.

Dashboard generated access_token is not usable in this demo - because demo creates own access_token each time. You can use generated access token to test Uber endpoints with Curl for example. For more info please check our documentation.

Upvotes: 1

Related Questions