FB init function gives wrong version error

后端 未结 20 1339
故里飘歌
故里飘歌 2020-12-08 18:18

I\'m using the Facebook JS sdk, and I have created a new App today. Everything is configured properly. Using init function like:

window.fbAsyncInit = functio         


        
20条回答
  •  不思量自难忘°
    2020-12-08 19:06

    In my case it was an api version problem, as suggested by the error message.

    Let the version loaded in the FB script tag match the one in your FB initialization script, by specifing the same when loading the sdk (in the hash), for instance for version 4.0:

    
    

    and in your script like:

    window.fbAsyncInit = function() {
        FB.init({
            appId: XXX,
            autoLogAppEvents: true,
            xfbml: true,
            version: 'v4.0' //<------------- same version
        });
    };
    

提交回复
热议问题