Facebook 画布应用程序与 Facebook 移动网络应用程序
我对 facebook 画布应用程序和 facebook 移动网络应用程序之间的区别有点困惑。这是我困惑的背景。
我有一个画布应用程序,让我们将其命名空间称为 myfbapp,我基本上可以从 https: //apps.facebook.com/myfbapp 登录 FB 后,它会在 Facebook 中打开。我使用 java (apache / tomcat) 进行服务器端实现,为了简单起见,我们假设我的 Web 应用程序中只有一个 index.html 和一个authenticationfilter.java (它实现 Filter)。我的index.html 中没有任何Facebook 特定的Javascript API(没有FB.init() javascript 或类似的东西)或代码。每当用户访问我的画布应用程序时,我首先会收到对我的 Web 应用程序的请求,在其中我会得到signed_request、oauth_token、FB 用户 ID 等,我可以将它们用于我的内部身份验证、会话创建等。我对此画布应用程序绝对没有任何问题,并且一切都很好。请注意,当用户访问此应用程序时,我从浏览器到我的应用程序服务器收到的请求具有signed_request、user_id等。
现在我想让这个应用程序也可以在移动设备上使用,我想,哦,我需要做的就是是在 Facebook 的移动 Web 应用程序部分中为同一 myfbapp 添加此应用程序的移动 URL。我这样做了,正如预期的那样,当我从我的 Android 手机登录 Facebook 时,myfbapp 列在应用程序部分下,到目前为止一切顺利。当我点击该应用程序时,问题就开始了。我在我的应用程序服务器上收到请求,但它不包含signed_request、user_id等。???我原以为移动应用程序的工作方式与画布应用程序相同,但显然事实并非如此,或者我做错了一些事情。
然后我开始在 http://developers.facebook.com/docs/guides 阅读有关 Facebook 移动应用程序的更多信息/mobile/web/#register 其中讨论了在index.html中添加各种Facebook Javascript API(我从未在我的画布应用程序中做过类似的事情),然后我开始思考,也许移动网络应用程序是更像(或完全)像带有 FB connect 的常规网络应用程序不像画布应用程序(意味着它并没有真正在 Facebook 中加载),这是真的吗?
I'm a bit confused about the difference between a facebook canvas application and a facebook mobile web application. Here is the context of my confusion..
I have a canvas application, let us call its namespace as myfbapp, and I basically can access it from https://apps.facebook.com/myfbapp and after I login to FB it opens up with in Facebook. I'm using java (apache / tomcat) for my server side implementation and for simplicity sake let us say I just have an index.html and a authenticationfilter.java (which implements Filter) in my web application. I don't have any Facebook specific Javascript API (no FB.init() javascript or anything like that ) or code in my index.html. Whenever user accesses my canvas application I first get a request to my web application where I get the signed_request , oauth_token , FB user ID etc which I can use for my internal authentication, session creation etc. I have absolutely no issues with this canvas application and every thing works fine. Please note that when user accesses this app the request I get from the browser to my app server has the signed_request , user_id etc.
Now I wanted to make this app available on mobile devices as well and I thought, oh well all I need to do is add the mobile URL for this app in the mobile web app section in Facebook for the same myfbapp. I did that and as expected when I login to facebook from my android phone myfbapp is listed under the apps section, so far so good. The problem starts when I click on the app. I get the request on my app server but it doesn't contain the signed_request , user_id etc.. ????? I was expecting the mobile app to work the same way as the canvas app but apparently it doesn't or I'm doing some thing wrong.
Then I started reading more about facebook mobile app at http://developers.facebook.com/docs/guides/mobile/web/#register where it talks about adding various Facebook Javascript API's in the index.html (I never did anything like that in my canvas app) and then I started thinking , may be then mobile web app is more (or exactly) like a regular web app with FB connect and not like canvas application (meaning it doesn't really load with in Facebook) , is this true?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在移动 Facebook 上,您看不到任何自定义页面/选项卡。他们目前显然正在努力解决这个问题。
所以它与画布应用程序不同。您的移动应用程序将是一个完全独立的网站和页面,不在 Facebook 的 iFrame 中。
On mobile facebook you can not see any custom pages/tabs. They are apparently wokring on that at the moment.
So it will be different to a canvas app. Your mobile app will be a completely seperate site and page not in an iFrame on Facebook.
我最近在移动设备上的 Facebook Canvas / Page Tabs 中发现了一些行为。
也许这有助于更好地理解 Facebook 在移动环境中的行为方式。
移动浏览器
访问应用 URL
示例 URL
http://apps.facebook.com/myapp/
重定向到
下配置的移动网站设置>网站>移动站点 URL
并添加其他参数/?ref=web_canvas&code=
关于signed_request 代码字段
访问应用程序中心
无法通过移动浏览器访问 Facebook 应用程序中心。
访问页面选项卡
示例 URL
http://facebook.com/a_facebook_page/custom_page_tab_url
自定义页面选项卡在移动浏览器中不可见。
Facebook Open Graph 搜索
搜索 myapp 将返回 Facebook Canvas 的链接。
与通过移动浏览器访问应用程序 URL 相同的行为
移动 Facebook 客户端
访问应用程序 URL
无法直接访问此 URL。
访问应用程序中心
无法访问 Facebook 应用程序中心。
访问页面选项卡
示例 URL
http://facebook.com/a_facebook_page/custom_page_tab_url
自定义页面选项卡通过移动 Facebook 客户端不可见。
Facebook Open Graph Search
它表示此应用程序与此设备不兼容。
您需要注册一个 iOS / Android 应用程序并将用户发送到该应用程序以消除此错误。如果您将独立应用程序的链接添加到应用程序的 Facebook 描述中,可能会对用户有所帮助。然后应该在那里可见。
Some behaviour i discovered recently with Facebook Canvas / Page Tabs on mobile devices.
Maybe this helps to understand a little bit better how facebook behaves in mobile context.
Mobile Browser
Access App URL
Example URL
http://apps.facebook.com/myapp/
Redirects to the configured mobile website under
Settings > Website > Mobile Site URL
and adds additional params/?ref=web_canvas&code=<signed_request_code_field>
About the signed_request code field
Access App Center
There is no way to access the Facebook App Center via the mobile browser.
Access Page Tab
Example URL
http://facebook.com/a_facebook_page/custom_page_tab_url
Custom Page Tabs are not visible via the mobile browser.
Facebook Open Graph Search
Searching for myapp returns the link to the Facebook Canvas.
Same behaviour like Access App URL via Mobile Browser
Mobile Facebook Client
Access App URL
There is no way to access this url directly.
Access App Center
There is no way to access the Facebook App Center.
Access Page Tab
Example URL
http://facebook.com/a_facebook_page/custom_page_tab_url
Custom Page Tabs are not visible via the mobile facebook client.
Facebook Open Graph Search
It says that this app is not compatible with this devices.
You need to register an iOS / Android App and send the user to this app to get rid of this error. Probably it helps the user if you add the link to the standalone application to the Facebook description of the app. Which should then be visible there.