У меня проблемы с тестированием функции In App Purchase. Если я переустанавливаю приложение на устройство, на котором уже установлено приложение предыдущей версии, SKProductsRequest возвращает ответ только с объектом в invalidProductIdentifiers. Если я удалю приложение с устройства, а затем снова установлю новую версию, 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];
}