开发者

InApp Purchase on slow network

Updated : I got "cannot connect to iTune Store" alert after 6 minutes. Is it possible to set any time out value while inApp Purchase.

My InApp purchase code works fine in normal network, but in very slow network(safari browser will take 5 min to load a webpage). I am not getting any delegates...

- (void)requestDidFinish:(SKRequest *)request 
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response

So my code blocks indefinetly because i am setting setUserInteractionEnabled to FALSE initially and setting it back to TRUE in the above delegates...

[[[UIApplication sharedApplication]keyWindow]setUserInteractionEnabled:FALSE];

Is it possible to check the network statu开发者_运维知识库s before creating "SKProductsRequest" or any better way to implement inApp Purchase? Can i use any timeout mechanism?

Thanks in advance,


You can use the Apple-Provided Reachability code sample to check if network is enabled. Regarding the code blocking, have you considered that your design is not ideal? Setup this process to NOT lock out the user and let it run in the background.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜