Skip to content

Instantly share code, notes, and snippets.

@tochi
Last active June 7, 2019 19:52
Show Gist options
  • Save tochi/82f5b0fecc3cdb928cde36db7b0e5577 to your computer and use it in GitHub Desktop.
Save tochi/82f5b0fecc3cdb928cde36db7b0e5577 to your computer and use it in GitHub Desktop.
- (NSDictionary *)verifyReceipt:(NSString *)base64Receipt isCoercion:(BOOL)isCoercion isSandbox:(BOOL)isSandbox {
if (_completed || isCoercion) {
if (base64Receipt) {
NSURL *url = [NSURL URLWithString:isSandbox ? @"https://sandbox.itunes.apple.com/verifyReceipt" : @"https://buy.itunes.apple.com/verifyReceipt"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSDictionary *requestContents = @{
@"receipt-data": base64Receipt,
@"password": SHARED_SECRET
};
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment