Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if SKProduct is already purchased

Tags:

ios

swift

Android Google Billing In-app gives all information about product (including if it's purchased or not)

What about iOS In-App Purchase (IAP)?

I don't want to save purchased items locally (UserDefaults for iOS) or to my own server after user bought it

Android uses Google Play Services, AIDL to get already purchased items even in offline mode

For safety in Android we can validate if user really bought item (and didn't use some hack app to get it for free) - https://developer.android.com/google/play/billing/billing_best_practices#validating-purchase-server

This additional validation for already purchased items we can do when user's device internet is enabled (though it should be enough to check it only during buying item), if internet is disabled we can temporary say that user bought it (but if he didn't buy it yet then internet is required anyway, we will validate it on our server anyway in this case)

So how does iOS work then? Does it have some, I don't know, iTunes Services to get IAP information for a specific app?

like image 740
user155 Avatar asked Sep 14 '25 02:09

user155


1 Answers

The answer is to check the receipt for the application - you are supposed to send the receipt up to Apple through your own servers to validate, but you can also parse the StoreKit receipt locally. There you can find prior purchases made.

like image 120
Kendall Helmstetter Gelner Avatar answered Sep 15 '25 15:09

Kendall Helmstetter Gelner