我有應用內購買的問題。在向服務器發送請求後,沒有由SKProductsRequest
返回的產品。IAP問題 - 沒有產品響應。產品陣列
我發送類似這樣的要求:
NSMutableSet *identificators = [[NSMutableSet alloc] init];
[identificators addObject:kInAppPurchaseOneWeekIdentifier];
[identificators addObject:kInAppPurchaseOneMonthIdentifier];
[identificators addObject:kInAppPurchaseSixMonthsIdentifier];
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:identificators];
request.delegate = self;
[request start];
[identificators release];
在Consts.h我有那些
// In App Purchase
#define kInAppPurchaseOneWeekIdentifier @"com.astroboxapp.iap.OneWeek"
#define kInAppPurchaseOneMonthIdentifier @"com.astroboxapp.iap.OneMonth"
#define kInAppPurchaseSixMonthsIdentifier @"com.astroboxapp.iap.SixMonths"
在我的課,我實現
-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
if ([response.products count] > 0) {
// i've do my stuff - show the IAP to the user
} else {
// here goes the error handling
}
}
在我的案例[response.products count]
是空陣列/字典,所以我 拋出一個錯誤。
編輯:我做了什麼?
我創建了一個新的IAP的,並與我的應用程序相關聯,我已經改變了產品標識也和改變他們在我的Consts.h
我試圖從改變應用程序的版本以某種方式1.0到1.1幫助我改變這個版本的IAP。
仍然沒有在我的設備上工作,而在模擬器中有我的IAP的條目,但我可以測試 - 因爲StoreKit不允許從sumulator測試購買。
在我的設備上,我從商店退出。
- (空)productsRequest:(SKProductsRequest *)請求didReceiveResponse:(SKProductsResponse *)響應返回您蘋果服務器的響應,您確定您的產品標識符與您在曲調中連接的響應相同。 – 2012-08-11 12:16:27
你的意思是? :) – h4cky 2012-08-11 12:17:36
問題是,您可以在iTunes連接中定義某些產品,以便客戶下載,還需要在您的應用程序中本地存儲Therese產品的標識符。當您在應用程序購買中請求可用時,會發送本地標識符到蘋果,並與您在iTunes連接中定義的相比較。 – 2012-08-11 12:20:27