ios - i used inAppPurchase in my appwhere didReceiveResponse method never called but every time didFailedWithError Called -
i trying add in app purchase in app. have done code. object of skproductsrequest global.
-(void)requestproductswithcompletionhandler:(requestproductscompletionhandler)completionhandler { _completionhandler = [completionhandler copy]; _productsrequest = [[skproductsrequest alloc] initwithproductidentifiers:_productidentifiers]; _productsrequest.delegate = self; [_productsrequest start]; }
in above method _productidentifiers display correct value when debug it. skproductsrequest delegate method here.
-(void)productsrequest:(skproductsrequest *)request didreceiveresponse:(skproductsresponse *)response { nslog(@"loaded list of products..."); _productsrequest = nil; nsarray * skproducts = response.products; (skproduct * skproduct in skproducts) { nslog(@"found product: %@ %@ %0.2f", skproduct.productidentifier, skproduct.localizedtitle, skproduct.price.floatvalue); } _completionhandler(yes, skproducts); _completionhandler = nil; } -(void)request:(skrequest *)request didfailwitherror:(nserror *)error { nslog(@"failed load list of products."); _productsrequest = nil; _completionhandler(no, nil); _completionhandler = nil; }
my problem every time calls didfailwitherror method never called didreceiveresponse method. hope me. in advance.
Comments
Post a Comment