0

コードにfqlクエリがあり、先週(またはその前後)までは完全に機能し、その後突然機能しなくなりました。

以前のすべてのエイリアスを削除しようとしたため、「要求したエイリアスの一部が存在しません:」という奇妙な#803エラーが発生します。これは独特です(完全に赤いニシンだと思います)。そしてそれらを単に「名前」に置き換えます。

完全に私のロープの終わりに、これを引き起こしているであろう過去数週間の間にFacebookが何を変えたかを理解しようとしています。誰かが何か洞察を持っているなら、私はそれを聞いて本当に感謝しています。

私はここにコードを投稿していますが、過去2週間ほどのある時点まで、コードが数か月間完全に機能したことを示すコード自体についてのコメントは期待していません。

このコードの具体的な目的は、ユーザーの認証トークンを取得してから、/meリクエストでは利用できない詳細情報を取得することでした。

//I call this first to get the token

               function checkStatus() {     
            try{

                FB.getLoginStatus( function( loginResponse ){
                    if( loginResponse.status == "connected" ){
                        authToken = loginResponse.authResponse.accessToken;//this comes back as expected
                        expiresIn = loginResponse.authResponse.expiresIn;//this comes back as expected
                        getUserInfo();
                    } else {
                        registerApp();//this gets called if the user hasn't approved the app yet... this continues to work as expected
                    }
                } );

            }
            catch(e){
                alert("ERROR" + e);
            }
        }



//so the above method calls this


                function getUserInfo(){
            FB.api( "/me", function( meResponse ){   

                meResponse.authToken = authToken;
                meResponse.expiresIn = expiresIn;           
                console.log("meResponse = " + JSON.stringify(meResponse));
//this contains all the correct expected data

                FB.api(escape("/fql&q=SELECT name FROM user WHERE uid = '"+ meResponse.id +"'"),//here I've eliminated ALL extra aliases (though none of them were a problem before
                    function( response ){
                        console.log("RESP = " + JSON.stringify(response)); //this comes back with the following error:
//{"error":{"message":"(#803) Some of the aliases you requested do not exist: fql&q=SELECT name FROM user WHERE uid = 'xxxxxxxxx'","type":"OAuthException","code":803}}

                    }
                 )              
            } );

        }
4

1 に答える 1

0

つまり...FBは、fqlの呼び出し方法の構文を完全に変更したように見えますが、上記の古い方法(完全に機能している)への参照は表示されません。

新しい方法は、次のようなJSONオブジェクトを渡すことです。

{method:'fql.query',                            query: "SELECT uid,name,email,first_name,last_name,birthday_date,pic_big FROM user WHERE uid = '"+ meResponse.id +"'"}

そして、応答NO LONGERはdataという配列として返され、返されたオブジェクトの最上位にある名前のない生の配列になります...したがって、上記の例では、response[0]を確認しています。 response.data[0]。

これらの変更については、どのドキュメントにも記載されていません...たぶん私は気が狂っていますが、警告なしにAPIを完全に変更したようです。

多分私は何かが欠けています(私は通常そうです)。

他の誰かがこれについて助けを必要とする場合に備えて...これは新しく機能するコードの例です...

FB.api(
                    {method:'fql.query',   
                        query: "SELECT uid,name,email,first_name,last_name,birthday_date,pic_big FROM user WHERE uid = '"+ meResponse.id +"'"},
                function( response ){
                    console.log("RESP = " + JSON.stringify(response));
                    //all the data for this specific user is now in response[0], obviously if your search criteria contains more users, they'll be in the subsequent indexed items under the response array.                                            
                }
             )  
于 2012-12-27T23:29:33.860 に答える