iOS Question Auto-Renewing Subscriptions

Discussion in 'iOS Questions' started by tufanv, Sep 5, 2016.

  1. tufanv

    tufanv Expert Licensed User


    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 ?

  2. Erel

    Erel Administrator Staff Member Licensed 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.
  3. tufanv

    tufanv Expert Licensed User

    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.
  4. Erel

    Erel Administrator Staff Member Licensed User

    Did you find any Objective C or Swift documentation about this new feature?
  5. tufanv

    tufanv Expert Licensed User

    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.
  6. tufanv

    tufanv Expert Licensed User

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

    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: Feb 2, 2017
  7. tufanv

    tufanv Expert Licensed User

    for example , simple response from a script validation with ios gives :

    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 :

    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 ?
  8. tufanv

    tufanv Expert Licensed User

    also there is a quote supporting this:

  9. Erel

    Erel Administrator Staff Member Licensed User

    How are you validating the receipts?
  10. tufanv

    tufanv Expert Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    Based on the quote you posted the response should include the expiration date. Sounds like you always need to send the first receipt.
    tufanv likes this.
  12. tufanv

    tufanv Expert Licensed 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.
  13. Paul Leischow

    Paul Leischow Member Licensed 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

    and I'm trying to make sense of it all but a tutorial or walk-through would certainly make things easier.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice