B4A Library [New] Google Play Games Services

Jack Cole

Well-Known Member
Licensed User
Longtime User
Unfortunately the event "GPGS_ScoreSubmitted" is not returned.
I corrected the event for the new version.

This is working for me. I have to use SubmitScoreImmediate.

B4X:
Sub Leaderboard_Send_Score(LeaderboardId As String, Score As Int)
    lbc.SubmitScoreImmediate(LeaderboardId, Score)
End Sub

Sub GPGS_ScoreSubmitted(submissionData As GPGSScoreSubmissionData, statusCode As Int)
    LogColor($"submissiondata.GetLeaderboardId=${submissionData.GetLeaderboardId}, submissiondata.GetScoreResult=${submissionData.GetScoreResult(submissionData.TIME_SPAN_DAILY).FormattedScore}, StatusCode=${statusCode}"$, Colors.red)
    If submissionData.GetScoreResult(submissionData.TIME_SPAN_ALL_TIME).NewBest Then
        ToastMessageShow(submissionData.GetScoreResult(submissionData.TIME_SPAN_ALL_TIME).FormattedScore, False)
    End If
End Sub

 

Greg Breinholt

Member
Licensed User
Longtime User
I'm working on a class that will reduce some of the work involved with implementing sign in, leaderboards, and achievements. I will share it when it is done.
Did you make any progress on this that you could share?
Just staring to adapt my app to this new Library and not getting too far with getting sign in working (let alone getting leaderboards and submitting scores!).

Any examples of how to sign in , submit scores and view leaderboards would be very much appreciated!
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
Yes, I was able to fully implement it. I will look into seeing how complicated it would be to put together an example. At a minimum, I could share the class I developed for working with it.
 

Greg Breinholt

Member
Licensed User
Longtime User
Yes, I was able to fully implement it. I will look into seeing how complicated it would be to put together an example. At a minimum, I could share the class I developed for working with it.
Thanks Jack - any examples would be very much appreciated!
 

paris7162

Member
Licensed User
Longtime User
Is there a way to get the display name from this library? I don't want the account name because that is the email address. The display name is that shows on leaderboards and achievements.
 

DonManfred

Expert
Licensed User
Longtime User
but I don't see where to add this in the example?
reading #1 would help a lot

Don´t expect me to code it for you. I do not use the library.

Update 1.03:

  1. Added IsSignedIn method to check if the user is signed in or not.
  2. Added GetLastSignedInAccount method that will return a GPGSUserAccount object or null if not signed in.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…