iOS Question Auto-Renewing Subscriptions

tufanv

Expert
Licensed User
Longtime User
Hello

iOS was previosuly just accepting newspapers and magazines for auto renewing subs. They sent an email that every category is now allowed for auto renewing subs.

I was normally using non-renewing with a membership system. When users purchase 1 week subscription i was modfying their user accounts valid date to +1 week.

on ios website , for autorenewing subscriptions , it says that everything is managed (restore, or start end dates ) by ios.

My question is : How can i check if user has an active auto renewing subscriptions with each app launch ? Is purchase completed fired with each launch ? or what ?

TY
 

tufanv

Expert
Licensed User
Longtime User
Currently the only way to find the current purchases is with RestoreTransactions (without storing it yourself). However you are not expected to use it for this as the user might be asked to log in to his account.
So we are not able to use it for now right ? Can it be implemented in the near future ? As yo say , restoretransactions requires login each time.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Did you find any Objective C or Swift documentation about this new feature?
No. But this is not a totally new feature. We are just now allowed to use it as you know. Important part is if everything is managed automaticly, there must be a way like android subscriptions like : as long as the subscriptions are allow , they exist in the inventory. But unfortunately as you said also , in ios it requires login to restore transactions everytime.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I am still having problem implementing autorenewable subscriptions. There are 2 pages about validating if users has an active subscription (auto renewing )

https://developer.apple.com/library...y.html#//apple_ref/doc/uid/TP40010573-CH1-SW5
https://developer.apple.com/library...html#//apple_ref/doc/uid/TP40010573-CH106-SW1

but i don't know how to check with every launch of app a receipt , as Erel said I can't use restoretransactions every time , it will ask for a user login , I am lost at this issue.

For the first purchase , it is ok i can store the ending date to my server but when the subscription is renewed , i think there is a new transaction id so i have to check that instead of the original one etc.. Very confusing.
 
Last edited:
Upvote 0

tufanv

Expert
Licensed User
Longtime User
for example , simple response from a script validation with ios gives :

B4X:
Response from server: {"receipt":{"original_purchase_date_pst":"2017-02-02 00:27:19 America\/Los_Angeles","purchase_date_ms":"1486024039175","unique_identifier":"c5ba6811d92f969b009538361f992aba4c4a1051","original_transaction_id":"1000000270181110","bvrs":"1.2.5","transaction_id":"1000000270181110","quantity":"1","unique_vendor_identifier":"5CD72583-5174-4D81-A81F-F15DBBB27BB0","item_id":"1171025521","product_id":"50at","purchase_date":"2017-02-02 08:27:19 Etc\/GMT","original_purchase_date":"2017-02-02 08:27:19 Etc\/GMT","purchase_date_pst":"2017-02-02 00:27:19 America\/Los_Angeles","bid":"com.ctmobilesoft.bmi445533","original_purchase_date_ms":"1486024039175"},"status":0}

if i save the transactionidentifier for every user, and check that identifier with receiptvalidation at every run , what happens when the subscription is auto renewed ? this transaction id will change according to my guess so i will have to edit the users transationidentifier column in my db to new one to continue cheking it. But how will i get the new identifier when the subscription is renewed ?

If the transaciton identifier werent changing and updating its date to renewed ones it would be easy , but if it is changing how can we figure that ?

according to here : http://stackoverflow.com/questions/...-a-renewal-for-an-auto-renewable-subscription

always the initial trans. idnetifier is sent to server and if the subscription is still active it has latest_receipt_info if not it has latest_expired_receipt_info

so can we trust on this and check the initial identifier always and look for the latest_receipt_info or latest_expired_receipt_info ?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
also there is a quote supporting this:

You don't need to call restoreCompletedTransactions to check the status of a subscription if you're storing previous receipts (preferable on your server). Just take any subscription receipt you've stored for that user and submit it to the App Store for verification. They'll respond with the latest_receipt_info including the expires_date which you can use to determine current subscription status.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
After I try this, I am planning to prepare a tutorial in case people need auto-renewable subscription and script validation system to check in app validity because it is a bit complicated.

Thanks Erel.
Based on the quote you posted the response should include the expiration date. Sounds like you always need to send the first receipt.
 
Upvote 0

Paul Leischow

Member
Licensed User
Longtime User
I know this is a fairly old post but did you ever create a tutorial on this?
I'm one of those people that could use some guidance with auto-renewable subscriptions ;)

I've read through various posts like
https://www.b4x.com/android/forum/threads/store-question.82867/
https://www.b4x.com/android/forum/threads/enhanced-receipts-for-subscriptions-purchase.81887/
https://www.b4x.com/android/forum/threads/problem-with-in-app-purchase.94742/

and I'm trying to make sense of it all but a tutorial or walk-through would certainly make things easier.
 
Upvote 0
Top