我的应用内购买适用于iPad iOS 5.1而不适用于iPhone 4.1

时间:2012-08-27 18:18:06

标签: ios in-app-purchase

我已成功在iPad iOS 5.1沙盒环境中设置应用内购买,但是,它无法在iPhone 4.1上运行。我的iPhone 4.1是jailbrocken。在iPhone上运行时,控制台会在代码中显示消息No product available,即count =0

-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
    SKProduct *validProduct=nil;
    int count=[response.products count];
    if (count>0) {
        validProduct=[response.products objectAtIndex:0];
        NSLog(@"Product available");

    }else if(!validProduct){
        NSLog(@"No product available");
    }
}

你对此有什么经验吗? “jailbroken”iPhone会导致这个问题吗?

由于

更新

这是我的purchase功能:

-(void)purchase{
    SKMutablePayment *payment = [[[SKMutablePayment alloc] init] autorelease];
    payment.productIdentifier =MY_PRODUCT_ID;
    payment.quantity = 1;
    [[SKPaymentQueue defaultQueue] addPayment:payment];
}

0 个答案:

没有答案