2

我在应用购买中实施。一切都很好,但我的流程总是停在 SKPaymentTransactionStatePurchasing: 有人知道原因吗?请帮忙。

   - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
  {
NSLog(@"transactions........%@",transactions);
NSLog(@"transactions count........%d",[transactions count]);
NSLog(@"transactions description ........%@",transactions.description);

  [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];

for (SKPaymentTransaction *transaction in transactions)
{
    switch (transaction.transactionState)

    {
        case SKPaymentTransactionStatePurchased:
            [self completeTransaction:transaction];
            [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
             break;
        case SKPaymentTransactionStateFailed:
            [self failedTransaction:transaction];
            [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
            break;
        case SKPaymentTransactionStateRestored:
            [self restoreTransaction:transaction];
            [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
            break;
        case SKPaymentTransactionStatePurchasing:
            NSLog(@"purchasing");
         //   [self completeTransaction:transaction];
            break;
        default:
            NSLog(@"default case");
            break;
    }
   }
  }
4

1 回答 1

2

这可能是因为您正在调用:

[[SKPaymentQueue defaultQueue] removeTransactionObserver:self];  

通过调用它,您的应用将不再收到有关事务的其他更新的通知。尝试删除此行。

于 2013-10-02T05:19:06.317 回答