views:

152

answers:

1

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 status before creating "SKProductsRequest" or any better way to implement inApp Purchase? Can i use any timeout mechanism?

Thanks in advance,

+1  A: 

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.

coneybeare