Ios 版主查看我的应用时,应用内购买不起作用

Ios 版主查看我的应用时,应用内购买不起作用,ios,objective-c,xcode,in-app-purchase,appstore-approval,Ios,Objective C,Xcode,In App Purchase,Appstore Approval,我第一次做IAP。我已经创建了测试用户,并且在SandboxEnv中运行良好。我可以看到我的购买并购买它(当然我还添加了StoreKit框架),但问题是:当我将带有IAP的更新上载到AppStore时,主持人拒绝了我的应用,原因如下: 我们发现,虽然您已提交应用程序的应用程序内购买产品,但二进制文件中不存在应用程序内购买功能。有关更多信息,请参阅所附的屏幕截图。(屏幕上没有购买内容,请留空) 如果你想在你的应用中使用应用内购买,你需要上传一个包含应用内购买API的新二进制文件,以便用户进行购买

我第一次做IAP。我已经创建了测试用户,并且在SandboxEnv中运行良好。我可以看到我的购买并购买它(当然我还添加了StoreKit框架),但问题是:当我将带有IAP的更新上载到AppStore时,主持人拒绝了我的应用,原因如下:

我们发现,虽然您已提交应用程序的应用程序内购买产品,但二进制文件中不存在应用程序内购买功能。有关更多信息,请参阅所附的屏幕截图。(屏幕上没有购买内容,请留空)

如果你想在你的应用中使用应用内购买,你需要上传一个包含应用内购买API的新二进制文件,以便用户进行购买

我只是不明白这怎么可能?为什么当我测试IAP时,它工作得很好,但当版主这样做时它就不工作了?所有IAP都具有“已批准出售”和“等待审查”状态

现在,如果我上传应用到商店IAP会工作吗?或者我之前需要做一些额外的动作

这是我的密码:

- (void)viewDidLoad
{
    [super viewDidLoad];
    _iapArray = [[NSMutableArray alloc] init];
    iap1 = @"com.mypurchase.addcoins1";

    [self paymentCheck];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];
}

- (void)paymentCheck{

    if([SKPaymentQueue canMakePayments]){
        NSLog(@"User can make payments");

        SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObjects:iap1, nil]];
        productsRequest.delegate = self;
        [productsRequest start];

    }
    else{
        NSLog(@"User cannot make payments due to parental controls");
        //this is called the user cannot make payments, most likely due to parental controls
    }
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
    SKProduct *validProduct = nil;
    int count = [response.products count];
    if(count > 0){

        _iapArray = response.products;
        indicator.hidden = YES;
        [self.tableView reloadData];
    }
    else if(!validProduct){
        NSLog(@"No products available");

        UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Error"
                                                              message:@"Error"
                                                             delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [myAlertView show];
        //this is called if your product id is not valid, this shouldn't be called unless that happens.
    }
}


- (IBAction)purchase:(SKProduct *)product{
    SKPayment *payment = [SKPayment paymentWithProduct:product];
    [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
    [[SKPaymentQueue defaultQueue] addPayment:payment];
}

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions{
    for(SKPaymentTransaction *transaction in transactions){
        switch (transaction.transactionState){
            case SKPaymentTransactionStatePurchasing: NSLog(@"Transaction state -> Purchasing");
                //called when the user is in the process of purchasing, do not add any of your own code here.
                break;
            case SKPaymentTransactionStatePurchased:
                //this is called when the user has successfully purchased the package (Cha-Ching!)
                // [self doRemoveAds]; //you can add your code for what you want to happen when the user buys the purchase here, for this tutorial we use removing ads
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                NSLog(@"Transaction state -> Purchased - %@", transaction.payment.productIdentifier);

                if ([transaction.payment.productIdentifier isEqualToString:iap1]) {
                    [self addCoins:5];
                }

                break;
            case SKPaymentTransactionStateRestored:
                NSLog(@"Transaction state -> Restored");
                //add the same code as you did from SKPaymentTransactionStatePurchased here
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                //called when the transaction does not finnish
                if(transaction.error.code != SKErrorPaymentCancelled){
                    NSLog(@"Transaction state -> Cancelled");
                    //the user cancelled the payment ;(
                }
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                break;
        }
    }
}

根据他们的回复,您已将IAP集成到应用程序中,但尚未使用它。所以,你们能确保你们已经在应用程序中正确地集成了IAP吗?如果他们提到,请使用相同的设备和iOS进行测试。

我怀疑审核人不知道如何在你的应用程序中进行购买。应用内购买屏幕截图是否清楚显示了如何访问您的商店?是否清楚如何在应用程序中进行购买?在itunes connect中检查应用程序内购买的状态?它处于待售状态吗?查看产品id。不,他们知道如何在我的应用程序中进行购买,但当他们打开IAP视图时-他们没有出现,只是出现错误-我猜-(void)productsRequest:(SKProductsRequest*)request DidReceiverResponse方法返回无效产品:(IAP有“等待审核”当我上传我的构建以供审查时的状态-是否正确?您是否同时提交了IAP产品以供审查(在中,它们已附加到提交版本)?这是第一次不一定明显的步骤,可能导致“无有效产品”在审查中,但沙箱中的一切都正常工作。如果你不知道我指的是什么,一旦你输入IAP条目,你必须转到iTC中应用程序的应用程序内购买部分进行连接。感谢你的回答!我更新了我的问题(添加了实现IAP的代码),已经足够制作IAP了?或者我还需要添加什么API?我已经添加了StoreKit.framework并编写了一个代码,实现了IAP,并且在我的设备上使用demo帐户运行良好,也许我错过了什么?