opened
fisch0920
username_0
See #15.

The most obvious use case this improves is previously in-app purchases would never get a callback if the user cancelled the purchase from the confirmation popup.
More robust error handling
issue
created
chirag04
username_1
Thanks for the PR. It's a breaking change that we now send the error callback on cancel. Can you document that as well?

We can bump the major version then.
comment
created
grabbou
username_2
Hey, re: `RCTUtils`, I think you can just:
```obj-c
switch (transaction.transactionState) {
   case SKPaymentTransactionStateFailed: {
     NSString *key = RCTKeyForInstance(transaction.payment.productIdentifier);
     RCTResponseSenderBlock callback = _callbacks[key];
     if (callback) {
         callback(@[RCTJSErrorFromNSError(transaction.error)]);
         [_callbacks removeObjectForKey:key];
      } else {
          RCTLogWarn(@"No callback registered for transaction with state failed.");
      }
     [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
     break;
}
```
comment
created
chirag04
username_1
@username_0 can you incorporate @username_2 feedback?
comment
created
DenisIzmaylov
username_3
Ping
comment
created
DenisIzmaylov
username_3
@username_2 Could you please explain what does it mean? How I should to update your code to get it working? 
![image](https://cloud.githubusercontent.com/assets/1690596/14827553/a7889bf0-0beb-11e6-9e6d-2ba3c6818c98.png)
comment
created
grabbou
username_2
wrap it with `@(...)` - that converts `int` to NSNumber which is an Obj-c object. Looks like a bug in my snippet!
comment
created
DenisIzmaylov
username_3
It seemed just missed out `RCTUtils.h` :)
comment
created
DenisIzmaylov
username_3
I've created alternative PR to move this fix forward.
comment
created
chirag04
username_1
Thanks for all the help here guys!
comment