Hi all, I’ve been trying to use the new Facebook OAuth API inside a Unity desktop game and it took me a while to get a viable working solution so I thought I’d share it with the community: http://www.ifc0nfig.com/accessing-facebook-within-unity/.
It’s just a short guide on how to get set-up and I’ve included my Unity + Visual Studio projects for you to take a look at. Here’s a video demonstrating it: http://www.youtube.com/watch?v=sT1iHX2cxyA
Your solution looks like it’s getting very close. It might need some automation to get the login a bit more seamless, although if I’m not mistaken, a token can last as long as a user likes (when “stay connected” is enabled), which is much more convenient than having to re-do the process for every login.
Thanks werewraith, just wanted to give something back to the community! Do you have any thoughts on how to do the authentication automatically? The only option I can think of is using the htmlTexture but it doesn’t seem to work with Unity Indie/3 yet
The best -working- login example I can think of is realXtend, an open source spin-off of the SecondLife virtual world. It uses OpenID for login through what seems to be a browser emulation inside the standalone application (Including HTTPS connections and such). http://www.realxtend.org
Perhaps browsing through its source would give you a better idea of how it works.
I’m also interested into connecting my desktop app to Facebook, and I’ve downloaded the eth0izzle solution however it doesn’t work for me either. Any other ideas on how to do this?
Obviously, the best solution would be to connect directly through Unity Destkop app, but as an alternative could we maybe create a web app through which users can connect to Facebook - the web app would collect all the required information from Facebook - and then Unity Desktop app could connect to that web app and use that information? Does anybody see any possible problems with this approach?