简体   繁体   中英

Facebook open graph in Corona SDK

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.

PS Any advise of open graph Facebook is invited.

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM