You can save this data in NSUserDefaults . And you do not need to show an alert that items have already been purchased. If his apple with a non-consumed product shows a warning that they have already purchased this product!
EDIT:
1) You need to add 3 buttons to your view
- Buy button
- Recovery button
- Demo version
You need to tell the user the recovery option if you support in-app purchases in your application. Otherwise, Apple will reject your application.
2) If the user clicks the Buy button, do not check whether the user has purchased your application or not. Because Apple will not charge users twice for the same product that is not consumed. So just review your purchase code, and if the user has already purchased it, the Apple StoreKit infrastructure will call it the delegation method
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
from
SKPaymentTransactionStatePurchased
transaction status. Therefore, you can present him with a login screen.
3) If the user clicks the "Restore" button, just go through with the recovery code
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
and, as in the second step, it will call the delegate method with the same transaction state. This way you can present the login page to the user.
4) If the user clicked the demo button, provide him with a demo version.
5) If the user purchased your application, deleted it, and if he reinstalls it, refer to it as a new user. Present these 3 buttons to him, and the user can restore the purchase, and then you can present him the login page.
6) If you really need to keep track of whether the application will be purchased on the exact device, you can use Keychain to store your data, because Keychain items are not deleted, even if the application was deleted or deleted. This api will help greatly link look
or
You can refer to the Apple documentation on Keychain data