I am using Auto-renewable subscriptions on mi app (on device validation, not server validation) and I am using sandbox users to test and for some weird reason an old receipt information is stocked on my device. I created a lot of new sand box users and the new receipt information is updated correctly, but if I tried to validate the receipt again (expire date to grant o deny access) the JSON File is displaying an old receipt validation (always the same). My workaround is using another device and it is working perfect with other devices. I am using cacheURL to store and validate expiration date on device, probably that's te problem but Im not sure how to clean the cache or something like that.
Any suggestion?
Any suggestion?
The one guess which I could make here is that when you install the app via Xcode, you are overwriting an existing app which has an appStoreReceipt with "older" receipt info. You should delete an existing sandbox StoreKit app, before you install a new version to test with.
However if you then use an older test user account to make an in-app purchase after the app has been re-installed, the appStoreReceipt will include the previous purchase history for that test user.
A more important consideration - the use of local receipt validation is not recommended for use with auto-renewing subscription in-app purchases. One limitation - local receipt validation cannot be used to detect that an auto-renewing subscription purchase has been refunded (except in the rare case that the appStoreReceipt can be refreshed after the refund event has occurred.)
rich kubota - rkubota@apple.com
developer technical support CoreOS/Hardware/MFI
However if you then use an older test user account to make an in-app purchase after the app has been re-installed, the appStoreReceipt will include the previous purchase history for that test user.
A more important consideration - the use of local receipt validation is not recommended for use with auto-renewing subscription in-app purchases. One limitation - local receipt validation cannot be used to detect that an auto-renewing subscription purchase has been refunded (except in the rare case that the appStoreReceipt can be refreshed after the refund event has occurred.)
rich kubota - rkubota@apple.com
developer technical support CoreOS/Hardware/MFI