在Android应用使用Facebook的API得分? [英] Using Facebook scores API in an Android App?

查看:152
本文介绍了在Android应用使用Facebook的API得分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我整合为Facebook的API得分在Android游戏。我有相同的问题,因为这个问题:<一href=\"http://stackoverflow.com/questions/7536912/facebook-graph-api-explorer-wont-post-scores\">Facebook图形API浏览器将不会发布分数的。此修复程序是设置我的应用程序为Web,而不是本地/桌面。是不是因为成绩API不应该由本土游戏中使用?它是somehwat危险设置Web的原生应用?

I am integrating the scores API for facebook in an Android game. I had the exact same problem as this question: Facebook Graph API Explorer won't POST scores. The fix was to set my app as Web instead of Native/Desktop. Is it because scores API should not be used by native games? Is it somehwat dangerous to set up Web for a Native app?

感谢

推荐答案

我已经注意到这个也一样,但是我想知道,如果它是'设计'作为使用Facebook的积分API您需要访问应用程序访问令牌(在为了做这样的事情提交成绩),但是这个不认为从一个原生应用程序中使用安全的事情。这里是一个报价:

I have noticed this too, however I wondered if it is 'by design' as to use the Facebook Scores API you need access to the app access token (in order to do things like submit scores) however this isn't considered a safe thing to use from a native application. Here is a quote:

时,发帖功能直接从您的服务器,以保持他们私有的应用源于应用程序的访问令牌,才应使用。例如,你不应该使用一个应用程序访问令牌从原生移动应用内发布。这样做,可以让用户获得应用程序访问令牌,这可能会允许他们采取代表您的应用程序的行为。相反,你应该有你的原生移动应用队列动作与您的服务器,然后让服务器发布故事使用应用程序访问令牌的Facebook。

"App Access Tokens should only be used when the posting functions are originated directly from your servers in order to keep them private to the app. For example, you should not publish using an App Access Token from within a native mobile app. Doing that could allow the user to obtain the App Access Token, which could then allow them to take actions on behalf of your app. Instead, you should have your native mobile app queue actions up with your server and then have your server publish the stories to Facebook using the App Access Token."

下面是相关网站: HTTP://developers.facebook。 COM /文档/ opengraph /使用应用令牌/

所以,这听起来像真正使用的积分API的唯一途径是让本机应用程序安全地与一个单独的,安全的,服务器(可能在Heroku上),那么一旦该服务器已经验证了传递的数据,它会再跟Facebook和使用的应用程序访问令牌(它可以在没有它的用​​户得到保持安全使用)提交了比分。

So, it sounds like the only way to really use the Scores API is to have the native application securely talk to a separate, secure, server (potentially on Heroku) then once that server has verified the passed data, it would then talk to Facebook and submit the score using the app access token (which it can safely use without the user getting hold of it).

在此之上,Facebook的得分API仅支持一种每一个申请的分数(不是每个层面,每个模式等)的分数,所以要想有什么更先进的额外的服务器反正必需的,因此数据库可以存储,Facebook的用户ID映射到一个希望得分的各种分数。

On top of this, the Facebook Scores API only supports having one score per application (not per level, per mode, etc.) scores, so in order to have anything more advanced the extra server is required anyway, so a database can be stored that maps Facebook user IDs to the various scores one wishes to score.

这篇关于在Android应用使用Facebook的API得分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆