RRN
RRN

Reputation: 1187

IAP doesn't work on Real iPad

When I run the following code in simulator, it can get the IAP info successfully, but when it run on a real IPAD, "count" always = zero ... any ideas what's wrong?? Thanks.

// Store Kit returns a response from an SKProductsRequest.
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {

// Populate the removeAdsButton button with the received product info.
SKProduct *validProduct = nil;
int count = [response.products count];
if (count>0) {
    validProduct = [response.products objectAtIndex:0];
}
if (!validProduct) {
    [removeAdsButton setTitle:@"No Products Available" forState:UIControlStateNormal];
    removeAdsButton.enabled = NO;
    return;
}

NSString *buttonText = [[NSString alloc] initWithFormat:@"%@ - Buy $%@", validProduct.localizedTitle, validProduct.price];
[removeAdsButton setTitle:buttonText forState:UIControlStateNormal];
removeAdsButton.enabled = YES;
[buttonText release];
}

Upvotes: 0

Views: 98

Answers (1)

RRN
RRN

Reputation: 1187

I found that if the device is JB, it won't work..

Upvotes: 1

Related Questions