使用新请求 2.0 发送 Facebook 画布应用程序的消息/项目的工作流程
使用新的 Request 2.0 和其他最新功能开发我的第二个应用程序和第一个应用程序。
我已设法让应用程序登录用户并授予扩展权限。
我的应用程序很简单:我希望用户能够向朋友发送消息以及用户选择的图形来配合消息。我想基本的比喻是一个礼物应用程序。
我并没有全神贯注于工作流程,尤其是使用新的 Request 2 对话框的示例似乎很少且相距甚远。
我认为工作流程的开始是这样的:
- 用户到达应用程序页面。登录后,根据需要授予权限
- 用户选择一个图形(通过 html 单选按钮表单)与他们输入到 html 文本表单中的消息一起
- 用户选择要向其发送消息/图形的朋友。
我假设我应该将 senderid、receiverid、图形链接(或 id)和消息放入数据库中。
如何从用户的选择中获取信息?在 FB 对话框上点击“发送请求”是否会将 FB 和表单 POST 信息发布到同一页面,以便我可以通过 PHP $_POST 变量读取它们?
当人们收到请求时,他们会接受它,但是我如何让他们处理未完成的请求并显示图形和消息?即 Archie 登录后,有 6 个朋友通过我的应用程序向他发送了物品。他如何在 FB 方法中看到 Veronica、Betty 和 Jughead 发送给他的消息/项目?
我的意思并不是基本的。如果我只是在自己的网站上编写 PHP 应用程序,我知道如何做到这一切。几分钟后我就完成了。在我的办公桌上造成头形凹痕的部分是试图弄清楚将 Facebook 添加到工作流程中是如何工作的。我一直在寻找示例和教程,但它们似乎对于 FB 希望我们使用的新方法来说已经过时了。
感谢您的指点!
Working on my second app and the first using the new Request 2.0 and other recent features.
I've managed to get the app to log a user in and grant the extended permissions.
My app is simple: I want a user to be able to send a message to a friend along with a user-selected graphic to go along with the message. I guess the basic metaphor is a gifting app.
I'm not wrapping my head around the workflow especially as examples using the new Request 2 dialog seem few and far between.
Here's what I'm thinking the beginning of the workflow looks like:
- User arrives at app page. Logged in, permissions granted if needed
- User selects a graphic (via an html radio button form) to go along with message they enter into an html text form
- User selects friend(s) to send the message/graphic to.
I'm assuming I should toss the senderid, receiverid(s), link to graphic (or id), and message into a database.
How do I get the info from my users' selections? Does hitting Send Requests on the FB dialog POST the FB and form POST info to the same page so I can read them via PHP $_POST variables?
When the person receives the request, they accept it, but how do I get them to go through the requests outstanding and display the graphic and message? i.e. Archie logs in and has 6 friends sending him items through my app. How does he, in FB methods, see the message/items that Veronica, Betty and Jughead have sent him?
I don't mean that in a basic way. I know how to do this all if I was just writing a PHP app on my own site. I'd be finished in a few minutes. The part that's causing a head-shaped dent in my desk is trying to work out how it works adding Facebook to the workflow. I've been looking for examples and tutorials but they seem to be out-of-date to the new methods FB wants us to use.
Thanks for any pointers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当用户关注请求时,您可以访问该请求 ID。如果您需要访问其他请求,用户需要与您的应用程序“连接”,以便您可以从用户对象中读取该信息。您可以在画布页面上找到所执行请求的请求 ID,并且您可以开发一个工作流程来对用户进行身份验证,以便能够访问该用户的任何其他请求。
讨论该过程的相关博客文章可在此处找到:
https://developers.facebook.com/blog /post/464
When a user follows a request you have access to that request ID. If you need to access additional requests the user needs to "Connect" with your app so you can read that info from the user object. The request ID for the acted upon request will be available to you on your canvas page and it will be up to you to develop a work flow that authenticates the user to be able to access any other requests for that user.
The related blog post that discusses the process is available here:
https://developers.facebook.com/blog/post/464