Facebook - 粉丝门/重定向问题

发布于 2024-11-28 23:54:59 字数 448 浏览 0 评论 0原文

我在 Facebook 上建立了一个商业页面。 当用户第一次到达时,他们会看到一个使用粉丝门控的自定义欢迎应用程序 iframe 应用程序。 (1) 如果用户点击“LIKE”,那么我们会将其转发到墙上。 (2) 如果用户随后单击欢迎应用程序链接,他们应该能够正常查看内容。目前在欢迎应用程序上,我有一些将用户转发到 Wall 的 javascript:

<script type="text/javascript">
if (top != self) top.window.location = 'http://www.facebook.com/abc?sk=wall';
</script>

所以问题是,如果用户喜欢,我只需要将用户转发到 Wall,但之后不会继续将他们转发到 Wall,而是让他们查看实际内容。

在 Facebook 上如何做到这一点?设置cookie?

I have set up a business page on Facebook.
When user first arrives they see a custom welcome app iframe app that uses fan gating.
(1) If user clicks LIKE then we forward them to the wall.
(2) If user subsequently clicks on welcome app link they should be able to view the content as normal. Currently on the welcome app I have some javascript that forwards the user to wall:

<script type="text/javascript">
if (top != self) top.window.location = 'http://www.facebook.com/abc?sk=wall';
</script>

So the issue is I only need to forward the user to Wall if they've LIKED though not continue forwarding them to the WALL afterwards, though rather let them view the actual content.

How might this be done on Facebook? set a cookie?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林迷了鹿 2024-12-05 23:54:59

从解析的签名请求(到选项卡 iFrame)中,您可以获取查看用户是否喜欢您的页面 - 内容将类似于以下内容(PHP print_r 的输出):

stdClass Object
(
    [algorithm] => HMAC-SHA256
    [issued_at] => xxxxxxxxxx
    [page] => stdClass Object
        (
            [id] => FAN_PAGE_ID // target page id
            [liked] => 1        // is the user a fan
            [admin] =>          // is the user an admin
        )

    [user] => stdClass Object
        (
            [country] => ie
            [locale] => en_GB
            [age] => stdClass Object
                (
                    [min] => 21
                )

        )

)

有关详细信息,请参阅:
http://developers.facebook.com/docs/authentication/signed_request/

如果用户是您页面的粉丝,变量 liked 设置为 1。如果不是,您可以输出您的重定向:

<script type="text/javascript">top.window.location = 'http://www.facebook.com/abc?sk=wall';</script>

From a parsed signed request (to an tab iFrame) you can get if the viewing user likes your page - the contents would be similar to the following (output of PHP print_r):

stdClass Object
(
    [algorithm] => HMAC-SHA256
    [issued_at] => xxxxxxxxxx
    [page] => stdClass Object
        (
            [id] => FAN_PAGE_ID // target page id
            [liked] => 1        // is the user a fan
            [admin] =>          // is the user an admin
        )

    [user] => stdClass Object
        (
            [country] => ie
            [locale] => en_GB
            [age] => stdClass Object
                (
                    [min] => 21
                )

        )

)

For more information see:
http://developers.facebook.com/docs/authentication/signed_request/

If the user is a fan of your page the variable liked with be set to 1. If not you can output your redirect:

<script type="text/javascript">top.window.location = 'http://www.facebook.com/abc?sk=wall';</script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文