Created
February 5, 2015 01:45
-
-
Save marchbold/4191aed63b81e2122d53 to your computer and use it in GitHub Desktop.
This example demonstrates initialising the extension and then initialising the game platform.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (GameServices.isSupported) | |
{ | |
GameServices.init( Config.distriqtApplicationKey ); | |
trace( "GameServices Supported: " + GameServices.isSupported ); | |
trace( "GameServices Version: " + GameServices.service.version ); | |
GameServices.service.addEventListener( GameServicesEvent.INITIALISED, initialisedHandler ); | |
if (GameServices.service.isServiceSupported( Service.GOOGLE_PLAY_GAME_SERVICES )) | |
{ | |
var service:Service = new Service( Service.GOOGLE_PLAY_GAME_SERVICES, "googlePlayClientID" ); | |
GameServices.service.initialiseService( service ); | |
} | |
else | |
{ | |
// Google Play is not supported | |
} | |
} | |
... | |
private function initialisedHandler( event:GameServicesEvent ):void | |
{ | |
// The platform has been initialised | |
} | |
// com.distriqt.GameServices |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment