DHAppleReceiptParser 1.0.1

DHAppleReceiptParser 1.0.1

TestsTested
LangLanguage CC
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total243,300
Week0
Month6,913

Installs

Apps8,500
Test Targets14,859
powered by Segment

GitHub

Stars25
Watchers11
Forks15
Issues11
Contributors2
Pull Requests5

Code

Files129
LOCLines of Code 31,085


  • By
  • Chase Caster

A library to parse the apple receipt file in iOS 7 as defined in the apple developer documentation.

This library does not handle validation -- by Apple's design, it is necessary to provide your own validation code for security reasons.

This library does make it easier to fetch in-app purchase data stored on the device, which could be used for server side receipt validation.

To get the parsed system receipt:

#import "DHAppStoreReceipt.h"

// This function could be used to get the recipt payload for server side validation
//  of in app purchases
- (NSData *)receiptDataForProductIdentifier:(NSString *)productIdentifier {
    DHAppStoreReceipt *receipt = [DHAppStoreReceipt mainBundleReceipt];
    DHInAppReceipt *inAppReceipt = [receipt receiptForProductId:productIdentifier];
    return inAppReceipt.receiptData;
}

OpenSSL is included as built by https://github.com/st3fan/ios-openssl