forked from iosdeveloper/iAPVerification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSampleCode.txt
23 lines (17 loc) · 815 Bytes
/
SampleCode.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#import "iAPVerification.h"
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
for (SKPaymentTransaction *transaction in transactions) {
[iAPVerification verifyPurchase:transaction isSandbox:YES delegate:self];
}
}
- (void)verificationFailed:(iAPErrorCode)errorCode error:(NSError *)error paymentTransaction:(SKPaymentTransaction *)paymentTransaction {
NSLog(@"%d, %@", errorCode, error);
}
- (void)purchaseVerified:(NSDictionary *)dictionary paymentTransaction:(SKPaymentTransaction *)paymentTransaction {
//NSLog(@"%@", dictionary);
NSString *productId = [dictionary objectForKey:@"product_id"];
if ([productId isEqualToString:@"com.powerflightapp.iap.1"]) {
// Provide content
}
[[SKPaymentQueue defaultQueue] finishTransaction:paymentTransaction];
}