Confirm iOS Auto Renewal Subscription from Multiple Applications

I work for a game development company that releases at least one game per month. For our true fans, we want to start subscribing to our games so that they can play all our games (on any platform) without constantly buying them.

The idea of ​​iOS is to use an auto-renewal subscription in the app. This leads to the receipt that we keep in our backend. The backend can check this receipt and provide the application with information about the user's subscription. This system will solve many problems: you can take a subscription in 1 game and play all the games on any device that you like.

But now we come to a problem: a month later the receipt is no longer valid, and we need to check in the iTunes store to see if the user has a valid subscription.

My first idea was to use the latest_receipt_info field to get the latest receipt and check it. But according to the documentation, this function should only be used for iOS 6 receipts:

"Only returns for iOS 6 style transaction receipts for auto-renewal."

Source: https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-

Despite the fact that I can really use this field in my new version of iOS 10, I do not consider it reasonable to use it, since it is deprecated.

(another source tells you not to use it anymore: https://forums.developer.apple.com/message/156580#156580 )

Apple's recommended solution is to implement SKPaymentTransactionObserver in the application. This will allow you to get the latest receipt when it is available and send it to the backend. Even if this is far from ideal, it might work ... however:

This means that the application must be active in order to receive the latest receipt. And in our case it is very good that the user accepts a subscription in application 1, and after a couple of days downloads applications 2, 3 and 4, but never uses application 1 again. Thus, in this case, the most recent receipt will never be received (since only the observer of application 1 can receive a receipt)

To fix this problem, we should be able to receive receipts from this subscription from any application in our subscription group. But according to the documentation on the Apple website ( https://developer.apple.com/app-store/subscriptions/ ) you can only access a subscription from 1 application, and you need to make several applications a thing on their own:

You can offer auto-renewable subscriptions to access multiple applications in your portfolio. Each application must be approved for the use of automatically renewed in-app purchases and must be published under the same developer name on the App Store.

In iTunes Connect, you need to set up separate and equivalent auto-renewal in-app purchases in every app offered in the multi-app subscription so that users can sign up from any app. In order to avoid users paying many times for the same offer, you are responsible for confirming that they are subscribers in one of the applications before showing any subscription options. To do this, consider maintaining an account management system in which users create an account in their company to log into each application.

So, is there a way to do what we want, without forcing the user to return to the application that he used to purchase a subscription every month?

+8
ios in-app-purchase subscription
source share
1 answer

At the last WWDC, we went to the StoreKit lab and personally asked the StoreKit weekly about it. We were told that the "last_receipt_info" field returned by the validateReceipt iTunes endpoint is exactly what we intend to use to check whether the subscription has been renewed or not. It will not be obsolete in the near future, but they have plans to add communication between the servers, which solve some of the problems we encountered:

  • Your server will be able to receive notification from Apple regarding any renewal, cancellation, downgrade, etc.
  • In the last_receipt_info file returned by the validateReceipt endpoint, several fields will be added that provide information, for example, whether the subscription will be renewed after the current period has expired, if there was a problem loading the user's credit card, etc.

Sources:

WWDC 2017 Session 303 - What's New in StoreKit
WWDC 2017 Session 305 - Extended StoreKit

+1
source share