GDK icon indicating copy to clipboard operation
GDK copied to clipboard

XStoreGetUserPurchaseIdAsync not working

Open rdhasse opened this issue 1 year ago • 1 comments

I've checked all the documentation and samples I could find and cannot figure out why XStoreGetUserPurchaseIdAsync is not returning the signed in user. It is only returning HRESULT = -2143330041 (0x8007139F).

I've initialized the XStoreContext and retrieved a valid access token for my app. I'm basically calling this function consistently with what I've found in code samples.

A couple things I'm not sure about:

  1. Is the publisherUserID parameter required? If so, what should it be set to?
  2. Are there some permissions required in order for this API call to work?

Any help/suggestions would be appreciated.

rdhasse avatar Dec 18 '24 20:12 rdhasse

I apologize for the delay, this was only brought to my attention recently as our official developer forums for the GDK are on https://forums.xboxlive.com. For future reference that is the correct place to post questions so that we are notified and can respond to them.

To answer your questions:

  1. No, it is not required, it can be whatever you want it to be. This value will get stamped into the UserPurchaseID / UserCollectionsID that you are trying to generate with the API. So that if you needed to remember who that was associated to, you could look at the claims and see it. Usually, partners use whatever userID they are using for that same user in their own back-end.

  2. You need to make sure that for your registered Entra App in the Azure Portal, you have the following configured under Manage -> Authentication:

  • Access Tokens and ID Tokens enabled
  • Account type must include 'Personal Microsoft accounts (eg. Skype, Xbox)'

Side note, these API's are generating and doing the same function as the older UWP Windows Store API's just with a different name (CustomerPurchaseID vs UserPurchaseID).

CameronGoodwin avatar May 05 '25 20:05 CameronGoodwin