简体   繁体   English

Flash,Facebook和权限-JS,PHP或AS3 SDK

[英]Flash, Facebook & permissions - JS, PHP or AS3 SDK

Setting out to develop a Flash quiz application for Facebook, which SDK (JS/PHP/AS3) and Facebook API (Graph/old rest) should I choose? 着手开发针对Facebook的Flash测验应用程序,我应该选择哪个SDK(JS / PHP / AS3)和Facebook API(图形/旧版)?

Please also answer how the following would be accomplished using the preferred solution above and why this simplifies the development of the app: 还请回答使用上述首选解决方案将如何完成以下工作,以及为什么这会简化应用程序的开发:

  1. Authenticating user on app page 在应用页面上验证用户
  2. Requesting permission to publish to stream 要求发布权限以流式传输
  3. Requesting permission to publish to stream from within the application (is this at all possible or does the publish permission have to be granted beforehand, ie when the user OKs the application?) 从应用程序内部请求发布以进行流传输(这是完全可能的还是必须事先授予发布许可,即当用户确定应用程序时?)
  4. Storing quiz results in database 将测验结果存储在数据库中

(And yes, I've read Facebook's developer documentation and still think many Stackoverflow users may have the same questions - in part because these practices change much over time.) (是的,我已经阅读了Facebook的开发人员文档,仍然认为许多Stackoverflow用户可能会有相同的问题,部分原因是这些做法会随着时间的推移而发生很大变化。)

You can basically do two things: 您基本上可以做两件事:

  1. Use the semi-official AS3 API (based on the old rest API), and Facebook Connect. 使用半官方的AS3 API(基于旧的rest API)和Facebook Connect。 This can save you some time, although it's cumbersome (methods are weird, examples seldom work, Facebook Connect breaks randomly, testing locally is a bitch). 尽管这样做很麻烦(方法很奇怪,示例很少起作用,Facebook Connect随机中断,在本地进行测试很麻烦),但这可以节省您一些时间。

  2. Use the new Graph API, and OAuth for permissions. 使用新的Graph API,并使用OAuth获得权限。 Technically this is the best, and OAuth is a lot better (meaning it's not as crazy) than the old Facebook Connect but because it's new, there's no definitive AS3 API for it. 从技术上讲,这是最好的,并且OAuth比旧的Facebook Connect好很多(意味着它不那么疯狂),但是由于它是新的,因此没有确定的AS3 API。

I would personally recommend option 2 - it's a much more elegant solution. 我个人将推荐选项2-这是一种更为优雅的解决方案。 However, it means you may have to dig in, building your own AS3 layer to the Graph API (not a huge issue really - the API is simple) or using some third-party (potentially unpolished/incomplete) one, and understanding OAuth if you're never used it. 但是,这意味着您可能需要深入研究,在Graph API上构建自己的AS3层(确实不是一个大问题-该API很简单),或者使用某些第三方(可能未抛光/不完整),并且需要了解OAuth您从未使用过。

The good thing about building your own framework is that you'd be able to get a better understanding of how Graph/OAuth work so you could use it in the future. 构建自己的框架的好处是,您将能够更好地了解Graph / OAuth的工作方式,以便将来使用。 I know this may sound weird, but it's so common that Flash websites/apps have to use the Facebook API that having a good understanding of it, and a Facebook framework you have low-level control, is a great asset. 我知道这听起来很怪异,但由于Flash网站/应用程序必须使用Facebook API如此普遍,以至于对其有很好的了解,而拥有低级控制权的Facebook框架是一个很好的资产。 I've had to use third-party AS3 APIs with Facebook Connect in the past and it was hell; 过去,我不得不在Facebook Connect中使用第三方AS3 API,这真是太糟糕了。 I've recently started building my own, for my own purposes (so it doesn't cover everything the API can do), and it's a much saner solution. 我最近已经开始为自己的目的构建自己的应用程序(因此,它不涵盖API可以做的所有事情),并且这是一个更明智的解决方案。

Regarding question 3 - the advanced permissions can be requested at any time - either when the user first allows the application to access his/her data, or later when you need to use some advanced feature like publishing to their stream. 关于问题3-可以在任何时候请求高级权限-在用户首次允许应用程序访问其数据时,或者在以后需要使用某些高级功能(如发布到其流中)时。 You can also check whether the user has already granted permissions for that. 您还可以检查用户是否已授予该权限。

Also, for your additional question - regardless of what you build (whether it's a separate page, an application, or a tab) you always need an 'application' created. 另外,对于您的其他问题-无论您构建什么(无论是单独的页面,应用程序还是选项卡),都始终需要创建一个“应用程序”。 Unless you're using the public API (like reading a public page stream); 除非您使用公共API(例如读取公共页面流),否则; then it's only the Graph API with no authentication and as such, no App key. 那么它只是Graph API,没有身份验证,因此也没有App密钥。

I have written a tutorial detailing what @zeh described as option number 2 - it shows how to connect with a Facebook account from within Flash, using the PHP SDK and without any external ActionScript classes/libraries. 我已经写了一个教程,详细介绍了@zeh描述为选项2的内容-它显示了如何使用PHP SDK在Flash中使用Facebook帐户与Facebook帐户建立联系,而无需使用任何外部ActionScript类/库。

It can be found here: 在这里能找到它:
http://icodethings.tumblr.com/post/17597008914/connect-with-facebook-workflow-from-flash-as3-using http://icodethings.tumblr.com/post/17597008914/connect-with-facebook-workflow-from-flash-as3-using

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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