I'm trying to get the RMStore library to work, but therefore I need to be able to restore the in app purchases the user could have possible made. I'm aware of the method: restoreTransactionsOnSuccess: but with this method I don't get to know which in app purchases are restored.
[[RMStore defaultStore] restoreTransactionsOnSuccess:^{
} failure:^(NSError *error) {
}];
The above code is what I used, and it's working because in the logging I see the bought in app purchases. Do I miss something?
Could somebody point me to the right direction?
Thanks in advance!
As Merlea Dan mentioned, you can achieve this with notifications. The RMStore documentation states:
Payment transaction notifications are sent after a payment has been requested or for each restored transaction.
Simply register as an observer and implement:
- (void)storePaymentTransactionFinished:(NSNotification*)notification
{
SKPaymentTransaction *transaction = notification.rm_transaction;
if (transaction.state == SKPaymentTransactionStateRestored)
{
// Do something
}
}
It's worth mentioning that a few others have requested to have restoreTransactionsOnSuccess
return the list of restored product ids in the success block. You might want to subscribe to this issue in case it gets added.