Friday, 15 March 2013

facebook - Android(AIR/Actionscript) Cant return FB access_token from stageWebView -


Im simply trying to use tokens from FB using the platform webbook for their users. When I find out the output from the location changing / changing events, I get the google / fb url, none of these are tokens.

Here's my code: var webview: StageViewview = New Stage Webview (); Function on change (e: locationchange event): zero {trace (e.location); E.preventDefault (); WebView.loadURL (e.location); WebView.stage = null; } Function On Change (e: LocationChangeEvent): zero {trace (webView.location); If (webView.location.indexOf ("http://google.com") == 0 & amp; webview location index ("access_token")! = - 1) {trace ("?" + WebView Location .substring (webView.location.indexOf ("access_token"), webView.location.indexOf ("& expires_in"))); WebView.stage = null; }} Function connectFb () {webView.addEventListener (LocationChangeEvent.LOCATION_CHANGING, on changing); WebView.addEventListener (LocationChangeEvent.LOCATION_CHANGE, On Change); WebView.stage = Step; WebView.viewPort = New Rectangle (0, 0, Stage. Stagewidth, Stage. Stage High); WebView.loadURL ("https://graph.facebook.com/oauth/authorize?client_id=123456789012345&redirect_uri=http://google.com&type=user_agent&display=popup"}}

My code output:

  https://graph.facebook.com/oauth/authorize?client_id=164534120383085&redirect_uri=http://google .com & amp; Type = USER_AGENT & amp; Display = popup https://www.facebook.com/dialog/oauth?client_id=164534120383085&redirect_uri=http%3A%2F%2Fgoogle.com&type=user_agent&display=popup https: / /www.facebook.com/ Dialog / oauth? Client_id = 164534120383085 & amp; redirect_uri = http% 3A% 2F% 2Fgoogle.com & amp; type = user_agent & display = popup http://google.com/ http://google.com/http://www.google .com / http://www.google.com/   

I tried every tutorial on the net and even AS3 facebook dev & amp; Still can not figure it out; Any help is greatly appreciated, because it is a very important project for me

use this , Where you are updating the UI example profile picture or user's name

string ACC = session.getAccessToken ();

  Log.e ("Access-token", ACC);   

Best of luck

No comments:

Post a Comment