I'm working on a small game, where the user can play one time each day. I will track this via the Facebook ID.
All the backend is done, and the game works when I manually insert my Facebook ID and access token.... But how do I get the access token from the Facebook API?
I tried this:
FB.init({
appId: 'my app id',
channelURL : '//my domain/channel.html', // Channel File
cookie: true,
xfbml: true,
status: true
});
FB.getLoginStatus(function (response) {
if (response.session) {
alert(response.session.access_token);
} else {
alert("not logged in");
}
});
But it always alerted "Not logged in", even if I'm logged into Facebook.
(My domain and app ID is hidden due to privacy of my client)