Is it possible to use the Scores & Achievements API from Facebook solely from a native mobile application?

点点圈 提交于 2020-01-12 14:30:14

问题


I'm toying around with the Facebook APIs for a game I'm developing as a hobby project, after reading through the facebook SDK documentation, I'm still a little unclear as to what is required for developing games on the platform.

This is what I have :

  1. Native iOS application
  2. All game data is stored locally (levels, characters, items)
  3. I don't have any backend servers, the game is completely client side only.

I want to make the game "social" by adding achievements/friends lists, the facebook API seems like a good candidate for doing so

This is what I'm trying to achieve :

  • SSO - Hoping to make use of the facebook SSO for accounts so I don't have to implement my own authentication etc. This saves time in not having to develop it myself.
  • Scores - when a particular event happens in my game it will award some points to the user, I'm looking to use the scores API for this.
  • Achievements - after the user has earned a certain amount of points, or another predefined event has occurred, an achievement will be granted, using the achievements API.

Question : Can I use the scores and achievements APIs from facebook without having my game deployed onto a backend server?


回答1:


No, two reasons:

  1. You need a URL to host the metadata for your achievements
  2. The scores and achievements need to be posted using the App Access Token, and distributing that in your client app would allow anyone decompiling the app to change any of your app's settings, make posts on behalf of any of the app's users, redirect your traffic to another site, etc.

At the least, you need static pages describing the achievements, and a callback script you can hit from your mobile app which triggers the publishing to Facebook of the Scores and Achievements

Update 2012-09-06: it's no longer necessary to use the app access token to post scores and achievements, so you could use scores in a mobile app, but you still need a website to hold the achievement metadata




回答2:


I found a good answer for this recently. There's no point in duplicating, so please see the answer here: Using Facebook Achievement API in Android

(It is relevant for iOS as well as any other platform)



来源:https://stackoverflow.com/questions/10986772/is-it-possible-to-use-the-scores-achievements-api-from-facebook-solely-from-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!