Hi Guys,
I am having an annoying issue in-app purchase payment with RevenueCat.
Purchase modal is properly displayed and I can always proceed with payment (). Problem is : about 4 times out of 10, the following callback is not called.
Purchases.shared.purchase(package: package) { {weak self] transaction, info, error, other in
Which means we cannot retrieve the transaction info or properly inform the user.
I am pretty confident the purchase worked, as the system displays a purchase confirmation an alert (see attached screenshot).
The following logs also suggest that both purchase and receipt were properly handled :
2023-01-11 19:08:23.124231+0100 XXXX4003:1210683] 3Purchases] - DEBUG: ℹ️ SKReceiptRefreshRequest started
2023-01-11 19:08:23.232600+0100 XXX14003:1206279] 0Purchases] - DEBUG: ℹ️ applicationDidBecomeActive
2023-01-11 19:08:23.675919+0100 XXX14003:1206279] <SKReceiptRefreshRequest: 0x28161e3e0>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=603 "Request throttled" UserInfo={NSLocalizedFailureReason=Unified receipt is valid and current, NSLocalizedDescription=Request throttled, AMSServerErrorCode=0}
2023-01-11 19:08:23.676101+0100 XXX04003:1206279] 3Purchases] - DEBUG: ℹ️ SKReceiptRefreshRequest finished
2023-01-11 19:08:23.676785+0100 XXX64003:1206279] [Purchases] - DEBUG: ℹ️ Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/ZZZ/StoreKit/sandboxReceipt
2023-01-11 19:08:23.676934+0100 XXX:4003:1206279] Purchases] - DEBUG: ℹ️ Skipping products request for these products because they were already cached: y"YYY"]
2023-01-11 19:08:23.677362+0100 XXX94003:1206279] 0Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: sjbxHhdsP8hGMmlp38dzjlGJlfg2
2023-01-11 19:08:23.678806+0100 XXX14003:1210652] 8Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Started
2023-01-11 19:08:23.678962+0100 XXX-4003:1210652] .Purchases] - INFO: ℹ️ Parsing receipt
2023-01-11 19:08:23.681816+0100 XXX24003:1210652] 8Purchases] - INFO: ℹ️ Receipt parsed successfully
2023-01-11 19:08:23.682373+0100 XXXr4003:1210652] 1Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Posting receipt (note: the contents might not be up-to-date, but it will be refreshed with Apple's servers):
{
"opaque_value" : "GixbfjDCNh4lAsINHu6GHQ==",
"original_application_version" : "1.0",
"bundle_id" : "XXX",
"sha1_hash" : "zqAAieTWtQd3ZJZBjcgo8+LVfu8=",
"application_version" : "2",
"creation_date" : "2023-01-11T18:08:20Z",
"in_app_purchases" : 1
{
"product_id" : "YYY",
"quantity" : 1,
"transaction_id" : "2000000247660644",
"is_in_trial_period" : false,
"web_order_line_item_id" : 0,
"original_purchase_date" : "2023-01-11T18:08:19Z",
"original_transaction_id" : "2000000247660644",
"product_type" : 1,
"purchase_date" : "2023-01-11T18:08:19Z"
}
]
}
2023-01-11 19:08:23.682487+0100 XXX>4003:1210652] -Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request POST receipts
2023-01-11 19:08:23.684376+0100 XXXc4003:1210652] 3Purchases] - DEBUG: ℹ️ API request started: POST /v1/receipts
2023-01-11 19:08:24.387933+0100 XXX14003:1210652] >Purchases] - DEBUG: ℹ️ API request completed: POST /v1/receipts (200)
2023-01-11 19:08:24.402668+0100 XXXr4003:1210652] bPurchases] - DEBUG: ℹ️ PostReceiptDataOperation: Finished
2023-01-11 19:08:24.402900+0100 XXXp4003:1210652] hPurchases] - DEBUG: ℹ️ Serial request done: POST receipts, 0 requests left in the queue
2023-01-11 19:08:24.407313+0100 XXXe4003:1206279] ePurchases] - DEBUG: ℹ️ Sending updated CustomerInfo to delegate.
2023-01-11 19:08:24.407502+0100 XXX 4003:1206279] oPurchases] - INFO: 💰 Finishing transaction '2000000247660644' for product 'YYY'
2023-01-11 19:08:24.889837+0100 XXX04003:1210652] Purchases] - DEBUG: ℹ️ StoreKit1Wrapper (0x0000000283244600) removedTransaction: YYY 2000000247660644 1
I am using iOS 16.2, revenue cat version is 4.16.0 and usesStoreKit2IfAvailable is set to false.
I can reproduce the issue about about 4 times out of 10 on both Testflight and Xcode built version on my iPhone 13.
My app has been rejected about 5 times by Apple reviewers because of this. First I could not reproduce the bug the reviewer was reporting. I am suspecting this issue happens only with iOS 16.2 (I recently updated my device to try to reproduce).
I am also considering opening a ticket on Github for this.
Any help on this would be greatly appreciated, a work-around if exists would also make my day as I lost many many hours trying to solve this.
Thanks,