Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validateReceiptIos always returns false #190

Closed
BenIrving opened this issue Jun 11, 2018 · 1 comment
Closed

validateReceiptIos always returns false #190

BenIrving opened this issue Jun 11, 2018 · 1 comment
Labels
🐛 bug Something isn't working 📱 iOS Related to iOS

Comments

@BenIrving
Copy link

BenIrving commented Jun 11, 2018

Version of react-native-iap

1.0.7

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

validateReceiptIos returns true for valid receipts

Actual behavior

validateReceiptIos always returns false

Tested environment (Emulator? Real Device?)

Real device, sandbox app store

Steps to reproduce the behavior

I am able to make subscription purchases successfully, and receive a transaction receipt. When I try to validate this on iOS using validateReceiptIos(receiptBody, true, 55) I always get returned false.

Looking at the code in the package:

 if (res) {
        if (RNVersion < 54) {
          const json = JSON.parse(res._bodyInit);
          return json;
        }
        const json = await res.text();
        res = JSON.parse(json);
      }

      return false;

Is this not always going to return false when RNVersion >= 54? the parsed result is never returned from the function.

Also, if I return res = JSON.parse(json); I always get
status : 21004
Is this due to us not sending a shared secret with the request?

@hyochan
Copy link
Member

hyochan commented Jun 12, 2018

@BenIrving Oops, my mistake. Could you try react-native-iap@1.1.5 and come back again?

@hyochan hyochan added 🐛 bug Something isn't working 📱 iOS Related to iOS labels Jun 12, 2018
@hyochan hyochan closed this as completed Jun 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 📱 iOS Related to iOS
Projects
None yet
Development

No branches or pull requests

2 participants