Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Post WP7 Game Achievements from XNA to Facebook

Lately we've been working on a 3D XNA-powered game for Windows Phone 7. We wanted to integrate an achievements system and be able to post achievements to Facebook. My question is: have someone done already a similar thing? Are there any good tutorials/resources on how to do so?

To my understanding, in order to login on Facebook, one can fire a WebBrowserTask on XNA, which will open a url using internet explorer app but meanwhile the xna game will be deactivated and reactivated when user press back button. The OAuth token could be transmitted back to the app using our own server. But would it be the only way to do so?

EDIT: I've successfully solved Facebook OAuth without a browser problem, see my blogpost: http://roman.ae-labs.org/?p=116

like image 847
Kel Avatar asked Nov 26 '10 16:11

Kel


1 Answers

You couldn't do this directly with the WebBrowserTask. You'd been to embed a web browser in your app, which, with XNA, you can't do.

This was asked on the facebook forums.

As a workaround you could try using the WebBrowserTask indirectly:

  1. Have you app open a web page (with the WebBrowserTask) on your site and pass it the ANID from the device.
  2. In that web page, present the ability to do the OAUTH with Facebook and have your web page manage the association between ANID and OAUTH login.
  3. When you wish to post an achievement. Have the app send the achievement and ANID to your website and then have that relay the update to Facebook.

Your app would need to check with your website to see if the oauth had been done or not as the site couldn't send the response back after step 2 (without a push notification).

Untested, but I don't see why the above wouldn't work.

like image 98
Matt Lacey Avatar answered Sep 28 '22 19:09

Matt Lacey