Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone 3G 4.2.1 - SKProductsRequest delegate methods not being called
    primarykey
    data
    text
    <p>My app <a href="http://itunes.apple.com/gb/app/fourfourtwo-football-stats/id453744566?mt=8" rel="nofollow">FourFourTwo Stats Zone</a> has just went live in the App Store this evening: </p> <p>I've asked a few people to test the In App Purchase and got successes on all devices except the iPhone 3G (running 4.2.1 - haven't tested with other iOS versions). I've tried debugging it on a device I have and it seems that none of the SKProductsRequest delegate methods are being called. Here's my code:</p> <pre><code>- (void)requestPurchaseOfCompetition:(Competition*)competition { DLog(""); if ([SKPaymentQueue canMakePayments]) { DLog(@"do store"); NSString* productIdentifier = [NSString stringWithFormat:@"%@%@_%@", kPRODUCT_IDENTIFIER_PREFIX, competition.competitionId, competition.season]; SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject:productIdentifier]]; [[NSNotificationCenter defaultCenter] postNotificationOnMainThread:[NSNotification notificationWithName:kStoreKitHandlerNotificationRequestProductInfo object:nil userInfo:[NSDictionary dictionaryWithObject:request forKey:@"request"]]]; request.delegate = self; [request start]; [request release]; } else { DLog(@"no store"); // Warn the user that purchases are disabled. UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Store", @"Store") message:NSLocalizedString(@"In app purchasing is disabled for this device (in Settings &gt; General &gt; Restrictions). Please enable this setting to purchase more competitions.", @"In app purchasing is disabled for this device (in Settings &gt; General &gt; Restrictions). Please enable this setting to purchase more competitions.") delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; [alertView release]; } } ... - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { DLog(@"response: %@", response); DLog(@"invalid product identifiers: %@", response.invalidProductIdentifiers); for (SKProduct *product in response.products) { DLog(@"product: %@", product); [[NSNotificationCenter defaultCenter] postNotificationOnMainThread:[NSNotification notificationWithName:kStoreKitHandlerNotificationGotProductInfo object:nil userInfo:[NSDictionary dictionaryWithObject:product forKey:@"product"]]]; SKPayment *payment = [SKPayment paymentWithProduct:product]; SKPaymentQueue *paymentQueue = [SKPaymentQueue defaultQueue]; [paymentQueue addTransactionObserver:self]; [paymentQueue addPayment:payment]; } } - (void)request:(SKRequest *)request didFailWithError:(NSError *)error { DLog(@"request failed: %@, %@", request, error); [[NSNotificationCenter defaultCenter] postNotificationOnMainThread:[NSNotification notificationWithName:kStoreKitHandlerNotificationRequestProductInfoFailed object:nil userInfo:[NSDictionary dictionaryWithObject:error forKey:@"error"]]]; } - (void)requestDidFinish:(SKRequest *)request { DLog(@"request finished: %@", request); } </code></pre> <p>None of the log messages in the three delegate methods are appearing.</p> <p>This works fine on 3GS, iPhone 4, iPad etc but not on the iPhone 3G running 4.2.1.</p> <p>Can anyone provide any insight?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload