问题
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:
- Go to Settings\iTunes & App Stores, log out of any account, and try again so you’re sure you’re using a Sandbox account.
- Check this link – if it doesn’t respond, the iTunes sandbox may be down.
- Have you enabled In-App Purchases for your App ID?
- Does your project’s .plist Bundle ID match your App ID?
- Are you using the full product ID when when making an SKProductRequest?
- Have you waited several hours since adding your product to iTunes Connect?
- Are your bank details active on iTunes Connect?
- Have you tried deleting the app from your device and reinstalling?
- 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