Facebook open graph in Corona SDK

773 views Asked by At

I want to implement activity feed like that in Candy Crush in my app which is based on Corona and I am not able to find any good solution of that. If someone have any idea about this please help me out.

P.S. Any advise of open graph Facebook is invited.

1

There are 1 answers

0
Tobi On

I'm not using Corona SDk, but what I found is the following:

You could use the facebook.request() function (http://docs.coronalabs.com/api/library/facebook/request.html) to make a request to the Facebook Graph API.

Assuming that you already gathered the relevant permission ("publish_actions") from the user for your app, you could make use of the Scores API (https://developers.facebook.com/docs/score/) and the Achievements API (https://developers.facebook.com/docs/games/achievements/) to post to the Users timeline like described here:

https://developers.facebook.com/blog/post/539/

You can post a score like this:

facebook.request("https://graph.facebook.com/me/scores?score=USER_SCORE&access_token=APP_ACCESS_TOKEN", "POST")

where USER_SCORE is the actual score and APP_ACCESS_TOKEN is the App Access Token for you app.

For achievements, you have to create an achievement first, as described in the above links. Once this is done, you can can post an achievement like this:

facebook.request("https://graph.facebook.com/me/achievements?achievement=YOUR_ACHIEVEMENT_URL&access_token=APP_ACCESS_TOKEN", "POST")