SKProductsRequest delegate methods are never called [closed]

て烟熏妆下的殇ゞ 提交于 2019-11-28 07:24:40

问题


This used to work for me but is now not working anymore and I can't figure out why. I have in-app purchase setup in my app. I confirmed that I have a correct set of product identifiers, matched by corresponding in-app purchase items in itunesconnect. The call goes out to Apple view [productRequest start], but I never get a response back, despite setting the delegate to myself. What am I missing?

NSLog(@"productIdentifiersSet: %@", productIdentifiersSet);
if ([productIdentifiersSet count]) {
    SKProductsRequest *productRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiersSet];
    [productRequest setDelegate:self];
    [productRequest start];
}

………

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
   <never called>
}

- (void)requestDidFinish:(SKRequest *)request {
    <never called>
}

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
    <never called>
}

回答1:


The same problem happened to me today. In the morning my code was working, in the afternoon it didn't work for 3-4 hours. I spent all of my time and tried many things. But a little time before, it started working itself. I didn't change anything.

I suppose we can't trust apple servers about that..




回答2:


Here it's a good check list that can solve this issues:

  1. Go to Settings\iTunes & App Stores, log out of any account, and try again so you’re sure you’re using a Sandbox account.
  2. Check this link – if it doesn’t respond, the iTunes sandbox may be down.
  3. Have you enabled In-App Purchases for your App ID?
  4. Does your project’s .plist Bundle ID match your App ID?
  5. Are you using the full product ID when when making an SKProductRequest?
  6. Have you waited several hours since adding your product to iTunes Connect?
  7. Are your bank details active on iTunes Connect?
  8. Have you tried deleting the app from your device and reinstalling?
  9. After you've created your in app purchase products, remember to add those to your game-app in you app page in ituns connect.


来源:https://stackoverflow.com/questions/2923409/skproductsrequest-delegate-methods-are-never-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!