I am new to JSON and I need to create an object with the following format.
{
"receipt-data" : "(actual receipt bytes here)"
"password" : "(shared secret bytes here)"
}
I need to fill the "(actual receipt bytes here)" (NSData variable), and "(shared secret bytes here)" which is a number from iOS. I am confused as to how I can create it.
Basically you’d say
If receiptDataString is not an NSString you must convert it to one somehow. Probably use Base64 encoding. (Unfortunately, there’s no standard/commonly used Base64 encoder/decoder for Objective-C.)
If password is an int and not an NSString, change the second %@ to %d.