chirag04 / react-native-in-app-utils

A react-native wrapper for handling in-app payments
MIT License
892 stars 187 forks source link

InAppUtils.receiptData returns base64 string thats Malformed #187

Open yashyadav opened 5 years ago

yashyadav commented 5 years ago

After a successful payment in sandbox env for auto renewable subscription, I am trying to get receipt data that I can use to validate the transaction. The string returned gives me malformed error when I try to validate it using iap-receipt-validator and it can't be decoded either. I looked at some sample base64 strings provided by apple which were properly being decoded. Here is the code I used:

InAppUtils.loadProducts(products, (error, products) => {
      InAppUtils.receiptData((error, receiptData)=> {
        //this.validate(receiptData);
        console.log(receiptData)
      });
    });

Is anyone else experiencing the same problem?

mrcwerfar commented 4 years ago

yes, calling InAppUtils.receiptData((error, receiptData)=> ... give undefined for receiptData, any solutions?