├── libiap.a ├── SampleCode.txt └── iAPVerification.h /libiap.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iosdeveloper/iAPVerification/HEAD/libiap.a -------------------------------------------------------------------------------- /SampleCode.txt: -------------------------------------------------------------------------------- 1 | #import "iAPVerification.h" 2 | 3 | - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { 4 | for (SKPaymentTransaction *transaction in transactions) { 5 | [iAPVerification verifyPurchase:transaction isSandbox:YES delegate:self]; 6 | } 7 | } 8 | 9 | - (void)verificationFailed:(iAPErrorCode)errorCode error:(NSError *)error paymentTransaction:(SKPaymentTransaction *)paymentTransaction { 10 | NSLog(@"%d, %@", errorCode, error); 11 | } 12 | 13 | - (void)purchaseVerified:(NSDictionary *)dictionary paymentTransaction:(SKPaymentTransaction *)paymentTransaction { 14 | //NSLog(@"%@", dictionary); 15 | 16 | NSString *productId = [dictionary objectForKey:@"product_id"]; 17 | 18 | if ([productId isEqualToString:@"com.powerflightapp.iap.1"]) { 19 | // Provide content 20 | } 21 | 22 | [[SKPaymentQueue defaultQueue] finishTransaction:paymentTransaction]; 23 | } 24 | -------------------------------------------------------------------------------- /iAPVerification.h: -------------------------------------------------------------------------------- 1 | // 2 | // iAPVerification.h 3 | // 4 | // Created by Max Bäumle. 5 | // Copyright (c) 2011-2012 Max Bäumle. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | typedef enum { 12 | iAPTransactionMissing, // paymentTransaction object missing 13 | iAPVerificationFailed, 14 | iAPConnectionFailed, // Server connection failed 15 | } iAPErrorCode; 16 | 17 | @interface iAPVerification : NSObject 18 | 19 | + (void)verifyPurchase:(SKPaymentTransaction *)paymentTransaction isSandbox:(BOOL)sandbox delegate:(id)delegate; 20 | + (void)verifyPurchase:(SKPaymentTransaction *)paymentTransaction serverUrl:(NSString *)urlString isSandbox:(BOOL)sandbox delegate:(id)delegate; 21 | 22 | + (BOOL)findBinaries; // Find binaries used for cracking on the device 23 | 24 | @end 25 | 26 | @protocol iAPVerificationDelegate 27 | 28 | @optional 29 | 30 | - (void)verificationFailed:(iAPErrorCode)errorCode error:(NSError *)error paymentTransaction:(SKPaymentTransaction *)paymentTransaction; 31 | - (void)purchaseVerified:(NSDictionary *)dictionary paymentTransaction:(SKPaymentTransaction *)paymentTransaction; // Available keys: 'quantity', 'product_id', 'transaction_id', 'purchase_date', 'app_item_id', 'bid', 'bvrs' 32 | 33 | /* DEPRECATED */ 34 | - (void)verificationFailed:(iAPErrorCode)errorCode error:(NSError *)error __attribute__((deprecated)); 35 | - (void)purchaseVerified:(NSDictionary *)dictionary __attribute__((deprecated)); 36 | 37 | @end 38 | --------------------------------------------------------------------------------