Type Function Library gameNetwork.* Return value none Revision Release 2024.3703 Keywords gameNetwork, Google Play Game Services See also gameNetwork.request() gameNetwork.show()
Initializes an app for use with Google Play Game Services.
gameNetwork.init( "google" [, initCallback] )
Listener. Callback function where, upon successful initialization, event.isError
will be nil
. On unsuccessful initialization, event.isError
will be true
. When problems such as network errors occur, event.errorCode
(integer) and event.errorMessage
(string) will be defined.
local gameNetwork = require( "gameNetwork" ) local function initCallback( event ) if not event.isError then native.showAlert( "Success!", "", { "OK" } ) else native.showAlert( "Failed!", event.errorMessage, { "OK" } ) print( "Error Code:", event.errorCode ) end end local function onSystemEvent( event ) if ( event.type == "applicationStart" ) then gameNetwork.init( "google", initCallback ) return true end end Runtime:addEventListener( "system", onSystemEvent )