dimanche 29 mars 2015

Hybrid Web-game Facebook integration: What's the Way To Go?

I have a Hybrid web-app / game which is built in Construct 2, and exported to Android and iOs using Intel XDK. Now I want to integrate Facebook into my game to fuel friends lists, high scores etc.


Construct 2 provides a Facebook object which I believe is based on Facebook's JavaScript SDK. As it is now, my game does not have a back end. So what I want to do is set up a PHP server that provides the services my game needs, using REST. My server needs access to the Facebook Api on the users behalf.


What would be the best way to tackle this issue?


What I came up with is to keep using Construct 2 and the Intel XDK as I am doing now, using Construct's FB object to authenticate the user and then send the access token to my server using AJAX. The drawback here is that sessions might expire...


Is there a better way to do this? The issue I'm facing is that my web-app is being exported using a wrapper to run as a native app on android and iOs. Hence the standard way of authenticating the PHP Sdk using a redirect to Facebook is a bit clunky at least. Can I authenticate the PHP sdk using i.e. Cordova's Facebook plugin? Or is there a better way to solve this problem?


Aucun commentaire:

Enregistrer un commentaire