Skip to content

Commit

Permalink
Try fixes for #288.
Browse files Browse the repository at this point in the history
By changing mutable array.
  • Loading branch information
hyochan committed Oct 24, 2018
1 parent 696b37d commit ef6c2d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions ios/RNIapIos.m
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,21 @@ - (NSDictionary *)getPurchaseData:(SKPaymentTransaction *)transaction {

if (receiptData == nil) return nil;

NSMutableDictionary *purchase = [NSMutableDictionary dictionaryWithDictionary: @{
@"transactionDate": @(transaction.transactionDate.timeIntervalSince1970 * 1000),
@"transactionId": transaction.transactionIdentifier,
@"productId": transaction.payment.productIdentifier,
@"transactionReceipt":[receiptData base64EncodedStringWithOptions:0]
}];
NSMutableDictionary *purchase = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@(transaction.transactionDate.timeIntervalSince1970 * 1000), @"transactionDate",
transaction.transactionIdentifier, @"transactionId",
transaction.payment.productIdentifier, @"productId",
[receiptData base64EncodedStringWithOptions:0], @"transactionReceipt",
nil
];

// NSMutableDictionary *purchase = [NSMutableDictionary dictionaryWithDictionary: @{
// @"transactionDate": @(transaction.transactionDate.timeIntervalSince1970 * 1000),
// @"transactionId": transaction.transactionIdentifier,
// @"productId": transaction.payment.productIdentifier,
// @"transactionReceipt":[receiptData base64EncodedStringWithOptions:0],
// }];

// originalTransaction is available for restore purchase and purchase of cancelled/expired subscriptions
SKPaymentTransaction *originalTransaction = transaction.originalTransaction;
if (originalTransaction) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-iap",
"version": "2.3.14",
"version": "2.3.15",
"description": "React Native In App Purchase Module.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit ef6c2d6

Please sign in to comment.