如何解决FB.NativeExtensions.onready仅在页面在本机Facebook应用程序的WebView中呈现时才有效

时间:2018-02-14 11:48:58

标签: javascript facebook facebook-graph-api console

我收到了错误

FB.NativeExtensions.onready only works when the page is rendered in a WebView of the native Facebook app. Test if this is the case calling FB.UA.nativeApp()
j @ sdk.js:57
o @ sdk.js:140
a @ sdk.js:141
require @ sdk.js:24
require @ sdk.js:24
require @ sdk.js:24
require @ sdk.js:24
__d @ sdk.js:24
(anonymous) @ sdk.js:147
(anonymous) @ sdk.js:191
(anonymous) @ sdk.js:191

在处理GRAPH API'v2.11'时如何解决这个问题?

这是我的init功能

window.fbAsyncInit = function () {
    FB.init({
        autoLogAppEvents: true,
        status: true,
        xfbml: true,
        version: 'v2.11'
    });

    FB.Event.subscribe('comment.create', function (response) {
        // Get comment count
    });

    FB.Event.subscribe('comment.remove', function (response) {
        // Get comment count
    });
}

0 个答案:

没有答案