How to integrate with Facebook

    General discussion

  • Is it possible to create an HTML5 Metro app that gets data from Facebook? If so, which SDK do you use?

    If I understand correctly, to use the Facebook JS SDK, you need to register a site domain and Metro apps aren't websites with a domain.

    Saturday, October 01, 2011 6:59 PM

All replies

  • I think I figured it out. Basically you use a specific FB redirect uri and if auth is successful, you detect the redirect to the login_success page and grab the token to use in subsequent calls to the api. 


    Snippet from the FB dev site:

    Our OAuth 2.0 implementation does not include explicit desktop app support. However, if your desktop app can embed a web browser (most desktop frameworks such as .NET, AIR and Cocoa support embedding browsers), you can use the client-side flow with one modification: a specific redirect_uri. Rather than requiring desktop apps to host a web server and populate the Site URL in the Developer App, we provide a specific URL you can use with desktop apps: https://www.facebook.com/connect/login_success.html.


    Sunday, October 02, 2011 8:35 PM
  • Take a look at this SDK Sample http://code.msdn.microsoft.com/windowsapps/Web-Authentication-d0485122 that shows how to get a Facebook access token.  You do need to register your app with Facebook first (e.g. as a Website, the url specified does not matter), in order to obtain a Facebook application id. Once you have the user's access token, you can use it to make calls to the Facebook graph API (https://developers.facebook.com/docs/reference/api/). This is what the Socialite app included in the Windows Developer Preview uses.

    Monday, October 03, 2011 6:33 PM