2011-03-29 67 views
4

我在測試In App Purchase功能時遇到問題。如果我在已安裝了以前版本的應用的設備上重新安裝應用,則SKProductsRequest僅返回invalidProductIdentifiers上的對象的響應。如果我從設備上刪除應用程序,然後再次安裝新版本,SKProductsRequest可以正常工作。應用程序購買的SKProductsRequest在設備上已安裝應用程序時不起作用

任何想法?

在此先感謝。

- (void)requestProductData:(NSString *)aFeatureID {  
    SLLog(@"Products Request For: %@", aFeatureID); 
    SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:aFeatureID]]; 
    request.delegate = self; 
    [request start]; 
} 

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response 
{ 
    if ([response.products count] > 0) {   
     [self.purchasableObjects addObjectsFromArray:response.products]; 

#ifndef NDEBUG 
     for(int i=0;i<[self.purchasableObjects count];i++) 
     {  
      SKProduct *product = [self.purchasableObjects objectAtIndex:i]; 
      SLLog(@"Feature: %@, Cost: %f, ID: %@",[product localizedTitle], 
        [[product price] doubleValue], [product productIdentifier]); 
     } 

     for(NSString *invalidProduct in response.invalidProductIdentifiers) 
      SLLog(@"Problem in iTunes connect configuration for product: %@", invalidProduct); 
#endif 
     isProductsAvailable = YES; 
    } else if ([response.invalidProductIdentifiers count] > 0){ 
     SLLog(@"MKStoreManager-productsRequest empty results: %@", [response.invalidProductIdentifiers objectAtIndex:0]); 
    } 
    if([_delegate respondsToSelector:@selector(productFetchComplete)]) 
     [_delegate productFetchComplete]; 
    [request autorelease]; 
} 
+0

似乎有人有同樣的問題。如果我的描述不夠清楚,請仔細閱讀。 http://lists.apple.com/archives/cocoa-dev/2011/Mar/msg00349.html – mikywan 2011-03-29 20:51:42

回答

6

這是有人告訴我在[email protected]

你連接到沙箱環境 或生產?

我相信當通過Xcode的推出, 如果應用程序正在從 的App Store版本「升級」,也不會觸發 沙盒,你只能連接到 沙箱。至少,這是我見過的IAP伏都教的一小部分 ...... 這意味着它可能在任何時候都不再是真實的 ,因爲IAP的設置是一個 遠離 魔法的犧牲羔羊。

我對此沒有%100肯定,因爲我還沒有測試過,但我會盡快告訴你。

+0

是的 - 確認您在通過Xcode構建「升級」應用商店安裝時沒有返回產品。讓我發瘋了! – 2012-02-01 02:55:44

+0

謝謝。我的腦子在這一個上。啊。蘋果... – FreeAsInBeer 2012-03-02 16:24:08

+0

我來專門尋找這個問題,這可能是我的修復。稍後我會回覆評論結果。我在iPhone上的App Store上有一個應用程序,但沒有在我的iPad上。在iPhone上獲得無效產品但不是iPad,但該應用程序在iPad上並不存在。 – Justin 2012-03-26 20:52:23

相關問題