Copyright © 2026 Unity Technologies
Thank you for reporting a bug to Unity. We have reviewed the issue carefully, and in this case, the team is unable to prioritize fixing this bug. There are a number of reasons we make this decision, including the impact and severity of the issue across our user and customer base, and the possibility that future plans may solve the problem in a different way, or that a workaround for the bug may be available. Today we will be closing this case. Thank you again for taking the time to report this issue, and please let us know if there is anything else that changes the impact or severity of this issue.
Crash in Unity Purchasing 4.12.2 iOS when receiving product response
—
What happened?
The app can crash after requesting a large number of products multiple times in quick succession.
This appears to be a threading issue. While the SKProductRequest is instantiated and started on the main thread in "-(void) initiateProductPoll:" using the main dispatch queue, the callback from StoreKit is called on a background worker thread, and is called on multiple threads:
"-(void) productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response".
This method modifies validProducts in a non-synchronized fashion. The solution I came up with was to simply adding a @synchronized block around [validProducts addEntriesFromDictionary: fetchedProducts]. However, it's not clear whether other places may also need to be synchronized.
How can we reproduce that?
Having a large number of products defined in App Store Connect (currently we are up to 167 products), call IStoreController.FetchAdditionalProducts multiple times in quick succession, passing in larger and larger subsets of the product definitions each time. Note that since it is a threading issue, it is not guaranteed to break.
You can confirm that the callback comes in on different threads by adding a breakpoint in UnityPurchasing.m around line 418 (where "addEntriesFromDictionary" is called). Note that each time the breakpoint is hit, it may be on a different background thread. Additionally, attempting to step over the line may result in another thread hitting the breakpoint before the original thread finishes stepping over the line.
Customer QA could not test the issue due to reproduction requiring App Store Connect app with a large number of products.
Issues you vote on will appear here