ios - SKProductsRequest - how to handle timeouts / connection errors? -
cheers,
it appears me skproductsrequest not handle timeouts or connection errors in way. either calls -(void)productsrequest:(skproductsrequest *)request didreceiveresponse:(skproductsresponse *)response
on delegate in case of success, or doesn't.
i'd present users kind of activity indicator while products being retrieved, or maybe pop alert if appstore can't reached. since (in case of failure) there's no feedback skproductsrequest however, wonder event should tie presentation of feedback - other waiting arbitrary amount of time.
so, question is: there known amount of time after safe assume request has failed? or there way check upon status of pending request failed see?
i run in project whenever skrequest fails (which includes skproductrequest):
- (void)request:(skrequest *)request didfailwitherror:(nserror *)error { alert = [[uialertview alloc] initwithtitle:@"in-app store unavailable" message:@"the in-app store unavailable, please try again later." delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alert show]; }
works treat. of course can place inside brackets replace alert, works user.
hope of use you.
note: in skrequestdelegate
not in skproductsrequestdelegate
, confusing. skrequestdelegate
used purchasing , product requests. delegate set using request.delegate
can implement methods both.
Comments
Post a Comment