Sign In Register

How can we help you today?

Start a new topic
Answered

Game Center Integration

I'm having trouble integrating game center with my game. Im new to unity and there are no tutorials on that topic. Please help out if you can...


Best Answer

 Hey Jerry.

We are about to release a new addition to the SDK which will allow you to use GameCenter out of the box. It should be released in a few weeks.
In the mean-time, you can get a sample of the SDK contents here attached...

You should check out the GameCenterUI scene and script to see the calls.
They are different from the rest of the GameSparks calls as they require you to auth with GameCenter using the Unity Social API and then call a different class called GameSparksUtils.
This is because this request requires some values that you cannot get from Unity and must be taken from the native OS.

Please let us know if you have any problems.

Thanks,
Sean

zip

For anyone else trying to implement GameCenter with GameSparks, I have attached the solution based the previously provided code by GameSparks.

 

To use it, just do the following :

 

GameCenterManager.Initialize();
Social.localUser.Authenticate((success, result) =>
{
	if (success)
	{
		GameCenterManager.Instance.GetGameCenterDetails(gcResult =>
		{
			if(gcResult != null)				
				new GameCenterConnectRequest()
					.SetPublicKeyUrl(gcResult.GetString("publicKeyUrl"));
					.SetTimestamp(gcResult.GetLong("timestamp").Value);
					.SetSignature(gcResult.GetString("signature"));
					.SetSalt(gcResult.GetString("salt"));
					.SetDisplayName(gcResult.GetString("displayName"));
					.SetExternalPlayerId(gcResult.GetString("externalPlayerId"));
					.Send(response => {});
			}
		});
	}
});

 

zip
(2.06 KB)

1 person likes this

Hi,


What's the curret status of this? Is there some sample code for calling GameCenterConnectRequest with the current SDK?


1 person likes this
Answer

 Hey Jerry.

We are about to release a new addition to the SDK which will allow you to use GameCenter out of the box. It should be released in a few weeks.
In the mean-time, you can get a sample of the SDK contents here attached...

You should check out the GameCenterUI scene and script to see the calls.
They are different from the rest of the GameSparks calls as they require you to auth with GameCenter using the Unity Social API and then call a different class called GameSparksUtils.
This is because this request requires some values that you cannot get from Unity and must be taken from the native OS.

Please let us know if you have any problems.

Thanks,
Sean

zip

Has there been any ideas on how to logo in to gamecenter?

Hello,

what is the Status of the SDK integration?

Login to post a comment