- Home /
Google play services not working
I'm trying to implement google play services in my game, but it doesn't seem to work. I've done everything as specified- Linked my app to play services in the developer console. Added the SHA1 from Applications -> Release Management -> App signing -> Upload certificate. Downloaded the latest 'play services' unity package from GitHub. Added the required 'resource' to the play services setup in unity editor. Added the following script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
public class PlayGamesServices : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
PlayGamesClientConfiguration clientConig = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.InitializeInstance(clientConig);
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool success) =>
{
if (success)
Debug.Log("Logged In");
else
Debug.Log("Failed to Log In");
});
}
public static void PostToLederboard(long newHighScore)
{
Social.ReportScore(newHighScore,GPGSIds.leaderboard_global_high_score,(bool success) =>
{
if (success)
Debug.Log("New High Score posted");
else
Debug.Log("Unable to post New High Score");
});
}
public void ShowLeaderboard()
{
PlayGamesPlatform.Instance.ShowLeaderboardUI(GPGSIds.leaderboard_global_high_score);
}
}
Built the APK and when i run on device, nothing happens. I've tried editing the proguard file from this link but the build failed with 67 errors. I don't know what I'm doing wrong or what I'm missing.
I've already published my game to alpha before linking to play services, I'm wondering if that's the problem?
Answer by hendryshaikh2004 · Feb 02, 2021 at 12:40 PM
I have tried all stuff too you know nothing seems to work for me either if anyone finds out please tell me.
Answer by Josewdf · Feb 12, 2021 at 01:55 PM
How much time did you waited after configure the oAuth page? When you do it they display a little message saying that it could take a "few" days to work. In my case it was between 10 and 15 days. If everything else looks fine, Check on that.
Your answer
![](https://koobas.hobune.stream/wayback/20220612205105im_/https://answers.unity.com/themes/thub/images/avi.jpg)