- Home /
Game Center integration not working on devices but working on simulator
I'm trying to update an iOS game but am having trouble with the Game Center integration. What is really strange is that it works on the iOS Simulator but not on an actual iOS device. I've narrowed the problem down to this code:
using UnityEngine;
using UnityEngine.SocialPlatforms;
using System.Collections;
public class SocialStart : MonoBehaviour {
public static bool loggedIn;
// Use this for initialization
void Start () {
Social.localUser.Authenticate(ProcessAuthentication);
}
void ProcessAuthentication(bool success)
{
if(success)
{
Debug.Log("Authenticated");
loggedIn = true;
}
else
{
Debug.Log ("Authentication failed");
loggedIn = false;
}
}
}
When I run the game on the iOS Simulator I can access the leaderboards, achievements, etc. from within the game, but when I try to run it on an actual iOS device (an iPad 2) I get the "Authentication failed" message in the Xcode debug window; thus, the Authenticate call in the Start() method is failing for some reason. However, I do not know that reason. Any help would be greatly appreciated. Thank you!
I still have no clue why this is not working. Any help would be greatly appreciated.
I tried updating my Unity installation and...no luck. I still have no clue what is going on and any help would still be greatly appreciated.
Answer by CrossRiverGames · Feb 09, 2015 at 06:00 PM
Well, it turns out that the Game Center integration was looking for a sandbox (which was exactly what I wanted it to look for) but the sandbox on my device's Game Center was turned off. Turning on the sandbox fixed the problem.
Thanks! I was having the same issue on my iOS 8.1.2 device. Enabled Sandbox in device settings and now the login window appears in game correctly.
Have you guys any idea how to access sandbox mode without that toggle since its gone with iOS 9? I have tried everything and not seen the talked about sandbox text anywhere. Not even managed to access it by accident as it seems.
Your answer
Follow this Question
Related Questions
Game Center login windows popups after hiding an app 0 Answers
Launch game center app from my ios game 0 Answers
Game Center completing achievement not working 2 Answers
ILeaderboard on iOS is not working? 0 Answers