When I trying to make a purchase in android, it fails with a message that it is “ItemAlreadyOwned”.
onPurchaseFailedEvent(productId:{productId} message: - Google BillingResponseCode = ItemAlreadyOwned)
UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)
UnityEngine.Purchasing.Extension.UnityUtil:Update()
But when I receive a receipt when UnityPurchasing.Initialize, it says there is none reciept.
int GetHaveRecieptCount()
{
Product[] prds = storeController.products.all;
int hasReceiptCnt = 0;
for (int i = 0; i < prds.Length; i++)
{ if (prds[i].hasReceipt && !string.IsNullOrEmpty(prds[i].receipt))
hasReceiptCnt++;
}
return hasReceiptCnt;
}
I call this function after OnInitialized, it return 0.
However, if I disable the Play Store app and then enable it, you will successfully receive a receipt during initialization.
Can I get a receipt without reactivating the play store app?