简体   繁体   English

Facebook画布应用程序与Facebook移动网络应用程序

[英]Facebook canvas app vs Facebook mobile web app

I'm a bit confused about the difference between a facebook canvas application and a facebook mobile web application. 我对facebook canvas应用程序和facebook移动Web应用程序之间的区别感到有点困惑。 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. 我有一个画布应用程序,让我们将其命名空间称为myfbapp,我基本上可以从https://apps.facebook.com/myfbapp访问它,并且在我登录到FB之后,它在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. 我正在使用java(apache / tomcat)作为我的服务器端实现,为了简单起见,我们假设我在我的Web应用程序中只有一个index.html和一个authenticationfilter.java(它实现了Filter)。 I don't have any Facebook specific Javascript API (no FB.init() javascript or anything like that ) or code in my index.html. 我没有任何Facebook特定的Javascript API(没有FB.init()javascript或类似的东西)或我的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. 每当用户访问我的画布应用程序时,我首先得到一个请求到我的Web应用程序,在那里我获得了signed_request,oauth_token,FB用户ID等我可以用于内部认证,会话创建等。我对这个画布应用程序绝对没有问题一切都很好。 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. 请注意,当用户访问此应用时,我从浏览器到我的应用服务器的请求包含signed_request,user_id等。

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. 现在我想在移动设备上提供这个应用程序,我想,哦,我需要做的就是在Facebook的移动网络应用程序部分为同一个myfbapp添加此应用程序的移动URL。 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. 我做到了,正如我预期的那样,当我从我的Android手机登录到facebook时,myfbapp列在应用程序部分下,到目前为止一直都很好。 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.. ????? 我在我的应用服务器上收到请求,但它不包含signed_request,user_id等。????? 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? 然后我开始在http://developers.facebook.com/docs/guides/mobile/web/#register上阅读更多有关facebook移动应用程序的内容,其中讨论了在index.html中添加各种Facebook Javascript API(我从未做过类似的事情)在我的画布应用程序中,然后我开始思考,可能是移动网络应用程序更像(或完全)像一个常规的网络应用程序与FB连接而不是像帆布应用程序(意味着它并没有真正加载在Facebook),这是真的?

On mobile facebook you can not see any custom pages/tabs. 在移动Facebook上,您看不到任何自定义页面/标签。 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的iFrame中。

Some behaviour i discovered recently with Facebook Canvas / Page Tabs on mobile devices. 我最近在移动设备上使用Facebook Canvas / Page Tabs发现了一些行为。 Maybe this helps to understand a little bit better how facebook behaves in mobile context. 也许这有助于更好地了解facebook在移动环境中的行为方式。


Mobile Browser 移动浏览器

Access App URL 访问应用URL

Example URL http://apps.facebook.com/myapp/ 示例网址 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> 重定向到Settings > Website > Mobile Site URL下配置的移动网站,并添加其他参数/?ref=web_canvas&code=<signed_request_code_field>

About the signed_request code field 关于signed_request代码字段

An OAuth Code which can be exchanged for a valid user access token via a subsequent server-side request OAuth代码,可通过后续服务器端请求交换有效的用户访问令牌

Access App Center 访问App Center

There is no way to access the Facebook App Center via the mobile browser. 无法通过移动浏览器访问Facebook App Center。

Access Page Tab 访问页面选项卡

Example URL http://facebook.com/a_facebook_page/custom_page_tab_url 示例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 Facebook开放图搜索

Searching for myapp returns the link to the Facebook Canvas. 搜索myapp会返回Facebook Canvas的链接。

Same behaviour like Access App URL via Mobile Browser 通过移动浏览器访问应用程序URL的行为相同


Mobile Facebook Client 移动Facebook客户端

Access App URL 访问应用URL

There is no way to access this url directly. 无法直接访问此网址。

Access App Center 访问App Center

There is no way to access the Facebook App Center. 无法访问Facebook App Center。

Access Page Tab 访问页面选项卡

Example URL http://facebook.com/a_facebook_page/custom_page_tab_url 示例URL http://facebook.com/a_facebook_page/custom_page_tab_url

Custom Page Tabs are not visible via the mobile facebook client. 通过移动Facebook客户端无法看到自定义页面选项卡。

Facebook Open Graph Search Facebook开放图搜索

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. 您需要注册iOS / Android应用程序并将用户发送到此应用程序以消除此错误。 Probably it helps the user if you add the link to the standalone application to the Facebook description of the app. 如果您将独立应用程序的链接添加到应用程序的Facebook描述中,它可能会帮助用户。 Which should then be visible there. 那时应该可以看到哪个。

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

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