- Home /
Google Play Services Authentication issue?
Hello Everyone,
I am using Google Play services in my Game, and i am getting login window fine but after enter information its not authenticating.
if (GUI.Button (new Rect (10, 10, 80, 60), "Authenticate")) {
// authenticate user:
PlayGamesPlatform.Activate ();
str = "Clicked......";
Social.localUser.Authenticate ((bool success) => {
if (success) {
str = "Success...";
Debug.Log ("Success...");
} else
str = "Fail.....";
});
}
Anyone know the solution of this problem please help me.
@VIPINSIRWANI, can you explain your test case? OnGUI can be called multiple times per frame, are you mashing the Authenticate button? Does the variable str get displayed in the UI, how do you know it failed, in success you explicitly output to the console for validation, but not in the case of failure.
yes sure i am using this code : -
using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
public class Call : $$anonymous$$onoBehaviour
{
public GUIText $$anonymous$$essage;
private string str;
// Use this for initialization
void Start ()
{
PlayGamesPlatform.Activate ();
}
// Update is called once per frame
void Update ()
{
$$anonymous$$essage.text = str;
}
void OnGUI ()
{
if (GUI.Button (new Rect (10, 10, 80, 60), "Authenticate")) {
// authenticate user:
PlayGamesPlatform.Activate ();
str = "Clicked......";
Social.localUser.Authenticate ((bool success) => {
if (success) {
str = "Success...";
Debug.Log ("Success...");
} else
str = "Fail.....";
// handle success or failure
});
}
}
}
Str is always printing Fail.
Try turning on the debug log:
GooglePlayGames.OurUtils.DebugLogEnabled = true;
GooglePlayGames.OurUtils class on github
When the debug log is enabled, depending on the error/exception, you may get a useful output to the unity console.
I am getting a similar problem, the GooglePlayServices is activating but not authenticating here is the console with the Debug messages: http://imgur.com/PjerSbT I have tried calling ShowAchievementsUI in both an ingame button and in the start function and gain the same result.
@$$anonymous$$attCCG - from your log it is looks like it using the DummyClient, which is what is used in the editor. The play game services do not work off-device.
Your answer
Follow this Question
Related Questions
Build Error for android 1 Answer
Google play authentication failed after adding keystore 2 Answers
How to implement a standby screen during authentication for the Play Games Services plugin? 1 Answer
inspector looks weird after importing GooglePlayGameServices plugin for unity 2 Answers
Unsupported major.minor version 52.0 - Android Build Error 2 Answers