The documentation for Transaction.updates
states, "If your app has unfinished transactions, the listener receives them immediately after the app launches. Without the Task to listen for these transactions, your app may miss them." My app is currently following these instructions: I start a background Task
to await
results from Transaction.updates
in application(didFinishLaunchingWithOptions:)
. However, I've noticed that when using StoreKit testing on the Simulator, my app does not receive transactions via Transactions.updates
if they occur while the app is not running. For example, if I subscribe to a monthly subscription and quit the app before the first renewal, when I fire the app back up, the "StoreKit Transactions" window in Xcode shows a new unfinished transaction, and that transaction is not delivered via Transaction.updates
. I know that Transaction.updates
is wired up correctly because if I let renewals happen while the app is running, they are delivered.
I see two probable explanations:
- The simulator and/or StoreKit testing just aren't properly supporting this scenario
- I'm actually supposed to be querying
Transactions.unfinished
at some point
I'm really unsure about #2 because I haven't seen it used in any sample code, nor found its intended usage discussed in any docs. Furthermore, this sample project exhibits the same exact issue: https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api
Anyone have any insights here?