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!

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.