2012-08-13 218 views
2

這是我第一次設置一個應用程序內購買,我卡住了。當我嘗試提出產品請求時,我收到錯誤「無效的產品ID:TVRBIBLIA001」。我在堆棧溢出中看到了幾個問題,尋找沒有成功的可能解決方案,所以我發佈了自己的。這是我的In App Purchase的設置。在應用程序內購買 - 無效的產品ID

In App Purchase Set Up 1 In App Purchase Set Up 2

這是我的代碼:

#pragma mark - 
#pragma mark Remove Ads InApp Purchase 
- (IBAction)requestRemoveAdsProductData 
{ 
    NSSet *productIdentifiers = [NSSet setWithObject:@"TVRBIBLIA001"]; 
    productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers]; 
    productsRequest.delegate = self; 
    [productsRequest start]; 

    // we will release the request object in the delegate callback 
} 

#pragma mark - 
#pragma mark SKProductsRequestDelegate methods 

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response 
{ 
    NSArray *products = response.products; 
    removeAdsProduct = [products count] == 1 ? [[products firstObject] retain] : nil; 
    if (removeAdsProduct) 
    { 
     NSLog(@"Product title: %@" , removeAdsProduct.localizedTitle); 
     NSLog(@"Product description: %@" , removeAdsProduct.localizedDescription); 
     NSLog(@"Product price: %@" , removeAdsProduct.price); 
     NSLog(@"Product id: %@" , removeAdsProduct.productIdentifier); 
    } 

    for (NSString *invalidProductId in response.invalidProductIdentifiers) 
    { 
     NSLog(@"Invalid product id: %@" , invalidProductId); 
    } 

    // finally release the reqest we alloc/init’ed in requestProUpgradeProductData 
    [productsRequest release]; 

    [[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerProductsFetchedNotification object:self userInfo:nil]; 
} 
+2

當我意識到只要語言保持未決狀態,您將無法從Store購買到有效的產品時,我遇到了同樣的問題。對你添加的語言做一個簡單的編輯,比如添加'。'。並再次檢查產品。您必須已提交您的應用程序inApp購買工作細節訪問http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/ – tGilani 2012-08-13 13:18:24

+0

@tGilani'。'去? http://imageshack.us/photo/my-images/155/screenshot20120813at093.png/ – 2012-08-13 13:36:05

回答

1

解決方案:從設備中刪除的應用程序並重新安裝ID。 Via

相關問題