I’ve built a relatively simple app in Unity that allows users to purchase audio tracks.
After uploading to the play store, via the google play console, I tested a few purchases.
I then refunded the purchases so I could retest after a few tweaks.
(The purchases are free with internal testing, but still able to be “refunded”)
Now I can’t interact with any of the app.
None of the buttons work.
It’s as though google has blocked access to all of the apps features, including new features, because I processed a refund.
Does anyone know how to completely reset the app so I can keep testing ?
Trouble shooting so far-
Create a new app with the same code, but a different Version - Didn’t work. Google seems to know it’s the same app and won’t let me use it.
Create a new very simple test app from scratch - This worked, but there’s a chance one day I will refund a real users purchases, so I need to know how to properly fix the issue.
How are you debugging? Please show the result of your debugging efforts, either breakpoint debugging with Visual Studio, or at a minimum, with Debug.Log statements. Please share your logcat logs, and attach your purchasing code. I would recommend to not use Codeless but Scripted IAP instead. This may help https://discussions.unity.com/t/699654 and https://discussions.unity.com/t/748729/14 and start (and publish, with no changes!) with the Sample IAP Project v2 https://discussions.unity.com/t/700293/3 . Also, IAP 4.0.0 ships with some GREAT samples!
Can you link a tutorial that explains how and why ?
I don’t understand the point of publishing an existing project.
How does this help me to understand implementing IAP in my project.
And I’m not sure how to use the samples. They look interesting…but what am I supposed to do with them ?
Did you view the video with the Sample IAP Project? Please publish v2 live and get it working and apply lessons learned to your own game! You’ll want to link to your own ProjectID in the Service window, and perhaps use your own product names instead of “gold50” and “noads”. But get the basics working first. This way, your game is never “broken”. You will learn the proper implementation of IAP along the way.
Yes. Watched the video.
It explains how to download and open the project and activate IAP - I’ve done those things.
At the end of the video there’s a teaser about the next video that will show how to use the project…but as far as I can tell…he never made the next video.
Is there a follow up video explaining use of the samples ?
I would like to learn:
How does my app know that a non-comsumable has been purchased on Google ?
I’ve been using playerprefs to save purchase data, but if I create a new release on the google play console and upload a new app bundle, the playerprefs resets so the saved data is gone.
Is there a way to communicate with google when my app loads ?
Something like this:
Start > product id purchased on google > product is now available in app.
I’ve run into an error with the sample:
Assets\Scripts\MyIAPManager.cs(140,28): error CS1061: ‘IGooglePlayStoreExtensions’ does not contain a definition for ‘SetDeferredPurchaseListener’ and no accessible extension method ‘SetDeferredPurchaseListener’ accepting a first argument of type ‘IGooglePlayStoreExtensions’ could be found (are you missing a using directive or an assembly reference?)
Can you explain how to fix it ? (In terms an absolute beginner would understand)
I can’t build the app bundle and upload to google play console with this error in the way.
Please see the Sample code that ships with IAP 4.x, it has a working example of this code.
PlayerPrefs is one way. You can also save purchases in the cloud with services such as PlayFab and ChilliConnect. You can also inspect the receipt. Do you have the Sample IAP project working? That would be your first step.
Are you saying I should find the working code and substitute it into the C# Script MyIAPManager ?
IAP 4.0.3 has the following samples: Buying Consumables, Buying Subscription, Fetching Additional Products, Integrating Self-Provided Backend Receipt Validation, Local Receipt Validation and several for App Store and Google.
Is one of these is the “working example” you’re referring to ?
Which one should I substiture for MyIAPManager ?
No, I don’t have the Sample IAP working ? Becuase I’m still stuck on this error: Assets\Scripts\MyIAPManager.cs(140,28): error CS1061: ‘IGooglePlayStoreExtensions’ does not contain a definition for ‘SetDeferredPurchaseListener’ and no accessible extension method ‘SetDeferredPurchaseListener’ accepting a first argument of type ‘IGooglePlayStoreExtensions’ could be found (are you missing a using directive or an assembly reference?)
This is the last comment from the samples post:
"Here is v2 of the Sample IAP Project. This project includes receipt validation and subscription support, as well as a deferred purchase listener. It is using IAP 3.0.1. To use the validator, you’ll need to generate your own tangle files from menu Window/Unity IAP/Receipt Validation Obfuscator. For use with IAP 4.x, see this post https://forum.unity.com/threads/iap…-but-doesnt-give-payout.1148126/#post-7382948
Which part of that is a solution ?
What’s a validator ?
What are tangle files ?
I followed the instructions in the Receipt Validation Obfuscator, but I don’t know what happened or why I was doing it and it didn’t remove the error message.
I followed the link in this comment and it leads to this instruction:
In the 4.0.3 samples, none of them are called deferred listener sample. What are you referring to here ?
I had a read of those instructions and they’re pretty basic. There is no reference to ProcessPurchase trigger.
I think this the sort of thing I need to understand.
Hopefully if you can help me get the sample working and understand the purpose of the samples I can begin learning how to fix the original problems.
I might recommend that you simply comment out the line in the Sample that is causing the exception and get the project working for now without the deferred listener, perhaps add it later when the code makes more sense to you. You can read more about receipt validation here: https://docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html
I think I’ve worked it out.
It was related to restore purchases not working properly becuase of my setup in Unity.
Double checked code, IAP etc etc and it works.
Thanks @JeffDUnity3D