I used the code above to look information from SubscriptionManager class.
After 5 minutes passed since last purchased,
isSubscribed became false from true.
isAutoReneweing became false from true.
isExpired became true after false.
The problem is subscription item became null after 5 minutes passed.
And SubscriptionManager unable to execute getSubscriptionInfo() method after receipt became null
Question is why the subscribed item wasn’t renewed after 5 minutes passed?
Shouldn’t it get renew up to 6 times according to apple documentation?
Please help me…
Yes, that was my suggestion. You will get the trigger when IAP is initialized, there is no callback during a running game, if that is what you are asking. So if a subscription was renewed at midnight on the Play Store, the next time the user launches your app in the morning, they would receive this.
I mean how? in initialized I only check if has hasReceipt, and that only for checking if subsciption still active… my goal is to give a reward monthly for subscribe users… so I want to get maybe at least date to compare… or a trigger… im okay with during open of the app initialized
Are you not receiving a ProcessPurchase callback when the subscription renews? How are you tracking your purchases on the device, are you saving to a local binary file, or to PlayerPrefs by chance? Another solution, if their subscription is active, just start tracking one month from their initial purchase (save the purchase date locally)
right now I’m just using this 3 code for checking
Debug.Log(m_StoreController.products.WithID(kProductIDSubscription).hasReceipt + " hasReceipt");
Debug.Log(m_StoreController.products.WithID(kProductIDSubscription).receipt + " receipt");
Debug.Log(m_StoreController.products.WithID(kProductIDSubscription).availableToPurchase + " availableToPurchase");
but not sure where to get when the subcription renews
what do you mean?
Are you not receiving a ProcessPurchase callback when the subscription renews?
yes I’m getting ProcessPurchase callback, but I’m dont know where to get the remaining time before renewal happens
How are you tracking your purchases on the device
I’m using monitor in adb and srdebugger asset if not adb
are you saving to a local binary file, or to PlayerPrefs by chance?
no I’m not saving yet, but planing if no choice… but I wanna make it online or updated as possible to aviod cheating for smart users
Hi jeff, I was getting now purchase date and remaining time, but now it seems the time was not the same base of my location… like this , got
purchaseDate 08/30/2019 01:52:51
and date for the next billing 09/06/2019 01:52:51…
is it possible to used online time? base in what is given? like I want it check everytime the user opens the app…
next billing 09/06/2019 01:52:51 - time when user opens the app, is it right? and what time should I get? base from user
By tracking your purchases, I meant, how are you persisting the purchase on the user device. Also, you can use server side validation if you choose, in addition to local receipt validation, and save purchases to the cloud. This is what many large studios use.
Hi Jeff,
I came across this thread while I was checking an answer for something else.
I wasn’t aware till now that on auto-renewal of a subscription, ProcessPurchase callback is called when we call Unity purchasing.initialize(). Now as per this thread and some other threads that I checked, ProcessPurchase should be automatically called.
To test this, I tried checking my logs to see if this was happening in my game as well. I bought a subscription, waited for 5 min, verified that the subscription was renewed by checking in the Play store, and then again opened my game. But while I could see that initialisation was successful, ProcessPurchase didn’t get called.
Should I call some method after initialisation, in OnInitialized method, such as store controller.InitiatePurchase()?
Is my understanding of the flow correct?
I was mistaken, ProcessPurchase is not expected upon subscription renewal. You’ll want to check the receipt for subscription status. If no receipt, then no subscription.