productsRequest response method is not calling

后端 未结 4 2056
孤街浪徒
孤街浪徒 2021-02-12 22:30

I am implementing an in app purchase and I am sending the request to apple store through

- (void) requestProductData
{
 SKProductsRequest *request= [[SKProductsR         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-12 23:13

    I had the same problem. I had created a helper class to handle the IAP and check for the products. What I finally found was the instance of the class I created was being released before the response came back, thus the delegate methods never got called because they did not exist anymore.

    I solved my problem by retaining the instance of the helper class in the class I called it from using @proprty(strong, nonatomic)...

    If you are not using a helper class and coding it into an existing class then the answer above will work by retaining your SKProductRequest.

提交回复
热议问题