Skip to content
Johann Martinache edited this page Jul 2, 2013 · 3 revisions

Let's check if the Google Play Services are available:

if( StatusCode.translate( PlayServices.isAvailable( ) ) == Status.OK ){
	
}

Initializing

If available, we initialize the Play Services ( Wait for Event INIT ):

Lib.current.stage.addEventListener( Event.INIT , _onGP_init );
PlayServices.initialize( );

Testing for existing connection

var b =	PlayServices.isSigned_in( )

Does the connection can be reopened ?:

Lib.current.stage.addEventListener( SigninEvent.SUCCESS , _onSignin_success , false );
Lib.current.stage.addEventListener( SigninEvent.FAILED , _onSignin_failed , false );
PlayServices.connect( );

When the user clic on the connect button:

Lib.current.stage.addEventListener( SigninEvent.SUCCESS , _onSignin_success , false );
Lib.current.stage.addEventListener( SigninEvent.FAILED , _onSignin_failed , false );
PlayServices.beginUserInitiated_sign_in( );