6

我使用我的测试用户购买了非消耗品,但是当我调用它时:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

我在 paymentQueueRestoreCompletedTransactionsFinished 中看不到任何交易。代码如下所示:

- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
{
    NSLog(@"received restored transactions: %i", queue.transactions.count);
    for (SKPaymentTransaction *transaction in queue.transactions)
    {
        [self restoreTransaction:transaction];
    }

    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Your add-ons have been restored." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alertView show];
    return;
}

日志总是显示“received restore transactions: 0”,但我希望看到一个事务。有谁知道为什么交易没有被退回?

4

1 回答 1

7

现在它突然开始工作了!我只改变了一件事,那就是进入 iTunes Connect 并编辑我的产品描述,这样状态就会从“拒绝”变为“待定”。奇怪的是,购买仍然有效(即使处于“拒绝”状态),只有恢复不起作用。我尝试在更改后立即恢复,但没有成功,但现在(大约 20 分钟后),恢复正常。更改为挂起必须已修复它(在更改有一段时间传播到 StoreKit 服务器之后),否则这是某种间歇性 StoreKit 错误。

于 2012-06-16T01:14:49.613 回答