在Facebook分享或取消后获得空白页

Getting blank page after Facebook share or cancel

本文关键字:空白 取消后 Facebook 分享      更新时间:2023-09-26

我正在使用feed方法进行facebook共享,当我使用浏览器时,所有工作都很好。

但是当我使用带有Phonegap(WebView)的web应用程序时,当我按下"取消"或"共享"(正确共享到facebook)时,我总是被重定向到一个带有以下url的空白页面https://m.facebook.com/v2.4/dialog/feed

任何想法吗?

            var obj = {
            method: 'feed',
            display: 'touch',
            link: url,
            picture: image,
            name: title,
            description: description,
            redirect_uri:"http://someurl"
        };
        function callback(response) {
            if (response && response.post_id) {
                window.location.href ="http://someurl"
                console.log("Facebook share has been made!");
            } else {
                console.log("Facebook not shared!");
            }
        }
        FB.ui(obj, callback);

我设法通过使用以下URL修复Android Webview的空白屏幕:

  window.location = "https://www.facebook.com/dialog/share?
  app_id=xxxxxxxxxxx&display=popup&href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer"

替换redirect_uri