本文介绍了FB.ui feed对话框需要redirect_uri,对话框不关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用JS SDK的FB.ui方法打开Feed对话框,并在用户共享后关闭它。我的问题是Feed对话框需要一个redirect_uri,即使文档说它不需要定义,弹出窗口重定向到那里,不会像回调函数那样关闭。

I am trying to open a feed dialog using the JS SDK's FB.ui method and have it close after the user shares. My problem is the feed dialog is requiring a redirect_uri even though the documentation says it doesn't have to be defined, and the popup window redirects there and will not close like the callback function says.

这是我的代码,附加到提交点击事件:

Here's my code, attached to the submit click event:

    FB.ui (
        {
            method: 'feed',
            name: 'xxx!',
            link: 'link to FB tab',
            picture: 'jpg',
            caption: 'xxx',
            actions: {name:'xxx',link:'url'},
            ref: 'xxx',
            redirect_uri: 'link to FB tab'
        },
        function(response) {
            self.close();
        }
    );

如果我离开redirect_uri,弹出窗口打开,但它只是说FB应用程序有错误,请重试。

If I leave off the redirect_uri, the popup opens but it just says the FB app has an error and please try again.

推荐答案

看来,这是Facebook的JavaScript SDK已知的变化:

It appears this is a known change in Facebook's JavaScript SDK: http://developers.facebook.com/bugs/302946973066993

1。)文档中指出,redirect_uri将被大多数SDK自动附加[1] - 以前的JavaScript SDK提供了一个关闭Lightbox iFrame的SDK。 2.)添加redirect_uri参数会导致Facebook Lightbox iFrame重定向,从而阻止用户关闭它。
3.)以前不需要redirect_uri参数。

1.) The documentation states that the 'redirect_uri' will be automatically appended by most SDKs [1] - previously the JavaScript SDK was providing one which closed the Lightbox iFrame. 2.) Adding a redirect_uri param results in the Facebook Lightbox iFrame redirecting which stops the user from being able to close it. 3.) The redirect_uri param was not required previously.

这是我习惯和曾经使用过的行为试图复制。 FB开发者报告说,现在这是按设计。

This is the behavior I'm used to and have been trying to duplicate. A FB dev reports that this is now "by design."

这篇关于FB.ui feed对话框需要redirect_uri,对话框不关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 22:06