missing documentation for gameNetwork.request( "login")

Hi,

Can someone tell me where the documentation is for

gameNetwork.request( “login”)

I have looked in http://docs.coronalabs.com/daily/api/library/gameNetwork/request.html but cannot find it

its used in

http://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/

I just want to know if there is an error with the login what is returned.

Thanks

It depends if you want to use it for GameCenter (Apple) or Google Play Game Services.

You can find a link to both here: http://docs.coronalabs.com/daily/api/library/gameNetwork/index.html

Renato - thanks for that.

However looking at the function in http://docs.coronalabs.com/plugin/gameNetwork-google/request.html.

It states what is returned is isError.

I tried the following code and both doesn’t get called

[lua]

function GameNetwork:LoginCallback( event )

  print(“In LoginCallback 1”)

  if (event.isError) then

    native.showAlert( “Fail”, “User is not logged into Game Center”, { “OK” } )

   

  else

     native.showAlert( “Success!”, “User has logged into Game Center”, { “OK” } )

  end

   

print(“In LoginCallback 2”)

end

[/lua]

also

[lua]function GameNetwork:LoginCallback( event )

print(“In LoginCallback 1”)

if (event.data.isError) then
native.showAlert( “Fail”, “User is not logged into Game Center”, { “OK” } )

else
native.showAlert( “Success!”, “User has logged into Game Center”, { “OK” } )
end

print(“In LoginCallback 2”)

end[/lua]

When I debug with adb.  I never erach the second print statement

any ideas?

Worked it out.  It was my call back function.  I had not defined it correctly should have been like thus

self._gameNetwork.request( “login”, { userInitiated=true, listener= function(e) self:LoginCallback(e) end  } )

Thanks

ok

It depends if you want to use it for GameCenter (Apple) or Google Play Game Services.

You can find a link to both here: http://docs.coronalabs.com/daily/api/library/gameNetwork/index.html

Renato - thanks for that.

However looking at the function in http://docs.coronalabs.com/plugin/gameNetwork-google/request.html.

It states what is returned is isError.

I tried the following code and both doesn’t get called

[lua]

function GameNetwork:LoginCallback( event )

  print(“In LoginCallback 1”)

  if (event.isError) then

    native.showAlert( “Fail”, “User is not logged into Game Center”, { “OK” } )

   

  else

     native.showAlert( “Success!”, “User has logged into Game Center”, { “OK” } )

  end

   

print(“In LoginCallback 2”)

end

[/lua]

also

[lua]function GameNetwork:LoginCallback( event )

print(“In LoginCallback 1”)

if (event.data.isError) then
native.showAlert( “Fail”, “User is not logged into Game Center”, { “OK” } )

else
native.showAlert( “Success!”, “User has logged into Game Center”, { “OK” } )
end

print(“In LoginCallback 2”)

end[/lua]

When I debug with adb.  I never erach the second print statement

any ideas?

Worked it out.  It was my call back function.  I had not defined it correctly should have been like thus

self._gameNetwork.request( “login”, { userInitiated=true, listener= function(e) self:LoginCallback(e) end  } )

Thanks

ok