bizz84 / bizz84/SwiftyStoreKit

Should I serialize calls to retrieveProductsInfo, verifyReceipt?

Open
#568 1 comment 0 reactions 0 assignees View on GitHub
area: purchase flows area: receipt-validation difficulty: advanced help wanted type: bug type: question
Dominant language
Swift
Stars
6.7k
Forks
801
PR merge metrics
No merged PRs in 30d

Description

**TL;DR**: Should I call verifyReceipt in the completion handler of retrieveProductsInfo? Should I delay a call to purchaseProduct until verifyReceipt has returned? The log files *seem* to say these are all happening in order, but there could be log buffering issues.

**Problem**: About 2/3 of attempted purchase, in production, are failing with .paymentCancelled. We don't think they are all cancelling -- some logs show two or three attempts in succession. I'm not calling it a bug, but don't know quite what to call it. It is hard to duplicate in TestFlight/Sandbox.

**Details**: I am calling completeTransaction, retrieveProductsInfo, verifyReceipt, and purchaseProduct in that order. The first one's completion handler is never called; that's OK. RetrieveProductsInfo always returns (i.e. its completion handler is called) first, and correctly reports my product IDs. VerifyReceipt returns after that, with "not purchased" for all product IDs. The completion handler for purchaseProduct is returning .error about 2/3 of the time, almost always with .paymentCancelled.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.