1 Reply
      Latest reply on Jun 16, 2018 4:43 PM by PBK
      wellington-censio Level 1 Level 1 (0 points)



        In the documentation, Apple states:


        "Note that if your app is already running when the subscription renews, the transaction observer is not called; your app finds out about the renewal the next time the app is launched."


        Is there a way that we can know, perhaps using the server-to-server APIs?


        If not, then what does Apple recommend you do when a user is using the app and their subscription is renewed without us knowing about it. Do we deny them service? Do we tell them to relaunch the app? Both are terrible user experiences.


        Please advise.

        • Re: Subscription Verification while App is running
          PBK Level 7 Level 7 (3,045 points)

          I'm pretty sure the documents do not mean 'relaunch' but rather 're-enter foreground' which your app will do every day. 


          [edit.... Actually, I think the last statement is wrong.  I don't keep a transactionObserver alive unless the app detects that the subscription has expired.  Only then do I add a transaction observer.  ]


          But your question has a better answer.  When the app detects that the subscription has lapsed it informs the user that it needs to go and check the status of the subscription.  It then does a receipt refresh or a restoreCompletedTransactions (which may require a log in by the user) and returns with the results.  This method covers the device that never called a restoreCompletedTransactions and it also covers the device that has two or more Apple IDs associated with it.


          You can also use the notifications system but that's much more complex.