iosin-app-purchasekeychainreceiptkeychainitemwrapper

iOS save a physical app receipt in Keychain?


I would like to store the physical in app purchase receipt within the keychain, and thus allow for it to be replicated between devices when the user has keychain set across devices.

My question is how to save the receipt (NSData) to keychain?

Ultimately, I would like to save the receipt itself and also a string that would contain a string to show the IAP level applicable, and perhaps an expiry date.

Any help would be very greatly appreciated.


Solution

  • I have used SSKeychain which has sync capability built in. Using SSKeychain, it is then possible to convert the receipt data into a string, which can be stored as a password within keychain, and therefore converted back to data on any of the users devices and check the validity of the receipt.