I used the google play services plugins in my project, and it can login and use the leaderboard without any problem.
Today, I switched to the Gaming plugin, and the code for using it is quite straightforward
pcall(require, "gaming")
game = Gaming.new("googleplay")
game:addEventListener(Event.LOGIN_ERROR, function(e) print("LOGIN_ERROR") AlertDialog.new("failed", e.error, "OK"):show() end)
game:addEventListener(Event.LOGIN_COMPLETE, function(e) print("LOGIN_COMPLETE") AlertDialog.new("success", "login complete", "OK"):show() end)
game:login()
It always login failed, since the google play services plugin works well in the same project with the same package name, I think the project configuration and the console settings in google play store is OK.
I spent all my day on that issue, but have no result, finally, I have to change back to the google play plugin and everything comes to work again.
are there any special settings need for this Gaming plugin?
Comments
But I never see google's auth progressbar.
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: SinisterSoft, antix, Apollo14
Name
Google Drive API
By
Google
Service name
drive.googleapis.com
Overview
The Google Drive API allows clients to access resources from Google Drive.
Activation status
Enabled
This code below works - because I added it to a game that didn't even try to log in to google play before yesterday. It logs in now.
With these being defined earlier:
leaderboards={"xxx a leaderboard code xxx"}
local login=false
local tryLogin=true
local gamingName="Guest"
android=true
And a function called 'saveSettings()' that saves the settings, that have been previously loaded!
It also looks for my google name (sinistersoft) for the leaderboard and changes it to Anthony.
https://deluxepixel.com
gaming:addEventListener(Event.LOAD_SCORES_ERROR,function(e)
print("gaming LOAD_SCORES_ERROR: no scores?")--..e.error)
end)
https://deluxepixel.com
If this is the case then you will get the login error and a 'not licenced' message (see the code above). To fix this just go to google play and install the program officially. If not released then upload it as an alpha apk and again install from the store at least once.
https://deluxepixel.com
I modified nothing.
Likes: SinisterSoft, antix, totebo
Likes: totebo
Likes: totebo
this crap may create unnecessary problems for you later on
Likes: antix
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)