Package | com.distriqt.extension.gameservices.auth |
Interface | public interface AuthUtil extends flash.events.IEventDispatcher |
Property | Defined By | ||
---|---|---|---|
isSupported : Boolean [read-only]
Returns true if the auth utility functions are supported on the current
platform and service
If this returns false then all other functions in this class will fail
| AuthUtil |
Method | Defined By | ||
---|---|---|---|
clearToken(token:String):Boolean
Clear the specified token in local cache. | AuthUtil | ||
getToken(scope:String, useLegacy:Boolean = false):Boolean
Gets a token or authorisation to be consumed by some other services on behalf of a specified user account. | AuthUtil |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when there was an error retrieving the auth token | AuthUtil | |||
Dispatched when the auth token was successfully retrieved after a call to GameServices.service.authUtil.getToken() data will contain the auth token string | AuthUtil |
isSupported | property |
isSupported:Boolean
[read-only]
Returns true if the auth utility functions are supported on the current platform and service
If this returns false then all other functions in this class will fail
public function get isSupported():Boolean
clearToken | () | method |
public function clearToken(token:String):Boolean
Clear the specified token in local cache.
Parameters
token:String — The token to clear
|
Boolean — true if the operation was started successfully and false if it's not supported
|
getToken | () | method |
public function getToken(scope:String, useLegacy:Boolean = false):Boolean
Gets a token or authorisation to be consumed by some other services on behalf of a specified user account. How the token can be consumed depends on the scope string provided. Note: this method requires substantial network IO and is run asynchronously off the UI thread For Google Play Services this will return the current players Google Authentication Token. For GameCenter this returns the Identity Verification Signature from either:
fetchItemsForIdentityVerificationSignature
generateIdentityVerificationSignatureWithCompletionHandler
.
Parameters
scope:String — (optional) A string representing the authentication scope. To specify multiple scopes, separate them with a space (for example, "oauth2:scope1 scope2 scope3").
| |
useLegacy:Boolean (default = false ) — If true the legacy / deprecated implementation will be used.
|
Boolean — true if the operation was started successfully and false if it's not supported
|
auth:token:error | Event |
com.distriqt.extension.gameservices.events.AuthUtilEvent
com.distriqt.extension.gameservices.events.AuthUtilEvent.AUTH_TOKEN_ERROR
Dispatched when there was an error retrieving the auth token
auth:token:success | Event |
com.distriqt.extension.gameservices.events.AuthUtilEvent
com.distriqt.extension.gameservices.events.AuthUtilEvent.AUTH_TOKEN_SUCCESS
Dispatched when the auth token was successfully retrieved
after a call to GameServices.service.authUtil.getToken()
data
will contain the auth token string