开发者

Fatal error with FB.init: Uncaught OAuthException: Error validating access token

开发者 https://www.devze.com 2023-01-25 22:29 出处:网络
I have added like button to my application page: <div id=\"fb-root\"></div> <script> window.fbAsyncInit = function() {

I have added like button to my application page:

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: 'xxxxx', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>
<fb:like href="apps.facebook.com/myapp"></fb:like>

With first reaload every thing is ok. After 2-3 page reload I have this error:

开发者_StackOverflow中文版Uncaught OAuthException: Error validating access token. thrown

What is wrong with this? I have searched in stackoverflow but couldnot find any result. (only one)


I have the same problem. I found this thread on the Facebook dev forum. A dude says you need to add your app's API key to the initialization. Like so:

FB.init({appId: 'xxxxx', api_key: 'yyyyy', status: true, cookie: true,
         xfbml: true});

However this did not solve my problem. Might help you though.

0

精彩评论

暂无评论...
验证码 换一张
取 消