Skip to content

Commit

Permalink
fix: Xcode 11 compatibility (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 authored Jan 7, 2021
1 parent b858934 commit 4084dc6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios/RNIapIos.m
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,22 @@ - (BOOL)paymentQueue:(SKPaymentQueue *)queue shouldAddStorePayment:(SKPayment *)
}];
}


RCT_EXPORT_METHOD(presentCodeRedemptionSheet:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
#ifdef __IPHONE_14_0
if (@available(iOS 14.0, *)) {
[[SKPaymentQueue defaultQueue] presentCodeRedemptionSheet];
resolve(nil);
} else {
reject([self standardErrorCode:2], @"This method only available above iOS 14", nil);
}
#else
reject([self standardErrorCode:2], @"This method only available above iOS 14", nil);
#endif
}


#pragma mark ===== StoreKit Delegate

-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
Expand Down

0 comments on commit 4084dc6

Please sign in to comment.