What is the redirectURL I should put in my Uber app?

自闭症网瘾萝莉.ら 提交于 2019-12-06 02:37:04

问题


I'm reading Uber's sdk/api doc but I am a rookie and I don't know what the redirectURL should be. Is it a given url from Uber? Because I couldn't find it. Or is it an url for a webpage customized by app developer deployed their own server/local machine? If so, how should I write it?

Totally confused on this point.

Please help with some details as possible.

Many thanks!


回答1:


Here I solved this problem. Actually I was confused that if the redirect url is a url for web site on some server, then the architect would be quite complex and there seems to be no way to identify which authorization code is for which app client.

Now I think I'm clear since I read @Romain's comment here, and now I know that the redirect url can be an url of opening your ios app (I'm sure it works for android and others).

For instance, if your ios app's URL schema/name is: myapp, then the redirect url can be like this:

myapp://oauth/callback

then once user authorizes your app, the redirect url (in this case it's redirecting to your app) will be opened; and in the AppDelegate.m one of the callback delegate methods:

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 

will capture the redirect url with the authorization code sent from Uber; if you print it you would see something like this:

myapp://oauth/callback?code=YOURCODE

So the code can be well received by the correct app.




回答2:


The API interaction initiates as follows:

  1. The concerned request is redirected to Uber API,
  2. API authorizes the action
  3. API redirects user to a Custom page of your website, with a GET parameter that will contain all needed information sent by API.

So, basically, redurect URL is the page of your website that does the job once the user is authenticated via Uber API.

See more at official doc




回答3:


Redirect url is actually an url of opening your app. The official documentation has good insight in this regard.Read it here.



来源:https://stackoverflow.com/questions/31111813/what-is-the-redirecturl-i-should-put-in-my-uber-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!