我有一个正在审核的应用程序被拒绝,动机说:
2.2 应用仍未正确使用 Store Kit API。它没有从 App Store 的服务器获取定价信息(见屏幕截图)。使用 Store Kit,应用程序应该向 App Store 发送请求,以检索当前可供购买的产品标识符列表。一旦应用程序收到此列表,它应该只显示那些标记为可供购买的产品。应用程序不会向 App Store 发出此请求,而是显示服务器直接返回的产品。
这是截图
我真的不明白我需要做什么......对我来说,一切正常,我也不明白为什么他们说“产品直接由我的服务器返回”......这不像那....我将向您展示我的代码:
-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
if(response.products.count > 0)
{
SKProduct* product;
for(int i = 0; i<response.products.count; i++)
{
product = [response.products objectAtIndex:i];
if([product.productIdentifier isEqualToString:@"com.mySite.MyApp.1"] || [product.productIdentifier isEqualToString:@"com.mySite.MyApp.2"] || [product.productIdentifier isEqualToString:@"com.mySite.MyApp.3"] || [product.productIdentifier isEqualToString:@"com.mySite.MyApp.4"] || [product.productIdentifier isEqualToString:@"com.mySite.MyApp.5"])
{
self.currentProduct = product;
[self beginPaymentWithProduct:product];
}
}
}
}
- (void)beginPaymentWithProduct:(SKProduct*)product
{
SKPayment *payment = [SKPayment paymentWithProduct:product];
[[SKPaymentQueue defaultQueue] addPayment:payment];
}
- (BOOL)canMakePurchases
{
return [SKPaymentQueue canMakePayments];
}
- (IBAction)buyProduct1:(id)sender
{
if([self canMakePurchases])
{
self.prodottoScelto = @"1";
[moneteAcquistateLabel setStringValue:@"25"];
ualRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:[NSArray arrayWithObjects: @"com.mySite.MyApp.1", nil]]];
[ualRequest setDelegate:self];
[ualRequest start];
}
}
- (IBAction)buyProduct2:(id)sender
{
//same code as below
}
- (IBAction)buyProduct3:(id)sender
{
//same code as below
}
- (IBAction)buyProduct4:(id)sender
{
//same code as below
}
- (IBAction)buyProduct5:(id)sender
{
//same code as below
}
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction* transaction in transactions) {
if (transaction.transactionState == SKPaymentTransactionStatePurchased) {
// NSLog(@"Transaction Purchased: %@", transaction);
// Make purchase available to the user, etc...
//assegno le monete acquistate all'utente
if ([prodottoScelto isEqual:@"1"])
{
// NSLog(@"prodotto 1 sbloccato");
[self aggiornaMonete:25];
}
else if ([prodottoScelto isEqual:@"2"])
{
// NSLog(@"prodotto 2 sbloccato");
[self aggiornaMonete:60];
}
else if ([prodottoScelto isEqual:@"3"])
{
// NSLog(@"prodotto 3 sbloccato");
[self aggiornaMonete:105];
}
else if ([prodottoScelto isEqual:@"4"])
{
// NSLog(@"prodotto 4 sbloccato");
[self aggiornaMonete:160];
}
else if ([prodottoScelto isEqual:@"5"])
{
// NSLog(@"prodotto 5 sbloccato");
[self aggiornaMonete:225];
}
// Once that's all done...
[queue finishTransaction:transaction];
}
else if (transaction.transactionState == SKPaymentTransactionStateFailed) {
//NSLog(@"Transaction Failed: %@", transaction);
// Display error to the user, using the error text in the transaction
// This example uses NSLog, typically you'd use UIAlertView here
// NSLog(@"Error: %@", [transaction.error localizedDescription]);
}
}
}
我应该添加什么?同样的代码在iOS应用程序中运行良好......感谢您的帮助