react-native-in-app-utils icon indicating copy to clipboard operation
react-native-in-app-utils copied to clipboard

How do I test receiptData() with existing paid app?

Open wootwoot1234 opened this issue 9 years ago • 6 comments

I have a paid app that I'm thinking about making free with in app purchases. If I make the switch I'll need to check if the user has already paid for the app and then enable the paid features. I think the receiptData() should do what I need but I'm not sure how to test it. I built the app and ran it using my development provisioning profile on my device and receiptData() just returns an error. So I built the app with a distribution provisioning profile and submitted it to the app store then downloaded the app using test flight but I'm still getting the same error. How do I get the receipt data from an existing app?

wootwoot1234 avatar Oct 04 '15 19:10 wootwoot1234

@marcgreenstock would you have ideas here?

chirag04 avatar Oct 04 '15 22:10 chirag04

@wootwoot1234 do you have StoreKit enabled in xcode? What is the error you are receiving?

marcgreenstock avatar Oct 06 '15 10:10 marcgreenstock

Thanks @chirag04 & @marcgreenstock

I didn't have the storekit.framework linked, it wasn't in the installation instructions, should it be? I just linked it and will try testing it again now. Do you know if it needs to be built with the distribution provisioning profile? Do I need to upload it to the itunes connect and then test it using test flight? Is there an easier way?

wootwoot1234 avatar Oct 06 '15 17:10 wootwoot1234

@wootwoot1234 I mention about the setup in Notes on README.

You have to set up your in-app purchases in iTunes Connect first. Follow this tutorial for an easy explanation.

Follow the link to the tutorial in the readme.

chirag04 avatar Oct 06 '15 18:10 chirag04

@chirag04 thanks for the reply. Do I need to setup in-app purchases if I'm just trying to read the receipt data? Right now I'm just interested in seeing which version of the app the user bought (and the price they paid if possible) to determine if they paid for the app before I change the app to free and use in-app purchases. Once I'm sure I can read the receipt data then I'll start the in-app purchase development (which I've done before in other apps).

wootwoot1234 avatar Oct 06 '15 18:10 wootwoot1234

I'm not sure of the receiptData() did what I wanted so I made my own method for just checking if the app has been paid for or not. I created a pull request with my code, see #12

wootwoot1234 avatar Oct 07 '15 00:10 wootwoot1234