trying to get app access token

前端 未结 5 1440
感动是毒
感动是毒 2020-11-28 04:55

I tried to get an app-access-token for my facebook app with this code:

APP_ACCESS_TOKEN = FB.api(
    \"oauth/access_token\",
    {client_id: APP_ID, client_         


        
5条回答
  •  孤独总比滥情好
    2020-11-28 05:28

    check if users of the node.js or the JAVASCRIPT.

    getLongLiveToken: function(data){
        FB.api('oauth/access_token', {
            client_id: data.client_id, // FB_APP_ID
            client_secret: data.secret, // FB_APP_SECRET
            grant_type: 'fb_exchange_token',
            fb_exchange_token: data.access_token // USER_TOKEN
        }, function (res) {
            if (!res || res.error) {
                console.log(!res ? 'error occurred' : res.error);
            } else {
                var accessToken = res.access_token;
                if(typeof accessToken != 'undefined'){}
            }
        });
    }
    

提交回复
热议问题