HTML5 (Javascript) Client Reference
Class PlayerIO
Language: Javascript (HTML5)
Main class for authenticating a user and getting a client.
Example
Here is an example of using the class to authenticate:
Properties | ||||
---|---|---|---|---|
|
||||
|
||||
Methods | ||||
|
||||
|
PlayerIO.quickConnect
|
Access the QuickConnect service
PlayerIO.useSecureApiRequests
|
If set to true, all API Requests will be encrypted using TLS/SSL. Be aware that this will cause a performance degradation by introducting secure connection negotiation latency for all requests.
PlayerIO.authenticate
|
Authenticates a user to Player.IO. See the Authentication documentation on which authenticationArguments that are needed for each authentication provider.
Arguments
gameId:string | |
The game id of the game you wish to connect to. This value can be found in the admin panel. | |
connectionId:string | |
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default | |
authenticationArguments:object | |
A dictionary of arguments for the given connection. | |
playerInsightSegments:object | |
Custom segments for the user in PlayerInsight. | |
successCallback:function(client) | |
Callback function that will be called with a client when succesfully connected | |
errorCallback:function(PlayerIOError) | |
Callback function that will be called if an error occurs |
PlayerIO.gameFS
|
Get a gameFS instance for a specific game (only use this method when you don't have a valid client).
Arguments
gameId:string | |
The game id of the game you wish to access. |