Skip to content

Commit

Permalink
iOS: Return bool in canMakePayments
Browse files Browse the repository at this point in the history
  • Loading branch information
RaeesBhatti authored and hyochan committed Apr 26, 2019
1 parent 0ce1cd1 commit 5357d23
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ios/RNIapIos.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ - (BOOL)shouldAddStorePayment:(SKPayment *)payment forProduct:(SKProduct *)produ
RCT_EXPORT_METHOD(canMakePayments:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL canMakePayments = [SKPaymentQueue canMakePayments];
NSString* str = canMakePayments ? @"true" : @"false";
resolve(str);
resolve(canMakePayments);

This comment has been minimized.

Copy link
@mars-lan

mars-lan Apr 26, 2019

Contributor

This broke the build with the following error in XCode 10.2.1

Implicit conversion of 'BOOL' (aka 'bool') to 'id' is disallowed with ARC

This comment has been minimized.

Copy link
@EricCarrGH

EricCarrGH Apr 27, 2019

Maybe you want this?

resolve([NSNumber numberWithBool:canMakePayments]);

}

RCT_EXPORT_METHOD(getItems:(NSArray*)skus
Expand Down

0 comments on commit 5357d23

Please sign in to comment.