- Home /
Codeless IAP - no google restore, no already owned message
I am trying to test codeless IAP for android. Purchased OK first time through, but after reinstall there is no restore and when I click the IAPButton again there is no call of ProcessPurchase or OnPurchaseFailed so there is no feedback to the user and no restore.
Initial logcat on start up after reinstall:
01-27 17:55:19.946: I/UnityIAP(15909): Package name: uk.softsid.spaceguard
01-27 17:55:19.946: I/UnityIAP(15909): Calling getPurchases with continuation token: null
01-27 17:55:19.949: I/UnityIAP(15909): Owned items response: 0
01-27 17:55:19.949: I/UnityIAP(15909): Continuation token: null
01-27 17:55:19.949: I/UnityIAP(15909): Querying SKU details.
01-27 17:55:19.975: I/UnityIAP(15909): onQueryInventoryFinished: true
01-27 17:55:19.975: I/UnityIAP(15909): Inventory refresh successful. (response: 0:OK)
01-27 17:55:20.346: I/Unity(15909): Already recorded transaction amjifclfpflmbkjllndncjko.AO-J1Ox84o-3dy2PONahrQvPC35OqZuvNUy0GeHQCAqBAHoxW6WDGFytKQEeg0R_qHbzCzoAcBgayW93Ez4oQVpRbZwiilXeh0SD-xmen1BINgD22NlC8wnaLm5080Be55lz8RZzh1dg
01-27 17:55:20.346: I/Unity(15909):
01-27 17:55:20.346: I/Unity(15909): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
01-27 17:55:20.349: I/UnityIAP(15909): Finish transaction:amjifclfpflmbkjllndncjko.AO-J1Ox84o-3dy2PONahrQvPC35OqZuvNUy0GeHQCAqBAHoxW6WDGFytKQEeg0R_qHbzCzoAcBgayW93Ez4oQVpRbZwiilXeh0SD-xmen1BINgD22NlC8wnaLm5080Be55lz8RZzh1dg
Logcat after click IAPButton
01-27 17:41:45.514: I/Unity(14217): IAPButton.PurchaseProduct() with product ID: shuttle_boost
01-27 17:41:45.514: I/Unity(14217):
01-27 17:41:45.514: I/Unity(14217): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
01-27 17:41:45.530: I/UnityIAP(14217): isUnityVrEnabled = false
01-27 17:41:45.535: I/UnityIAP(14217): onPurchaseProduct: shuttle_boost
01-27 17:41:45.535: I/UnityIAP(14217): ITEM TYPE:inapp
01-27 17:41:45.611: I/Unity(14217): purchase({0}): shuttle_boost
01-27 17:41:45.611: I/Unity(14217):
01-27 17:41:45.611: I/Unity(14217): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
01-27 17:41:45.862: I/Unity Purchasing(14217): Creating purchase activity
01-27 17:41:45.863: I/UnityIAP(14217): invoking callback
01-27 17:41:45.863: I/UnityIAP(14217): Constructing buy intent for shuttle_boost, item type: inapp
01-27 17:41:46.679: I/UnityIAP(14217): onIabPurchaseFinished: true
01-27 17:41:46.679: I/UnityIAP(14217): Unable to buy item (response: 7:Item Already Owned)
01-27 17:41:46.679: I/UnityIAP(14217): Product purchased successfully!
01-27 17:41:46.680: I/UnityIAP(14217): NotifyUnityOfPurchase
01-27 17:41:46.734: I/UnityIAP(14217): onActivityResult
01-27 17:41:47.017: I/Unity(14217): Already recorded transaction amjifclfpflmbkjllndncjko.AO-J1Ox84o-3dy2PONahrQvPC35OqZuvNUy0GeHQCAqBAHoxW6WDGFytKQEeg0R_qHbzCzoAcBgayW93Ez4oQVpRbZwiilXeh0SD-xmen1BINgD22NlC8wnaLm5080Be55lz8RZzh1dg
01-27 17:41:47.017: I/Unity(14217):
01-27 17:41:47.017: I/Unity(14217): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
01-27 17:41:47.024: I/UnityIAP(14217): Finish transaction:amjifclfpflmbkjllndncjko.AO-J1Ox84o-3dy2PONahrQvPC35OqZuvNUy0GeHQCAqBAHoxW6WDGFytKQEeg0R_qHbzCzoAcBgayW93Ez4oQVpRbZwiilXeh0SD-xmen1BINgD22NlC8wnaLm5080Be55lz8RZzh1dg
There is 'Unable to buy item' and 'Product purchased successfully'
What is happening, what can I do to fix?
Did you ever get an answer to this? I'm curious as to it myself.
No - no answer. I did put my findings and problems in forum comments (https://forum.unity3d.com/threads/announcement-codeless-iap-for-unity-iap.443277/) but in the end just published my app with clunky work arounds. No comment from unity if course but there have been a few upgrades to IAP that I have not tried yet. Best of luck
Answer by Kurius · Jun 23, 2017 at 07:21 PM
Here's one solution... https://forum.unity3d.com/threads/restore-transactions-via-codeless-iap.479251/
Hi, I would like to try your solution. How do I identify each product to restore in the call of OnPurchaseComplete code?
@JustJuniorDesignDevelop can you please upvote my original reply? Ok so to answer your current question... your custom script that you need to attach to OnPurchaseComplete should contain a function... public PurchaseProcessingResult ProcessPurchase (PurchaseEventArgs e){}
That function will be called automatically for each product that needs to be restored. You can identify the product from the PurchaseEventArgs e by reading e.purchasedProduct.definition.id