Hi All, I've tried to implement Game Center into my game using Unity's social API because I need it to save the user's data for IAP's. I have the app in Test Flight but the user is never logged in to Game Center when they start up the app. Is the social API even the right thing to use for Game Center? I have Game Center enabled in the capabilities in Xcode when I export to the App Store and my "user login" script is on a game object that persists through all scenes. Here is my code: Code (CSharp): void Start () { Social.localUser.Authenticate (ProcessAuthentication); } void ProcessAuthentication (bool success) { if (success) { Debug.Log ("Authenticated, checking achievements"); Social.LoadAchievements (ProcessLoadedAchievements); } else Debug.Log ("Failed to authenticate"); } void ProcessLoadedAchievements (IAchievement[] achievements) { if (achievements.Length == 0) Debug.Log ("Error: no achievements found"); else Debug.Log ("Got " + achievements.Length + " achievements"); }
Still haven't found the solution. Just read that there is a separate Game Center API on another forum post (5th post down). I cant seem to find this API anywhere. Anyone know where I can get it?
The post you linked is talking about this: https://docs.unity3d.com/ScriptReference/SocialPlatforms.GameCenter.GameCenterPlatform.html You have already been using it, but just via other API. Does the authentication give you any errors? Are you 100% sure it is being called?
There are no errors besides "no achievements found" (I don't have any so that is expected) and it is also saying that it successfully authenticates the user (ill attach the console screenshot). Could my problem be with the achievements? Do you have to have at least one achievement for Game Center to work?
I don't know what that means. I was asking if it was Xcode, Unity, or a device, I guess. And did you have any luck getting this to work since your last post?
Im testing it through Apple's testing application, Test Flight, on an iPad. So I'm testing on a device. And no, no luck yet
Then I'm not sure. I never got very far with apple and unity. And after 1 try, I never had the opportunity for more testing. To answer an older question, I would guess you have to have an achievement for it to work. Hope you figure it out - sorry I couldn't be more help.
Late answer but I believe the solution is to create an achievement and maybe scoreboard within GameCenter. Don't have to be used.