mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 22:52:14 +00:00
Updating FB API
This commit is contained in:
parent
f9e498353d
commit
d45c1c9d97
1 changed files with 28 additions and 0 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue