I've made an app with an IAP, but currently it does nothing with the receipt other than store it in NSUserDefaults.
Correct me if I'm wrong, but the contents of NSUserDefaults can be manipulated on jailbroken iPhones, right? So, were my app to be installed on a jailbroken iPhone, they could put in a phony NSData object with the correct key in the NSUserDefaults, and my app wouldn't know the difference.
So, I figure that in addition to checking that any data is stored with the key for the NSUserDefaults, I need to verify that the data is for a valid receipt.
Apple's documentation on the subject may just have left more questions than answers... first, here's the documentation:
http://developer.apple.com/library/...html#//apple_ref/doc/uid/TP40008267-CH104-SW1
My questions:
1.) How do I encode with base64 encoder? I looked through the information on NSCoder and I didn't see anything about base64.
2.) How do I create a JSON object?
3.) How do I post it?
4.) Where is Apple's response going to appear? Should establish a delegate and give it a method to handle Apple's response?
... maybe it'd be better if I just found documentation on using JSON on the iPhone... I suspect questions 2-4, if not 1, could be answered by it if it exists...
Correct me if I'm wrong, but the contents of NSUserDefaults can be manipulated on jailbroken iPhones, right? So, were my app to be installed on a jailbroken iPhone, they could put in a phony NSData object with the correct key in the NSUserDefaults, and my app wouldn't know the difference.
So, I figure that in addition to checking that any data is stored with the key for the NSUserDefaults, I need to verify that the data is for a valid receipt.
Apple's documentation on the subject may just have left more questions than answers... first, here's the documentation:
http://developer.apple.com/library/...html#//apple_ref/doc/uid/TP40008267-CH104-SW1
My questions:
1.) How do I encode with base64 encoder? I looked through the information on NSCoder and I didn't see anything about base64.
2.) How do I create a JSON object?
3.) How do I post it?
4.) Where is Apple's response going to appear? Should establish a delegate and give it a method to handle Apple's response?
... maybe it'd be better if I just found documentation on using JSON on the iPhone... I suspect questions 2-4, if not 1, could be answered by it if it exists...
Last edited: