Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by I Am The Minion · Dec 16, 2015 at 02:30 AM · androidgoogle playleaderboardauthenticationachievements

Google Play Services Working, but not Working?

I've been watching and reading tutorials for days, and I'm stumped. Hopefully someone here can shed some light. I integrated the Google Play Services package and modified my script. I have achievements and leaderboards in place, and a debug gui that tells me whether or not user authentication was successful. Just to be safe, I added a button that forces authentication again when pressed. According to debug, authentication works fine. But... There is no sign in window, there is no notification when an achievement requirement is met, and the achievement and leaderboard buttons are unresponsive. Here's the relevant bits of my code:

         using UnityEngine;
         using System.Collections;
         using GooglePlayGames;
         using UnityEngine.SocialPlatforms;
         
         public class GooglePlay : MonoBehaviour {
         
                 void Start ()
             {
                 AuthenticateUser ();
             }
             bool showAuthFailure;
             bool showAuthSuccess;
             void AuthenticateUser()
             {
                 PlayGamesPlatform.Activate ();
                 Social.localUser.Authenticate((bool success) => {
                     if(!success)
                         showAuthFailure = true;
                     if(success)
                         showAuthSuccess = true;
                 });
             }
             public void ShowAchievements()
             {
                 Social.ShowAchievementsUI();
             }
             public void ShowLeaderboard()
             {
                 Social.ShowLeaderboardUI();
             }
          public void PostToLeaderboard(int score)
         {
                 Social.ReportScore (score, "CgkI_7vourIJEAIQHQ", (bool success) => {
                     //TODO handle success or failure
                 });
         }
     public void UnlockAchievement()
         {
                 Social.ReportProgress("Cgkl_7vourlJEAIQAg", 100.0f, (bool success) => {
                     //TODO handle success or failure
                 });
             }
             bool showGUI = true;
             bool showButton = true;
             void OnGUI()
             {
                 GUILayout.BeginArea(new Rect(5, 5, Screen.width/2, Screen.height));
                 if (showButton)
                 {
                     if(GUILayout.Button ("Authenticate!"))
                     {
                         AuthenticateUser();
                         showButton = false;
                     }
                 }
                 if (showGUI)
                 {
                     GUILayout.BeginVertical ("box");
                     if (showAuthSuccess) {
                         if (GUILayout.Button ("Google User Authenticated!"))
                         {
                             showAuthSuccess = false;
                             showGUI = false;
                         }
                     }
                     if (showAuthFailure) {
                         if (GUILayout.Button ("Use Authentication Failed!"))
                         {
                             showAuthFailure = false;
                             showGUI = false;
                         }
                     }
                     GUILayout.Label(Social.localUser.userName);
                     GUILayout.Label(Social.localUser.id);
                     GUILayout.Label(Social.localUser.image);
         
                     GUILayout.EndVertical ();
                 }
                 GUILayout.EndArea ();
             }

When you start the game, the gui clearly displays: Google User Authenticated. Something must be working, right?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Jabrils · Jun 22, 2016 at 05:13 AM

Hey did you ever figure this out? I am currently stumped on the same exact problem & would love for you to spread the wealth of knowledge :D

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by virgilcwyile · Aug 19, 2017 at 12:18 PM

I guess you forgot, PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();

Before PlayGamesPlatform.Activate();

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

37 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Google Play Games plugin for Unity Not Authenticating 9 Answers

Google play achievements problem please help 2 Answers

Convert android URI to usable path 0 Answers

Google Play load problem 0 Answers

Player is not authenticating - Google Play Games plugin for Unity not authenticating for android 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges