Permalink
Browse files

Merge pull request #876 from AleksandarMicovic/master

[iOS] Update InAppPurchase plugin to work with Cordova 2.2.
  • Loading branch information...
2 parents 534fa35 + 1e57296 commit 3202e7dde3b98fb9f1fd38dbdd44ee2c40b355e9 @devgeeks devgeeks committed Nov 12, 2012
Showing with 10 additions and 10 deletions.
  1. +10 −10 iOS/InAppPurchaseManager/InAppPurchaseManager.m
@@ -14,18 +14,18 @@
// To avoid compilation warning, declare JSONKit and SBJson's
// category methods without including their header files.
@interface NSArray (StubsForSerializers)
-- (NSString *)JSONString;
-- (NSString *)JSONRepresentation;
+- (NSString *)cdvjk_JSONString;
+- (NSString *)cdvjk_JSONRepresentation;
@end
// Helper category method to choose which JSON serializer to use.
-@interface NSArray (JSONSerialize)
-- (NSString *)JSONSerialize;
+@interface NSArray (cdvjk_JSONSerialize)
+- (NSString *)cdvjk_JSONSerialize;
@end
-@implementation NSArray (JSONSerialize)
-- (NSString *)JSONSerialize {
- return [self respondsToSelector:@selector(JSONString)] ? [self JSONString] : [self JSONRepresentation];
+@implementation NSArray (cdvjk_JSONSerialize)
+- (NSString *)cdvjk_JSONSerialize {
+ return [self respondsToSelector:@selector(cdvjk_JSONString)] ? [self cdvjk_JSONString] : [self cdvjk_JSONRepresentation];
}
@end
@@ -153,7 +153,7 @@ - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)tran
NILABLE(productId),
NILABLE(transactionReceipt),
nil];
- NSString *js = [NSString stringWithFormat:@"plugins.inAppPurchaseManager.updatedTransactionCallback.apply(plugins.inAppPurchaseManager, %@)", [callbackArgs JSONSerialize]];
+ NSString *js = [NSString stringWithFormat:@"plugins.inAppPurchaseManager.updatedTransactionCallback.apply(plugins.inAppPurchaseManager, %@)", [callbackArgs cdvjk_JSONSerialize]];
NSLog(@"js: %@", js);
[self writeJavascript: js];
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
@@ -191,7 +191,7 @@ - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProdu
NILABLE(product.localizedDescription),
NILABLE(product.localizedPrice),
nil];
- NSString *js = [NSString stringWithFormat:@"%@.apply(plugins.inAppPurchaseManager, %@)", successCallback, [callbackArgs JSONSerialize]];
+ NSString *js = [NSString stringWithFormat:@"%@.apply(plugins.inAppPurchaseManager, %@)", successCallback, [callbackArgs cdvjk_JSONSerialize]];
NSLog(@"js: %@", js);
[command writeJavascript: js];
}
@@ -245,7 +245,7 @@ - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProdu
NILABLE(validProducts),
NILABLE(response.invalidProductIdentifiers),
nil];
- NSString *js = [NSString stringWithFormat:@"%@.apply(plugins.inAppPurchaseManager, %@);", callback, [callbackArgs JSONSerialize]];
+ NSString *js = [NSString stringWithFormat:@"%@.apply(plugins.inAppPurchaseManager, %@);", callback, [callbackArgs cdvjk_JSONSerialize]];
[command writeJavascript: js];
[request release];

0 comments on commit 3202e7d

Please sign in to comment.