question

stuart avatar image
stuart asked

LoginWithGoogleAccountRequest with Xamarin and where to find ServerAuthCode?

Hi,

I'm attempting to integrate Playfab into a Xamarin Android game and after getting everything working with LoginWithCustomIDRequest, I wanted to switch over to use LoginWithGoogleAccountRequest.

However... I've been unable to find where to get the ServerAuthCode parameter that's needed.

Looking at the examples, on Unity it seems you just do a simple "PlayGamesPlatform.Instance.GetServerAuthCode()" call and that's that .. but as I'm using Xamarin not Unity, then the PlayGamesPlatform API doesn't exist.

Does anyone know where I can find the Server Auth Code on Xamarin that's needed for this API or can point me towards a Playfab Xamarin sample that demonstrates how to use LoginWithGoogleAccountRequest?

Thanks!

-Stu

android
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

As our API reference -- Authentication - Login With Google Account - REST API (PlayFab Client) | Microsoft Docs said, the server auth code needs to be requested by calling Google API method getServerAuthCode(). You can refer to the example code of Google document -- Enabling Server-Side Access | Google Sign-In for Android to get the server auth code for your Xamarin project.

10 |1200

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

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.