Updating FB API

This commit is contained in:
Richard Davey 2018-08-06 17:48:58 +01:00
parent f9e498353d
commit d45c1c9d97

View file

@ -225,6 +225,18 @@ var FacebookInstantGamesPlugin = new Class({
return this;
},
flushData: function ()
{
var _this = this;
FBInstant.player.flushDataAsync().then(function() {
console.log('data flushed');
_this.emit('flushdata');
});
return this;
},
getStats: function (keys)
{
var _this = this;
@ -379,6 +391,22 @@ var FacebookInstantGamesPlugin = new Class({
return this;
},
getPlayers: function ()
{
var _this = this;
FBInstant.player.getConnectedPlayersAsync().then(function(players) {
console.log('got player data');
console.log(players);
_this.emit('players', players);
// id: player.getID(),
// name: player.getName(),
});
return this;
},
/**
* Destroys the FacebookInstantGamesPlugin.
*