什么是Facebook应用程序画布和页面选项卡? [英] What is Facebook app canvas and page tab?

查看:109
本文介绍了什么是Facebook应用程序画布和页面选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经花了很多时间阅读FB开发文档和教程,但是我对画布应用程序和页面标签以及如何使用它们仍然感到困惑.

我期望在我的网站上使用FB SDK的目的是在登录屏幕上具有继续使用Facebook"按钮,具有一些共享和类似的按钮,如果用户允许,则向Facebook发送通知.我的站点具有内部消息传递系统,我想通知用户我的站点中发生了新消息或活动.这样,用户不必每天都在我的网站上查看活动,这对用户体验很重要,因为我希望获得很少的活动(每周大约很少的活动).

我正在运行所有程序,但是在用户单击通知后,他被带到canvas应用程序. FB的文档和教程着重于代码示例,但我没有在画布应用程序的真实描述中找到任何描述.如果没有这种基本的了解,我将无法完成通知逻辑,无法理解所涉及的术语(例如安全的画布url"),并且基本上不会对用户体验充满信心(我想做得尽可能多).

如果我用谷歌搜索什么是Facebook canvas应用程序",我会得到"canvas是Facebook上的一种身临其境的表现体验,供企业讲述他们的故事并展示他们的产品."显然,从下面的评论中可以得出结论……

如果有人可以用通俗易懂的方式进行解释,也许可以举例说明什么是canvas应用程序,并且考虑到我的主要目标是将其网站上的活跃性通知用户到他们的fb帐户,那么我应该如何使用.

我正在使用CI框架PHP SDK v5.

解决方案

背景

在Facebook中,您创建在平台"上运行的应用".作为快速,非常简化的摘要,应用程序可以运行的三种主要平台"类型是:

  1. 一个由您托管和控制,但与Facebook Graph API集成(具有Facebook登录,发布等)的网站,但是看起来像一个普通网站.您可以将它们托管在自己的服务器上.

  2. 一个旨在位于Facebook平台上的iFrame内的网站.这些应用通常也会与Facebook Graph进行交互.您仍然可以将它们托管在自己的服务器上,但是具有附加的优势,即页面加载时可以获得关于用户的有限信息.

  3. 独立程序(包括移动应用程序)也可以与Facebook Graph交互.

您正在谈论的是第二个-Facebook上的iFrame.

Facebook提供了两种方法来嵌入应用程序iFrame:

  1. 一个是画布应用程序.在Facebook页眉,页脚和右侧的一些广告中,这具有最小的环绕效果.它可以最大程度地利用您的空间. (例如 https://apps.facebook.com/candycrush/?fbs=-1&fb_appcenter= 1 )

  2. 另一个是页面标签"( https://developers.facebook.com/docs/pages /tabs ).它较小,设计用于放置在公司的"Facebook页面"中,因此具有较小的空间.但是,作为营销人员,它可以使所有产品更贴近您的公司. (例如: https://www.facebook.com/NutellaANZ/app/595447743881506/)

请注意,单个应用程序可以跨上述所有内容运行-画布,页面选项卡和独立的HTML页面.通过对API的某些更改,您还可以将相同的代码包装到移动设备上,然后放在应用商店中.用户可以登录您的移动应用程序,并且可以使他们登录网站,反之亦然(在一定限制内,但您需要对其进行探索).


仅游戏?

您是正确的,因为与应用程序相关的大多数Facebook文档都涉及游戏. 确实,开始的好地方是 https://developers.facebook.com/docs/games/gamesonfacebook 现在有帮助可以帮助您使用Canvas Apps.

但这不一定是游戏-只要您使用API​​,任何东西都可以使用.当您提到PHP时,请查看 https://developers.facebook.com/docs/php/howto/example_access_token_from_canvas -没有提及游戏,而是您从PHP的iFrame中获取信息的方式. (还有很多事情要做!).


阅读通知

单击通知时,Facebook将在URL中添加参数.其中一些由通知决定(请参见 https://developers.facebook.com/docs/games/services/通知)和其他信息将帮助您获取有关用户的信息( https://developers.facebook .com/docs/reference/login/signed-request https://developers.facebook .com/docs/php/SignedRequest/5.0.0 ).

因此,请使用此信息服务器端确定用户是谁以及如何处理用户.但是,一旦您进入Facebook生态系统,您想要为用户提供什么体验取决于您.

I have spent a lot of time reading FB dev docs and tutorials but I am still very confused with what canvas app and page tab are and how to use them.

What I am expecting from using FB SDK in my site is to have "continue with facebook" button on login screen , have a couple of share and like buttons and send notifications to facebook if user have allowed that. My site has internal messaging system and I want to notify users that new message or activity has happened in my site. In this way users would not have to check my site every day for activity which is important user experience as I expect rare activity(approx. few activities per week).

I have everything running but after user clicks on notification he is taken to canvas app. FB docs and tutorials focuses on code examples but I have not found anywhere description on what canvas app really is. Without this fundamental understanding I can not complete my notification logic, can not understand the terms involved like "secure canvas url" and basically does not feel confident about user experience(which I would want to make as great as possible).

If I google "what is facebook canvas app" I get "Canvas is an immersive and expressive experience on Facebook for businesses to tell their stories and showcase their products.". Apparently from comment below thats something else...

I would appreacite If someone could explain in plain word and maybe example what is canvas app and how should I use if taking into account that my main goal is to notify users about acitivity in my site to their fb account.

I am using CI framework PHP SDK v5.

解决方案

Background

In Facebook, you create "apps" that run on "platforms". As a quick, very simplified summary, the three primary types of "platforms" that apps can run are:

  1. A website that you host and control, but integrated with the Facebook Graph API (has Facebook Login, posting etc), but otherwise looks like a normal website. You host these on your own servers.

  2. A website designed to sit inside an iFrame on the Facebook Platform. These apps will also generally interact with Facebook Graph. You still host them on your own servers but you have the added advantage that but can get limited information about the user when the page loads.

  3. Stand alone programs (including mobile applications) that also interact with the Facebook Graph.

What you are talking about is the second of these - the iFrame on Facebook.

Facebook provide two ways to embed the application iFrame:

  1. one is a canvas app. This has minimal surrounds for Facebook Header, Footer and a few ads on the right. It maximises your space. (e.g. https://apps.facebook.com/candycrush/?fbs=-1&fb_appcenter=1)

  2. the other is a "page tab" (https://developers.facebook.com/docs/pages/tabs). This is smaller and designed to sit in a company's "Facebook Page" so has less space. As a marketer, however, it keeps everything more branded to your company. (Example: https://www.facebook.com/NutellaANZ/app/595447743881506/)

Note that a single app can run across all the above - canvas, a page tab and a stand-alone HTML page. With some shifting of the API, you can also wrap the same code for mobile and put on the app stores. A user can log in on your mobile app and you can have them logged in on websites and vice-versa (within some limits, but you'll need to explore those).


Games Only?

You are right in that most of the Facebook docs relating to apps refer to games. Indeed a good place to start is https://developers.facebook.com/docs/games/gamesonfacebook which is where help leads you for Canvas Apps now.

But it doesn't have to be a game - so long as you're using the APIs anything will work. As you mention PHP, have a look at https://developers.facebook.com/docs/php/howto/example_access_token_from_canvas - no mention of a game, but is how you get information from the iFrame in PHP. (There's a lot more reading to do!).


Reading notifications

When clicking on the notification, Facebook will add parameters to the URL. Some of these are determined by the notification (see https://developers.facebook.com/docs/games/services/appnotifications) and others will help you get information about the user (https://developers.facebook.com/docs/reference/login/signed-request, https://developers.facebook.com/docs/php/SignedRequest/5.0.0).

So use this information server-side to work out who the user is and how you want to handle the user. But what experience you want to give the user once you're in the Facebook eco-system is up to you.

这篇关于什么是Facebook应用程序画布和页面选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆