Cheers,
It appears to me like SKProductsRequest does not handle timeouts or connection errors in any way. It either calls -(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response on its delegate in case of success, or it doesn’t.
I’d like to present my users with some kind of activity indicator while the products are being retrieved, or maybe pop up an alert if the appstore can’t be reached. Since (in case of failure) there’s no feedback from the SKProductsRequest however, I wonder to which event I should tie the presentation of that feedback – other then waiting for an arbitrary amount of time.
So, the question is: Is there a known amount of time after which it is safe to assume the request has failed? Or is there any way to check upon the status of a pending request that I just failed to see?
I run this in my project for whenever an SKRequest fails (which includes SKProductRequest):
Works a treat. Of course you can place anything inside the brackets to replace my alert, but this works well for the user.
Hope this is of use to you.
Note: This is in
SKRequestDelegatenot inSKProductsRequestDelegate, which is slightly confusing. TheSKRequestDelegateis used for purchasing and for product requests. The delegate set usingrequest.delegatecan implement methods for both.