Receipts not updated in testflight environment

I check the receipt when I check the payment status. Among them, we also check the value of 'expires_date' inside the 'latest_receipt_info' object and change the subscription status value of our server if it is before the current date.

Projects built in xcode receive normal receipts, but the testFlight environment shows the following phenomenon.


in xcode run

We could get the receipt we just purchased by checking the receipt right after the payment.

After that, we will continue to receive the receipt we just purchased.


in testFlight Environment

We could get the receipt we just purchased by checking the receipt right after the payment.

However, if we request the receipt again after 3 to 5 seconds, we received the previous payment receipt, not the one just paid.

I was wondering if the payment was not made, so I paid again, but it says it's already a subscription.

So there is a problem in checking if the subscription is being maintained later.


I don't know why the receipt can't be updated in the testFlight environment.

Let me know if anyone knows how.


thank you

Replies

> 1) We could get the receipt we just purchased by checking the receipt right after the payment.

2) However, if we request the receipt again after 3 to 5 seconds, we received the previous payment receipt, not the one just paid.


Are you writing (1) that the receipt on the device (at [[NSBundle mainBundle] appStoreReceiptURL] ) is correct after StoreKit makes a call to updatedTransactions but (2) the receipt on the device (at [[NSBundle mainBundle] appStoreReceiptURL] ) is no longer correct after you submit an immediate SKReceiptRefreshRequest?

Post not yet marked as solved Up vote reply of PBK Down vote reply of PBK

thank you for reply PBK


1) We could get the receipt we just purchased by checking the receipt right after the payment.

2) However, if we request the receipt again after 3 to 5 seconds, we received the previous payment receipt, not the one just paid.



(1) and (2) use the same logic( check verifyReceipt ).

(1) ====> called after "complete SKPaymentTransaction".

(2) ====> (1) the logic is completely finished,

and After three seconds

When we request a receipt, we receive a receipt that we paid for before.


[[NSBundle mainBundle] appStoreReceiptURL] is use below


guard let receiptUrl = Bundle.main.appStoreReceiptURL else {
     let request = SKReceiptRefreshRequest(receiptProperties: nil)
     request.delegate = self
     
request.start()

}

Good to know. I guess that SKReceiptRefreshRequest is getting its receipts from a queue that has a lower priority than updatedTransactions. There is no reason to do a SKReceiptRefreshRequest after a call to updatedTransactions and now we know there is a reason not to do that. Explore how long it takes SKReceiptRefreshRequest to catch up to updatedTransactions. Is it 10 seconds? 60 seconds?

Sangheee did you find a solution to this situation? I'm facing exactly the same error in my app.