chirag04 / react-native-in-app-utils

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

Empty array on in_app receipt field / Implement SKReceiptRefreshRequest #111

Closed brunolemos closed 7 years ago

brunolemos commented 7 years ago

Some users are complaining they are paying and not receiving the subscription.

Debugging the server, I noticed it receives the same receipt-data from the user on every receiptData request, with an empty array on in_app field.

After searching some links (e.g. this one), I believe we need to call Apple's SKReceiptRefreshRequest method to get an updated receipt from Apple's server.

Is that correct to assume? Or maybe another thing is causing this issue?

Apple docs:

An empty in_app array indicates that StoreKit has not recorded any transactions for that user yet. It may be that the application receipt has not yet been updated. When this happens, your app can inform the user that the receipt does not appear current and ask whether to refresh it. Upon user agreement, your app should use the SKReceiptRefreshRequest class to update the receipt. At this point, if StoreKit has recorded a purchase for the user, your app receipt will show it in in_app. See Refreshing the App Receipt for more information on how to update a receipt.

chirag04 commented 7 years ago

there is a PR in works for refreshReceipt. let's continue there: https://github.com/chirag04/react-native-in-app-utils/pull/110

lazyhoneyant commented 6 years ago

@brunolemos Do you solve this problem by refresh? I have the same issue too. the receipt has no in_app fields,(empty array []). but refresh didn't solve it.

brunolemos commented 6 years ago

@lazyhoneyan no, I haven't looked at this probably anymore, not sure if I still have it, users stopped complaining