Hook result of oauth request from web application to Twitter in Android app
I have website, that implements "Sign in with twitter".
This authorization process: My site redirects user to twitter, then twitter asks user to allow my website access his account, he clicks "Allow", twitter redirects user back to my site, that gets access token.
Also I have an Androi开发者_如何学Cd app, that needs to initialize this auth process and finally get result. I can create intent, that opens url in browser, and all next steps go in browser, but can I hook somehow when browser is closed, or (that will be better) when browser gets final redirect, to check if authorization was OK and my website now can access user's twitter account, and close browser?
Do I need investigate about WebView, or this functionality can be implemented using regular Android browser?
I believe what you are looking for is setting up a custom scheme. With this you can set up a appname as a scheme and when you generate a request token from Twitter with an oauth_callback
as appname://callback
the user will be redirected back to that uri after authorizing and it will open your app.
精彩评论