SahJ Posted September 20, 2018 Share Posted September 20, 2018 Hello, I have an instant game, and I want to try to take the user's data to use their token access to be able to consult the api, but an error occurs when I put the script that facebook gives me. Does anyone know a solution? The game I have hosted in the web hosting that gives facebook window.fbAsyncInit = function () { FB.init({ appId: 'APP ID', cookie: true, xfbml: true, version: 'v3.1' }); FB.getLoginStatus(function (response) { statusChangeCallback(response); FB.api('/me', { fields: 'id, name' }, function (response) { console.log(response) for (var o in response) { user_data.push.apply(response[o]); } console.log(user_data) }) }); }; This is error: Quote Link to comment Share on other sites More sharing options...
Noel Posted September 20, 2018 Share Posted September 20, 2018 @SahJ You cannot do that. You should only use the API available in the Instant Games SDK. Quote Link to comment Share on other sites More sharing options...
SahJ Posted September 20, 2018 Author Share Posted September 20, 2018 Then so that the user can invite his friends without accessing his api graph? https://www.facebook.com/instantgames/1360021937395207/ open the browser console and you will see that this game uses the FB.init and FBInstant, and in the console it shows the token Quote Link to comment Share on other sites More sharing options...
SahJ Posted September 20, 2018 Author Share Posted September 20, 2018 If I already solve it thanks for helping me the closeAsync () worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.