Difference between revisions of "FBInstant.player.getSignedPlayerInfoAsync"

From GiderosMobile
Line 7: Line 7:
 
  FBInstant.player.getSignedPlayerInfoAsync(requestPayload,callback)
 
  FBInstant.player.getSignedPlayerInfoAsync(requestPayload,callback)
 
</source>
 
</source>
'''requestPayload''': (string) A developer-specified payload to include in the signed response. ''''''<br/>
+
=== Parameters ===
'''callback''': (function) A function that will be called with two arguments: a SignedPlayerInfo object or nil is the operation failed, and an error code if the function failed. ''''''<br/>
+
'''requestPayload''': (string) A developer-specified payload to include in the signed response. <br/>
 +
'''callback''': (function) A function that will be called with two arguments: a SignedPlayerInfo object or nil is the operation failed, and an error code if the function failed. <br/>
 +
=== Examples ===
 +
'''Example'''<br/>
 +
<source lang="lua"><br />
 +
FBInstant.player.getSignedPlayerInfoAsync("my_metadata", function(result,error)
 +
    SendToMyServer(
 +
      result.getPlayerID(), -- same value as FBInstant.player.getID()
 +
      result.getSignature(),
 +
      "GAIN_COINS",
 +
      100)
 +
end)
 +
<br/></source>

Revision as of 11:45, 23 August 2018

Available since: Gideros 2018.3

Description


Fetch the player's unique identifier along with a signature that verifies that the identifier indeed comes from Facebook without being tampered with.

 FBInstant.player.getSignedPlayerInfoAsync(requestPayload,callback)

Parameters

requestPayload: (string) A developer-specified payload to include in the signed response.
callback: (function) A function that will be called with two arguments: a SignedPlayerInfo object or nil is the operation failed, and an error code if the function failed.

Examples

Example

<br />
FBInstant.player.getSignedPlayerInfoAsync("my_metadata", function(result,error)
    SendToMyServer(
      result.getPlayerID(), -- same value as FBInstant.player.getID()
      result.getSignature(),
      "GAIN_COINS",
      100)
end)
<br/>