question

tomaszwozniakmosina avatar image
tomaszwozniakmosina asked

Playfab and Xbox integration in Unity game

Hi, I have question about Playfab and Xbox integration. There are different answers on the web. What do I need to do to make Unity game works on Xbox. I have working version (dev) on PC, changed to UWP (Xbox), and have login error. Are there special prerequisities for Playfab to work on Xbox?

unity3d
10 |1200

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

franklinchen avatar image
franklinchen answered

Hi @tomaszwozniakmosina,

I'm the author of that Github repo.

XDP does not mean Xbox Device Portal, it is a private dev site for managed Xbox game partners. For now, the Partner Center(https://partner.microsoft.com/dashboard) is the new site, if you are an Xbox game developer, please choose an Xbox Live developer program.

please check the official docs for Xbox Live and publishing: https://docs.microsoft.com/en-us/gaming/xbox-live/

8 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.

franklinchen avatar image franklinchen commented ·

For "Error unknown, Service unavailable", I believe you have not create game title in Partner center and associate it with your local Unity+UWP project.

0 Likes 0 ·
tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

Thank you all very much for all the answers. So, if I have working game with Playfab authentication for Windows, there should be no changes in code needed for Xbox?

And last question - I want just to test if my application will run on Xbox (with authentication) - do I need to process Submission step? Currently I deploy game on Xbox as UWP project.

0 Likes 0 ·
franklinchen avatar image franklinchen tomaszwozniakmosina commented ·

For question: So, if I have working game with Playfab authentication for Windows, there should be no changes in code needed for Xbox? Answer: We need to call Xbox Live GetTokenAndSignature API to get token and pass it to LoginWithXbox API

For question: I want just to test if my application will run on Xbox (with authentication) - do I need to process Submission step? Answer: If you don't create a Game app in partner center, you can't enable test sandbox and associate the real store info to your local UWP Xbox project. The result will be that your app can't log in via Xbox Live both on windows and xbox console.

0 Likes 0 ·
tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

Thank you very much! Thanks your advices I'm going forward.

However in Unity editor I'm receiving empty Token (with FakeUser) and on Xbox device there is error when trying login with Player Authentication prefab.

0 Likes 0 ·
tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

I have another problem - when try to login on Xbox device with email from Microsoft account (the same account where Xbox device is activated as dev device), I receive message:

Use an account with access to this sandbox Either the account or title cant use this sandbox. Change the sandbox in Settings > COnsole > Developer settings or use a different account

I checked sandbox id and other ids and they seems to be correct.

Thanks in advance for any hints to solve that issue.

0 Likes 0 ·
franklinchen avatar image franklinchen tomaszwozniakmosina commented ·

If you have joined Xbox Creators program, please see Authorize Xbox Live accounts for testing the game

0 Likes 0 ·
tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

When trying to set up a test account (at: https://partner.microsoft.com/en-us/xboxconfig/testaccounts/index), despite the correctly filled fields, I receive the message: I can't create tester accounts.

It is possible that this is the reason that I cannot log in using the email address (account) on the Xbox device (and in the Xbox application on the PC) in development mode (sandbox id is correct).

When I try to sign in to Xbox, I get the message: Use an account with access to this sanbox

On Xbox in the "Test accounts-> Add existing" window, when I try to add my account, I receive a message An unknwon error has occured. Error code: 8015DC12

When I try to sign in to the Xbox application, I get the message: We couldn't sign you in to Xbox Live Your account doesn't match your dev environment...

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan tomaszwozniakmosina commented ·

Hi,

Looks like you posted a thread in here: Sandbox issue for Xbox device in development mode

Also, we suggest you contact the support team in Partner Center directly, you would get a better help from them.

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

Hi @tomaszwozniakmosina,

What are the error details of the login error? Looks like there are some authentication issues during login, for PlayFab authentication on Xbox, you’ll need to authorize PlayFab via your game’s settings on XDP(Xbox Developer Portal).

Here are some PlayFab projects related to Xbox you might find helpful:

https://github.com/Myfreedom614/PlayFab-Authentication-via-Xbox-Live-Sample

https://github.com/PlayFab/PlayFab-Samples/tree/master/Samples/Xbox

5 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.

tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

Thank you for answer.

"authorize PlayFab via your game’s settings on XDP(Xbox Developer Portal)" - you mean Xbox Device Portal - that one where I can manage applications on Xbox device? Is it something to enable with checkbox or should it be done from code?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan tomaszwozniakmosina commented ·

OK, just confirmed with the team, Xbox now authorizes PlayFab automatically by calling Xbox Live GetTokenAndSignature API:

GetTokenAndSignature("POST", "https://playfabapi.com/ ", "")

Please follow the repro steps in this sample:

https://github.com/Myfreedom614/PlayFab-Authentication-via-Xbox-Live-Sample

0 Likes 0 ·
tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

Error details are null, but message is "Error unknown, Service unavailable"

0 Likes 0 ·
tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

Error details are null, but message is "Error unknown, Service unavailable"

0 Likes 0 ·
tomaszwozniakmosina avatar image tomaszwozniakmosina commented ·

Thank you for answer.

"authorize PlayFab via your game’s settings on XDP(Xbox Developer Portal)" - you mean Xbox Device Portal - that one where I can manage applications on Xbox device? Is it something to enable with checkbox or should it be done from code?

0 Likes 0 ·
tomaszwozniakmosina avatar image
tomaszwozniakmosina answered

Thank you All for help.

Your advices helped me to solve login issues.

I would just to add something- maybe it will help somebody in future.

I cannot login with my account which is main Xbox dev account. I had to add from Xbox device portal second test account and on the Xbox I need to login first with test account, and then with main account.

Weird but works :)

Another new issue is that:

I can run installed app within VS2019, but when I launch app from Xbox device directly it crashes after start with error:

0x80000003

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.