Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restore button is required when auto-renewable subscription used In App Purchase?

I used auto-renewable subscription in my app. All things working perfectly but if user delete app from iPhone and again install then how to know that user is already subscribed or not?

we have to store user data or server or not?

I refer some questions like it , they says Apple reject that app which use restore button with auto-renewable In-App-Purchase.

like image 497
Dharini Avatar asked Apr 13 '18 04:04

Dharini


1 Answers

They reject apps that does NOT have the restore button. Every app that provides non_consumable or auto_renewable_subscription purchases MUST have it. They also provide everything you need in order to actually restore user purchases at SKPaymentQueue without having to store it somewhere else.

SKPaymentQueue.default().restoreCompletedTransactions()

Which will trigger the method:

func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])

from

SKPaymentTransactionObserver

I recommend this guide, everything there works very well: https://hackernoon.com/swift-how-to-add-in-app-purchases-in-your-ios-app-c1dc2fc82319

Also don't forget to add your Items ID before asking for purchases history.

like image 85
Gustavo Vollbrecht Avatar answered Oct 12 '22 15:10

Gustavo Vollbrecht