0

ユーザー名、誕生日、電子メール、プロフィール画像、性別などのユーザー プロファイル情報を asp.net プロジェクトで Facebook から取得しましたが、今では市と私の詳細を取得したいと思い、以前と同じ方法でこれらを取得しようとしましたが、残念ながら私はできません。

このリンクをたどって拡張プロファイル権限を表示しましたが、それでもできません。

これが私のスクリプトです

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script>
        // Load the SDK Asynchronously
        (function (d) {
            var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
            if (d.getElementById(id)) { return; }
            js = d.createElement('script'); js.id = id; js.async = true;
            js.src = "//connect.facebook.net/en_US/all.js";
            ref.parentNode.insertBefore(js, ref);
        } (document));

        // Init the SDK upon load
        window.fbAsyncInit = function () {
            FB.init({
                appId: '155578484623690', // App ID
                channelUrl: '//' + window.location.hostname + '/channel', // Path to your Channel File
                scope: 'id,name,gender,user_birthday,email,user_about_me,user_location',
                status: true, // check login status
                cookie: true, // enable cookies to allow the server to access the session
                xfbml: true  // parse XFBML
            });
            // listen for and handle auth.statusChange events
            FB.Event.subscribe('auth.statusChange', function (response) {
                if (response.authResponse) {
                    // user has auth'd your app and is logged into Facebook
                    var uid = "http://graph.facebook.com/" + response.authResponse.userID + "/picture";
                    FB.api('/me', function (me) {
                        if (me.name) {
                            document.getElementById('txtDisplayName').innerHTML = me.name;
                            document.getElementById('Email').innerHTML = me.email;
                            document.getElementById('BD').innerHTML = me.birthday;
                            document.getElementById('profileImg').src = uid;
                            document.getElementById('Gender').innerHTML = me.gender;
                            document.getElementById('city').innerHTML = me.about;
                            document.getElementById('city').innerHTML = me.location;
                        }
                    })
                    document.getElementById('auth-loggedout').style.display = 'none';
                    document.getElementById('auth-loggedin').style.display = 'block';
                } else {
                    // user has not auth'd your app, or is not logged into Facebook
                    document.getElementById('auth-loggedout').style.display = 'block';
                    document.getElementById('auth-loggedin').style.display = 'none';
                }
            });
            $("#auth-logoutlink").click(function () { FB.logout(function () { window.location.reload(); }); });
        }
    </script>
4

1 に答える 1

0

ユーザーに関するドキュメントによると、

  • Userのようなフィールドはなくabout、Page オブジェクトに使用されます。ユーザーの場合、必要なフィールドはbio.

  • 第二に、locationフィールドにはさらに場所が含まれidますname。したがって、使用する代わりに、ユーザーの場所の名前にme.location使用したいと思いますme.location.name

于 2013-05-13T11:05:41.550 に答える