From log, the Sku is wrong. from the log is “Coin2”, it should be my sku "
g7_cpbr012104001.coins500.499
"
So the OnPurchaseFailed(PurchaseFailureDescription description) cannot find the product?
Like fix it with
var product = products.WithStoreSpecificID(description.productId)??products.WithID(description.productId);
```?
Please post only one topic per forum thread, you’ve mentioned two. VPN is not related to productIDs. If you have no network connection, it would be expected that you do not receive any callbacks. Separately, test without using store specific IDs.
It’s same thing, I trace the code, and find out the productID of PurchaseFailureDescription
public void OnPurchaseFailed(PurchaseFailureDescription description)
``` is changed, it should be store specific ID, but it is the ID I put in the "IAP Catalog"
It only happen after IAP is initialized, then I turn off the network.
The above code is from IAP package "PurchasingManager".
I’ve tested and it’s working for me. So everything works for you when you don’t use the store specific ID? Please answer all my questions before skipping to new ones. What do you mean by “reset”?
I don’t use the store specific ID.
I need to change the code “Library/PackageCache/com.unity.purchasing@3.2.1/Runtime/Stores/Android/GooglePlay/AAR/GooglePurchaseService.cs” to solve this bug.
If I restart Unity, all the code under “Library/PackageCache/com.unity.purchasing@3.2.1” revert. That what I mean “reset”.
Are you using codeless? If not, can you share your IAP initialization method?
When no store-specific id is specified for a product, IAP will use its product id as the product’s store-specific id.
Hi,
My IAP initialization method is same as codeless.
If “IAP will use its product id as the product’s store-specific id”, OnPurchaseFailed of “Library/PackageCache/com.unity.purchasing@3.2.1/Runtime/Purchasing/PurchasingManager.cs” should change with ```
products.WithStoreSpecificID(description.productId)??products.WithID(description.productId);
You are mixing Codeless and Scripting, unfortunately a common mistake. You are duplicating the IAP callbacks. Please compare to the Sample IAP Project v2 https://discussions.unity.com/t/700293/3
I suspect that you are adding empty store-specific ids.
Try changing line 37 in Hantu_IAPConfigurationHelper.cs
from
builder.AddProduct(product.id, product.type, ids);
to
builder.AddProduct(product.id, product.type);
If this solves your issue, a more permanent solution would be to specify your store-specific ids to be the same as your product id in your catalog for all your stores.
And as Jeff said, if this doesn’t work, try adding your products manually instead of using the codeless catalog.
Can I ask a question?
Why GooglePurchaseService.cs pass a Non store-specific id to PurchasingManager.cs, who only handle store-specific id?
I turn off my network after Unity IAP initialized(maybe a bad network), so Unity IAP cant query any sku.