Hi!
I am making additional explanations.
The code is identical for purchasing the full license for the desktop and Xbox application. But for a desktop computer, it works (both when loading an application from the store and when debugging in Visual Studio) and on Xbox the system window is not displayed in both dev and pro console modes.
The task of the code is to display a system window for purchasing a full license.
In the xbox mode, I can see the returned exception when GetStoreProductForCurrentAppAsync is called, but it is extremely uninformative (the description boils down to the fact that this is a system exception). Of course, something similar to displaying in the prod console mode can also be organized, but for this you need to put the application in the store and ..., in general, this is an extreme way of debugging. Later I will post a screenshot of the returned exception (Exception.ToString ()), now there is no console nearby.
The application was in private access (only for testers). I got the assumption that Xbox does not see the product in the store, because the application was released to the public only yesterday and it has not yet passed 24 hours to set up the product in the store. in the hope that this is the only reason why the purchase does not work.
Another suggested reason is to initialize StoreContext.GetDefault () with parameters, and named with the current user.
The code that receives the result of an attempt to purchase a license:
private void Purchase()
{
Loger(">>>>>>>>>> #0 InAppPurchaseManagerXBox.Purchases()");
CPurchaseXBox.PurchaseFullLicense((CPurchaseXBox.XBoxIAPStatus result, Exception e) =>
{
if (e != null)
{
Loger($">>>>>>>>>> #1 InAppPurchaseManagerXBox.Purchases() Exception message: \"{e.ToString()}\"");
return;
}
Loger($">>>>>>>>>> #2 InAppPurchaseManagerXBox.Purchases() result = {result}");
if (result == CPurchaseXBox.XBoxIAPStatus.AlreadyPurchased || result == CPurchaseXBox.XBoxIAPStatus.LicenseFull)
{
TryUnlockGame(true, "1");
OnPurchaseHandler?.Invoke(this, new PurchaseEventArgs(true, "Is Product Purchased"));
}
}, LicensesChanged);
}
Also, later I will attach a more detailed output of the exception.