Permalink
Browse files

Added receipt data as a parameter to the completion block

  • Loading branch information...
1 parent bd9506f commit c91a8764e7eba7381c8f9be631657c8a7147d1a0 @MugunthKumar committed Apr 24, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 MKStoreManager.h
  2. +5 −5 MKStoreManager.m
View
@@ -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
View
@@ -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)();
@@ -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;
@@ -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
{
@@ -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)
{
@@ -607,7 +607,7 @@ -(void) provideContent: (NSString*) productIdentifier
{
[self rememberPurchaseOfProduct:productIdentifier];
if(self.onTransactionCompleted)
- self.onTransactionCompleted(productIdentifier);
+ self.onTransactionCompleted(productIdentifier, receiptData);
}
}
}

0 comments on commit c91a876

Please sign in to comment.