question

bbekec avatar image
bbekec asked

GameCenter - Playfab login problem

Hello, in my game i want log player in with Game Center account. I found someresources about this.

Social.Active.localUser.Authenticate(
            (s)=> 
            {
                GameCenterUserName = Social.localUser.userName;
                GameCenterUsedID = Social.localUser.id;
            });

I use this to for authhentication to Gamecenter.

Then, i use below code to create a new account on Playfab.

#if UNITY_IOS
        LoginWithGameCenterRequest req = new LoginWithGameCenterRequest { CreateAccount = true, TitleId = GeneralManager.inst.PLAYFAB_TITLE_ID, PlayerId = GameCenterUsedID };
        
        PlayFabClientAPI.LoginWithGameCenter(req, DeviceIdLoginSuccess, PlayfabErrorScript);
#endif

It successfully creates an account but the Game Center ID always returns "1000" and the username always returns "Lerpz".

Where am i doing wrong?

Thanks

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Using Social API to login Game Center account is the feature of Unity. You can refer to the Unity documentation -- Unity - Manual: Social API (unity3d.com) for more details. For more advanced questions about Unity Social API you can navigate to Unity Forum for help.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bbekec avatar image bbekec commented ·

Thanks for your reply. So, should i use "Social-Unity" to get GameCenter id to use in Playfab API or can you suggest me a way to get GameCenter id correctly and use it in Playfab API? thanks

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang bbekec commented ·

We haven't tried to use the Unity Social API. In our previous test, Game Center Native plugin can work fine. For example, you can refer to this plugin.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.