From f690c6e2e0fb4fd51027f4ed241f470edac3dfae Mon Sep 17 00:00:00 2001 From: andresordonezfm <72390915+andresordonezfm@users.noreply.github.com> Date: Thu, 7 Jan 2021 11:17:42 -0500 Subject: [PATCH] Fix posible problem clearTransactionsIOS promise Solution recommended by rusty120 to avoid a possible deadlock in the promise of the clearTransactionsIOS https://github.com/dooboolab/react-native-iap/issues/1120#issuecomment-754840685 --- ios/RNIapIos.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/RNIapIos.m b/ios/RNIapIos.m index b9b37931a..d709b7456 100644 --- a/ios/RNIapIos.m +++ b/ios/RNIapIos.m @@ -835,7 +835,7 @@ - (void)requestDidFinish:(SKRequest *)request { -(void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions { NSLog(@"removedTransactions"); if (countPendingTransaction != nil && countPendingTransaction > 0) { - countPendingTransaction--; + countPendingTransaction -= [transactions count]; if (countPendingTransaction == 0) { [self resolvePromisesForKey:@"cleaningTransactions" value:nil]; countPendingTransaction = nil;