Post

Replies

Boosts

Views

Activity

SKProductsRequestDelegate methods no longer called from main thread
Up until recently it seemed reasonable to assume that all StoreKit observer and delegate methods were called on the main thread. I'm not sure if this was documented, but I had ASSERTs in the relevant methods to check this was the case and they never fired.Since updating to iPadOS 13.1 I have discovered that the productsRequest:didReceiveResponse: and requestDidFinish: methods of SKProductsRequestDelegate are no longer called from the main thread. It's best to assume that request:didFailWithError: is also affected, although I haven't tested it.Given that these methods are typically used to update application state, it's now necessary to ensure this is performed in a thread-safe manner. I think the least intrusive solution would be to schedule the work to be performed on the main thead using dispatch_async(dispatch_get_main_queue(), ...).I'd be interested to know if anyone else can confirm this.
6
0
3.1k
Sep ’19