to_the_cosmic_end
2 months agoProtege
[IAP] Each Purchase object has its "Type" property set to Unknown for subscriptions.
Full Disclosure: I am testing subscriptions in draft mode and with test user account.
IAP.GetViewerPurchases().OnComplete(msg =>
{
if (msg.IsError)
{
return;
}
if (msg.GetPurchaseList().Count == 0)
{
return;
}
foreach (Purchase item in msg.GetPurchaseList())
{
Debug.LogFormat("Purchased: sku:{0} granttime:{1} id:{2} expire:{3} type:{4}", item.Sku, item.GrantTime, item.ID, item.ExpirationTime, item.Type); // All values are available properly except for item.Type prints "unknown" in console.
}
});However, this API does return any unconsumed items properly with type set to "CONSUMABLE" but for subscription its not working.
So my question is, if this is happening due to subscription being in draft mode? and if I can depend on this property in production app to check if items in loop is any unconsumed product or just a subscription ?