Closed benminor closed 11 months ago
+1
Do you use a StoreKit2 or Hybrid Mode?
@khrulev You need to use StoreKit2, not anything else. Closing this issue :)
@baesumin Hello, the same, I use setup({storekitMode: 'STOREKIT2_MODE'});
and "transactionReceipt":""
with help sandbox account. Please help, version "12.10.8".
@baesumin Hello, the same, I use
setup({storekitMode: 'STOREKIT2_MODE'});
and"transactionReceipt":""
with help sandbox account. Please help, version "12.10.8".
When you use STOREKIT2_MODE you should not use any Receipt(including transactionReciept), you should ONLY process JWS transactions by verifying them using the Apple services and then invoke your own business logic and when you complete your own code you need just invoke FinishTransaction() to say Apple that you did all your job. The main difference between STOREKIT2 and SK1 is migration from receipt to transactions approach.
@khrulev hm, I found validate code
const appleReceiptResponse = await validateReceiptIos({ receiptBody: { 'receipt-data': receipt, password: ITUNES_SHARED_SECRET, }, isTest: isTestEnvironment, });
Is it valid?
@khrulev hm, I found validate code
const appleReceiptResponse = await validateReceiptIos({ receiptBody: { 'receipt-data': receipt, password: ITUNES_SHARED_SECRET, }, isTest: isTestEnvironment, });
Is it valid?
It should work in SK1 mode. With these comments:
Q: Does a receipt always exist in the app? A: If a user downloaded the app from the App Store – yes. However, in sandbox if your app was installed via Xcode or Testflight, then there won't be a receipt until you make a purchase or restore.
And I recommend using STORE_KIT2_MODE, where you can get PurchaseHistory() and get the latest transaction. Work with transactions, not receipts. I guess if you implement a receipts approach you can not get approved by App store because of guidelines.
Description
I am trying to test my in app purchase. After successfully purchasing the subscription in the app, via TestFlight and signed into Sandbox account, I try and access the
purchase.transactionReceipt
value to send to my backend for verification but it is an empty string.Expected Behavior
It's expected to not be an empty string so that I can verify the transaction in my backend.
Screenshots![Screen Shot 2023-08-24 at 4 39 31 PM](https://github.com/dooboolab-community/react-native-iap/assets/56656394/7fabdc1f-4f91-412b-b12a-dd02109f9842)
Environment:
Is this because I am testing via TestFlight so the transaction technically doesn't go through, thus there's no receipt?