문제

The facebook technical documentation looks like an ape threw it's own excrement at a website - and that's how useful it is too...

So I have this web app (for android devices) and I need to authenticate using oAuth (since facebook's "kaleidoscope API policy" requires that their APIs are never the same if you look at them twice).

I need to show the login screen and I would like it to open in a dialog box rather than a whole new page, since multiple pages aren't supported on all android devices.

This is what I have so far: HTML:

<fb:login-button></fb:login-button>

Javascript:

FB.init({appId : XXXXX,status : true, cookie : true,xfbml : true, oauth:true});

Right now I get the full size PC style login dialog, but I want the nice pretty touch/mobile dialog. Any ideas?

도움이 되었습니까?

해결책

You can fix the issue by using a link that they recommend with a slight modification:

Their Link: http://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch

Your Link http://m.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch

Notice the change of www to m.

다른 팁

Have you checked out the Facebook SDK for android? It has full source code. It also use oAuth and show complete Facebook dialog. Here is link

https://github.com/facebook/facebook-android-sdk/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top