Categories
SwiftUI

Using StoreKit2 no longer need the restore purchase button, but in order to pass Appstore review, you also need to put one [AppStore review handbook]

Yesterday I submitted a new app. My plan for 2023 is to develop a series of small apps to have an income in the independent development field. But I found out early this morning that it was rejected.

The reason:

Guideline 3.1.1 – Business – Payments – In-App Purchase

We found that your app offers in-app purchases that can be restored but does not include a “Restore Purchases” feature to allow users to restore the previously purchased in-app purchases, as specified in the “Restoring Purchase Products” section of the In-App Purchase Programming Guide:

“Users restore transactions to maintain access to content they’ve already purchased. For example, when they upgrade to a new phone, they don’t lose all of the items they purchased on the old phone. Include some mechanism in your app to let the user restore their purchases, such as a Restore Purchases button.”

Next Steps

To restore previously purchased in-app purchase products, it would be appropriate to provide a “Restore” button and initiate the restore process when the “Restore” button is tapped by the user. Note that automatically restoring purchases on launch will not resolve this issue.

Meaning I provided an in-app purchase feature (for paid users), but without a restore purchase button.

I was wondering about this because I was using StoreKit2, and I remember learning this new API for two big reasons, the first being that this new API is cleaner and better to use. The second is that there is no need to a restore purchase process anymore, and it automatically will keep the purchase record synchronized with the AppStore.

I found the official WWDC video “Meet StoreKit 2 | 10114 | WWDC2021” which made me choose Storekit2 at the time, which clearly stated that:

So, all of this means that users won’t need to restore completed transactions when your app is reinstalled or downloaded on a new device. Everything should automatically be fetched by StoreKit and stay up to date. 

But what I didn’t notice was that after this sentence, he also said that:

But people use their Apple devices in millions of ways in millions of places. In the rare case that a user thinks they should have a transaction but you don’t see it, you can use the App Store sync API. This immediately resynchronizes all StoreKit 2 transactions. This is a replacement for the restoreCompletedTransactions API,and you should provide UI in your app that allows users to initiate the sync. However, thanks to StoreKit 2’s automatic synchronization, it should be very rare that a user needs to initiate a sync manually. 

In other words, although we don’t need to use the Restore Purchase button, we still need to provide a Restore Purchase button to synchronize the Appstore purchase records.

Moreover, the review guideline has not changed and still requires a Restore Purchase button.

So what can we do? Then add it.

Add a piece of code at the bottom of the UI which is not complicated.

Button {
    Task {
        do {
            try await AppStore.sync()
        } catch {
            print(error)
        }
    }
} label: {
    Text("Restore Purchases")
}

I would have thought this button was just plain stupid. If you buy an account at another web service, do you need a button to explicitly restore the purchase? It is all networked, with automatic updates of things. I thought StoreKit2 would not have to put this stupid button, but it seems that it is still needed to put it on.

I can also understand the problems Apple encounters, there are always network problems, or the user feels they have bought, perhaps confused. Give him a button so that he can manually resume. It may make the user more at ease.

Leave a Reply

Your email address will not be published. Required fields are marked *