I'm developing a freemium app with a non consumable IAP.
When I originally start the app with a test user it correctly downloads the initial receipt for the app, the one that doesn't contain any product id (no Type 17 values included).
Then I proceed, as a test user, with the only non consumable purchase avaiable and it correctly downloads the receipt that contains the purchased product id (and all other Type 17 validatable values).
To test a restore scenario I then usually delete (as root to not mess up the file privileges) the receipt that contains the product id and I swap it with the one downloaded originally (with no product id).
I then initiate the process of restoring calling:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions]it goes through flawlessly but the receipt is not updated with the product id of the product that should have been restored.
If then I try to force this process using
SKReceiptRefreshRequeststoreassetd replies with: "### Receipt is VALID for app (/pathToApp.app), checkSignature = 0. No need to renew." And the request fails with error: (null).
And it sounds right, because the receipt inside the bundle IS valid, but I need it to be updated with the product id (and every other Type 17 values) so that I can validate it and unlock the paid features for the user.
How can I update a receipt after a restore purchase?