Greetings.
I'm trying to implement achievements and leaderboards with Google Play Games for my upcoming Android game. I can't seem to get it to work even when following the code shown in the readme from their Github page (https://github.com/playgameservices/play-games-plugin-for-unity).
Sample logcat output:
http://pastebin.com/F6srpnkm
There's a couple Error_Not_Authorized messages thrown in there, but I only have a guess at why it's getting thrown at all.
Here's what I wrote to set up the Google platform in a Start method:
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = true;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate();
In that same script, when the user clicks on the Play button it tries to sign them in like so:
// authenticate user:
Social.localUser.Authenticate((bool success) => {
// handle success or failure
if(success)
{
SettingsHolder.googleLogIn = true;
PlayerPrefs.SetInt("GoogleLogIn", 1);
Debug.Log("woof3");
//logged in
}
else
{
SettingsHolder.googleLogIn = false;
PlayerPrefs.SetInt("GoogleLogIn", 0);
//error or canceled -ignore?
Debug.Log("boo3");
}
});
I think the reason this code isn't working is a Manifest issue. Right now the project has I think 3 Manifest files in the plugins folder. 1st from UnityAds, 2nd from GooglePlayServices, and the 3rd is from "MainLibProj."
My game is actively using UnityAds (Version: 1.1.4 (Apr 16, 2015)Size: 1.9 MB) and GooglePlayGames (current-build-- GooglePlayGamesPlugin-0.9.20.unitypackage) at the moment- not even sure what MainLibProj is for, but the manifest file said not to edit it... I'm really confused on how to combine the manifests properly or what I need to do here. I read an article about the manifest files for Google Play Game Services on the Android developer site, but it was primarily dealing with their mobile-ads integration and it seemed like it wasn't the right steps for my situation. This is the article I saw (https://developers.google.com/mobile-ads-sdk/docs/games#unity).
Does anyone have any suggestions or advice?
Thanks for your help in advance!
↧