Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
Added receipt data as a parameter to the completion block
Browse files Browse the repository at this point in the history
  • Loading branch information
MugunthKumar committed Apr 24, 2012
1 parent bd9506f commit c91a876
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MKStoreManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

// use this method to invoke a purchase
- (void) buyFeature:(NSString*) featureId
onComplete:(void (^)(NSString*)) completionBlock
onComplete:(void (^)(NSString*, NSData*)) completionBlock
onCancelled:(void (^)(void)) cancelBlock;

// use this method to restore a purchase
Expand Down
10 changes: 5 additions & 5 deletions MKStoreManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
@interface MKStoreManager () //private methods and properties

@property (nonatomic, copy) void (^onTransactionCancelled)();
@property (nonatomic, copy) void (^onTransactionCompleted)(NSString *productId);
@property (nonatomic, copy) void (^onTransactionCompleted)(NSString *productId, NSData* receiptData);

@property (nonatomic, copy) void (^onRestoreFailed)(NSError* error);
@property (nonatomic, copy) void (^onRestoreCompleted)();
Expand Down Expand Up @@ -412,7 +412,7 @@ -(void) showAlertWithTitle:(NSString*) title message:(NSString*) message {
}

- (void) buyFeature:(NSString*) featureId
onComplete:(void (^)(NSString*)) completionBlock
onComplete:(void (^)(NSString*, NSData*)) completionBlock
onCancelled:(void (^)(void)) cancelBlock
{
self.onTransactionCompleted = completionBlock;
Expand All @@ -427,7 +427,7 @@ - (void) buyFeature:(NSString*) featureId
message:NSLocalizedString(@"You can use this feature for reviewing the app.", @"")];

if(self.onTransactionCompleted)
self.onTransactionCompleted(featureId);
self.onTransactionCompleted(featureId, nil);
}
else
{
Expand Down Expand Up @@ -554,7 +554,7 @@ -(void) provideContent: (NSString*) productIdentifier

[MKStoreManager setObject:receiptData forKey:productIdentifier];
if(self.onTransactionCompleted)
self.onTransactionCompleted(productIdentifier);
self.onTransactionCompleted(productIdentifier, receiptData);
}
onError:^(NSError* error)
{
Expand Down Expand Up @@ -607,7 +607,7 @@ -(void) provideContent: (NSString*) productIdentifier
{
[self rememberPurchaseOfProduct:productIdentifier];
if(self.onTransactionCompleted)
self.onTransactionCompleted(productIdentifier);
self.onTransactionCompleted(productIdentifier, receiptData);
}
}
}
Expand Down

0 comments on commit c91a876

Please sign in to comment.