0
votes

Is it possible to do user authentication / user-login for Facebook-Api inside a Visual Studio C# project using XNA Game Studio? I need to generate the access-token to post a message on a user's facebook wall. Currently I managed to do it with a WinForms application using this tutorial (English):

http://blog.prabir.me/posts/facebook-csharp-sdk-writing-your-first-facebook-application-v6

or this tutorial (German)

http://frank-it-beratung.com/blog/2011/01/29/tutorial-ein-facebook-pinnwandeintrag-mit-visual-basic-oder-c-teil-2/

Its no problem with WinForms, because you can use System.Windows.Forms.Webbrowser control.

So in order to support this functionality in XNA Game Studio, do I need to embed a Winform Control in XNA? Or is there a better way?

I could embed the Winform in XNA by using this tutorial:

http://theinstructionlimit.com/how-to-properly-use-windows-forms-with-xna

1

1 Answers

0
votes

You can try to use HttpWebRequest. You can google more info on how to use this method, essentially it is a direct connection to web page, the same way browser does it in background. Unfortunately it is not so easy to do and you might encounter additional facebook security barriers (as facebook does not want automated connections without web service).

There is also facebook sdk for windows store applications, but it should be possible to take some of it's code and use it for XNA.

So to answer your question - yes, there is definitely better ways to implement facebook login, but most likely much more complex than using Webbrowser control. Webbrowser should be last resort.