0

Javascript SDK を使用してスコアを FB に投稿していますが、エラーが発生しています ({error:{message:"(#15) This method must be called with an app access_token.", type:"OAuthException", code:15 }}) :

私は次から来るaccessTokenを使用しています:

    FB.getLoginStatus(function(response) {
      if (response.status === 'connected') {
        // the user is logged in and has authenticated your
        // app, and response.authResponse supplies
        // the user's ID, a valid access token, a signed
        // request, and the time the access token 
        // and signed request each expire
        uid = response.authResponse.userID;
        accessToken = response.authResponse.accessToken;

スコアを投稿するために使用している関数は次のとおりです。

    FB.api("uid/scores", 'post', {score: scoredata, access_token: accessToken },
            function(response) 
        {
           if (!response || response.error) {
              console.error(response);
           } else {
              console.log(response);
           }
        });

fbにはJAvascriptのドキュメントが特にないので、誰かアイデアを教えてください。

ジェイコブ

4

2 に答える 2

0

これは、ユーザーとしてではなく、アプリケーションとしてスコアを投稿する必要があるためです。

あなたがやろうとしていることは、アプリケーションaccess_tokenを使用してサーバー側(ブラウザーの JavaScript ではなく)から行う必要があるため、アプリケーションの秘密が明らかになりません。

于 2012-04-12T09:07:52.140 に答える