I get a list of Game Center user IDs using LoadScores, but unfortunately these only contain user IDs (“G:” followed by a string of digits). Now, previously we have used Social.LoadUsers on a string array of these IDs to retrieve user names, but I am seeing a consistent crash every time I do anything to access LoadUsers, e.g.:
List<string> userIDs = new List<string>();
foreach ((string, int) leader in allTimeTreasureLeaders)
{
userIDs.Add(leader.Item1);
}
string[] userIDArray = userIDs.ToArray();
Social.LoadUsers(userIDArray, users =>
{
foreach (IUserProfile user in users)
{
Debug.Log(user.userName);
}
});
What is strange is I can see the print out of the names here, but then I get an EXC_BAD_ACCESS anyway. Note that I’m not doing anything with these user names as the moment–it seems to just be the call to LoadUsers that causes the crash.
A couple of other comments to elaborate: this is in a static class, and allTimeTreasureLeaders is a List<(string, int)> that is populated in this class separately by a call to LoadScores. At the moment it contains 3 entries (our team).
Does anyone see an issue with what I’m doing or had this issue before?