Actionscript 3 Facebook API 限制
我正在使用 Actionscript 3 API 创建一个基于 Flash (AS3) 的 Facebook Connect 网站,尽管我已经具备了允许用户正确登录的基本 FB Connect 功能,但在尝试询问时却遇到了困难对于某些扩展权限。我并不肯定,但 AS3 API 似乎有两个相当重要的限制:
您必须与初始登录调用分开提示扩展权限。换句话说,需要两个模式对话框,而不是一个。这似乎是因为连接是通过 FacebookSessionUtil 的实例处理的,而扩展权限请求是通过 FacebookSessionUtil.Facebook 的实例处理的。
似乎没有办法提示用户允许他们的电子邮件地址与您的应用程序共享。虽然我仔细阅读了 http://facebook-actionscript -api.googlecode.com/svn/release/current/docs/index.html 相当彻底,看起来“EMAIL”权限仅提示用户允许您的应用通过 facebook 向他们发送电子邮件,而不是直接共享他们的电子邮件地址。
我的假设在这里是错误的吗?我使用 JS 和ExternalInterface 来完成此类工作会更好吗?我宁愿不重建现有的东西,但如果这些限制是真实的,那么我似乎别无选择。
任何反馈或帮助将不胜感激。谢谢!
I'm creating a Flash-based (AS3) Facebook Connect site using the Actionscript 3 API and though I've got basic FB Connect functionality in place in terms of allowing users to login correctly, I'm running into walls when trying to ask for certain extended permissions. I'm not positive, but it appears as though there are two fairly significant limitations to the AS3 API:
You must prompt for extended permissions separately from the initial login call. In other words, two modal dialogs, not one, are required. This seems to be because connecting is handled with instances of FacebookSessionUtil, while extended permissions requests are handled by instances of FacebookSessionUtil.Facebook.
It doesn't seem that there's a way to prompt users to allow their email address to be shared with your application. Though I've perused http://facebook-actionscript-api.googlecode.com/svn/release/current/docs/index.html quite thoroughly, it looks like the "EMAIL" permission there only prompts users to allow your app to send them email via facebook, not to share their email address directly.
Are my assumptions wrong here? Would I be better off using JS and ExternalInterface for this sort of work? I'd rather not rebuild what's in place but if these limitations are real, it appears I'll have no other choice.
Any feedback or assistance would be greatly appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1)您必须重写
DesktopSession
类中的onLogin
函数并添加扩展权限参数。2)它应该可以工作,除非权限模型的更改仅允许代理电子邮件。尝试从 Facebook 用户实例查询它,看看会得到什么。
在开发者控制台中使用控制台块中的以下 api 调用进行测试
1)You will have to override the
onLogin
function in theDesktopSession
Class and add in your extended permission parameters.2)It should work unless the change in the permissions model only allowed for proxied emails. Try querying it from the facebook user instance and see what you get.
Test it in the Developer console with the following api call in the console block
这是另一种方法,您可以直接在 AS3 中完成所有操作(非常方便),
这是我在 facebook 上构建的游戏的代码片段,需要在游戏中的某个点获得权限..它运行良好。 (请注意,您现在必须在 init 调用中指定 channel.html 和 oauth: true)
首先确保您拥有最新版本的 API(现在为 1.7)(http://code.google.com/p/ facebook-actionscript-api)
享受吧!
here's another way you can do it all directly in your AS3 (very handy)
this is a code snippet from a game i’m building on facebook that requires permissions at a certain point in the game.. it works well. (note you now have to specify a channel.html and oauth: true in your init call)
first make sure you have the most current version of the API (now at 1.7) (http://code.google.com/p/facebook-actionscript-api)
enjoy!