I am using the codeless IAP for a simple app. It has a subscription purchase. This works and I am very happy with it. My question is how does it handle subscriptions that have either expired or cancelled? Thanks
Codeless support for subscriptions is limited, there currently isn't a way to get this information. You would need to use scripted IAP
Thanks for the reply, ive used the scripted IAP in the past but would prefer to use the codeless iap if possible. So what would happen in the following situations: If they have subscribed and cancelled during a trial, i would expect it to return FALSE. If they have subscribed but cancelled, id expect it to return TRUE until the expiration date and then return FALSE. Also on a side not, is the SubscriptionManager partially populated via the codeless iap?
What are you expecting to be TRUE or FALSE? To use SubscriptionManager, you would need to use Scripted IAP.
Sorry not true or false, but the IAP Listener would call the On Purchase Complete method if the subscription is valid and not call it if it is not valid. So if the user subscribes and later cancels, does the IAPListener continue to OnPurchaseComplete until the expiration date? If the the user subscribes and cancels during the trial, does the IAPListener still call the OnPurchaseComplete? I would expect it not to.
The IAP Listener only triggers on the initial purchase and subsequent Restore operations. But not on each game start.
thanks @JeffDUnity3D . I know you always recommend the coded api but do you know if there are any plans to improve the CodlessIAP system. It seems to do almost everything that is needed apart from validation. Thanks.
Yes, I brought this very topic up with the engineering team today! It will take some time though, perhaps even a few months as we might want to make overall improvements.
Hi @aholla. We have a sort of workaround within our test project, where we use Codeless IAP, but you'll need to add some code yourself into another class. You can check for a valid receipt for a given subscription First, you can get the list of products from Codeless IAP: Code (CSharp): var products = CodelessIAPStoreListener.Instance?.StoreController?.products; Then get your product: Code (CSharp): var product = products.WithID(productId); Then use the SubscriptionManager to check its status Code (CSharp): var subscriptionManager = new SubscriptionManager(product, null); var isSubscribed = subscriptionManager.getSubscriptionInfo()?.isSubscribed(); You can then do what you want with isSubscribed.
Be sure to track your changes if you update the codeless files as suggested or they will be overwritten during an upgrade. Source control is best for this.
Hmmm... great point Jeff, I will need to look into a workaround for pending purchases and receipt validation without modifying our API directly. There may be a solution, but maybe not.
"Be sure to track your changes if you update the codeless files as suggested or they will be overwritten during an upgrade. Source control is best for this." - or you can actually make the methods virtual and protected (in IAPButton, IAPListener etc.) so we can add implementation properly (by inheriting and thus not overwrite). I thought I could save some time by using Codeless IAP but I regret deeply that I added this to our project.
I am also interested in using the codeless api. Would these improvements consist of: Implementation into UIToolkit. Receipt validation on startup so I can check if the IAP item was purchsed? Thanks!
No specific integration into UIToolKit. And yes, we are looking into receipt validation for Codeless as a high priority improvement, but likely not until early next year.
@JeffDUnity3D Thanks for looking into that and thanks @John_Corbett for your suggestion, this was actually something I was thinking about doing, I was just a little scared of the "dont mix the codeless with the coded api" posts Thanks for all of your work on this, its really great and I will look forward to hearing about future developments.
To be clear, the other posts about not "mixing" was due to incorrect coding. People were placing a ProcessPurchase callback as their "successful purchase" method in Codeless which is incorrect. The documentation correctly uses a method you write would yourself like "GrantCredits"
So just one more question... I remember from my logs that my app retrieves the purchase history when it loads. My question is, is this invoked via the IAPListener or doesn't just happen. What I'm wondering, is if I can use the IAPListener to retrieve the products the user has purchased when the open the app. OR does this only get called when the products are initially purchased? Perhaps this is not necessary... I would like to do something like @John_Corbett suggested when the app has loaded, I could then check the subscription state and enable the relevant content in the app. ALSO, is there a way to know that the codelessIAPListerner singleton has received data so I can check the status? Thanks.
Any update on this Cant find anything. no tutorials on how to do subscriptions, Nothing on the internet on how to valadate and see if subscriptions are active. (using Codeless for subscriptions) its now 2022... Purchases work but nothing In any tutorials online on how to chekc subsriptions, in fact, THEIR ARE NO SUBCRIPTION TUTORIALS on the internet I look every month. the only thing you can do Is have a single pursuance and a in-game timer and save the timestamp and when it hits +20 days reset premium to 0, then make them make a single purchase again, (Manually rather then having it automatic) why even have subscriptions on their if you can't even use it? just be nice if users could buy it and set it and forget it rather then every month the game says "Your subscription has expired" and have a buy again button in the game. that's the only work around I could find. (And yes, we are looking into receipt validation for Codeless as a high priority improvement, but likely not until early next year. ITS 2022. AND NO TUTORIALS ON SUBSCRIPTIONS, ITS ALL SINGLE PURCHASES WITH CODLESS WHY HAVE THE OPTION FOR SUBSCRIPOTIONS IF THEIRS NO WAY TO CHECK IT WITH CODELESS?) Devs posting random lines of code saying "Heres a fix" without a complete script to show you how it works. Like It works to buy the subscriptions, but if it dosn't Automaticly check for you whats the point its not really codless? you cna just buy a subcription, then cancel it and always have the subscribed content, , Thats called a feature that dosn't work.
@zak666 Correct, don't use Codeless at this time. Due to resource limitations, we haven't had a chance to update Codeless with the latest updates of the store APIs. Instead use Scripted IAP, you are welcome to start with this Sample IAP Project, all the code is written for you https://forum.unity.com/threads/sample-iap-project.529555/#post-6950270