Eemil Ahonen Eemil Ahonen - 3 years ago 154
C# Question

AchievementsUI and LeaderboardsUI won't popup. Signing in works and unlocked achievements popups work

So. I have made a game with unity 5. And i have downloaded and configured the google play services plugin. I can sign in and unlock achievements with success. But for some reason the

Social.ShowAchievementsUI();

and
Social.ShowLeaderboardUI();

Won't work. Or anything won't popup.

So I'm trying to show the list of achievements and show the list of leaderboards available. I have 5 Achievements and 4 Leaderboards. I have this version of the game on Google Play alpha test. With the 2 buttons for Opening achievements menu and leaderboards but those won't work.
My code for login is:

void Start () {
if (PlayGamesPlatform.Instance.IsAuthenticated() == false)
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
SignIn();
}

void SignIn()
{
Social.localUser.Authenticate((bool success) =>
{});
}


for showing
achievementsUI
:

public void ShowAchievementsUI()
{
Social.ShowAchievementsUI();
}


for showing
Leaderboard ui
:

public void ShowLeaderboardsUI()
{
Social.ShowLeaderboardUI();
}


These 2 are called from buttons.

i am using:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
using GooglePlayGames.BasicApi;

Answer Source

Adding:

 <activity android:name="com.google.games.bridge.NativeBridgeActivity"
       android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

To AndroidManifest.xml fixed the issue

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download