简体   繁体   中英

How to hide my waiting screen when In app purchase UIAlertView is show?

I've added an UIAlertView that has UIActivityIndicatior as a subview on my application. This alertView only show when the purchase is in progress. How to hide my waiting screen when In app purchase UIAlertView is show?

在应用内购买UIAlertView

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchasing:
                [self stillPurchasing]; // this show a waiting screen
                break;
            case SKPaymentTransactionStatePurchased:
                NSLog(@"2");
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                 NSLog(@"4");
                [self restoreTransaction:transaction];
                break;
            default:
                NSLog(@"5");
                break;
        }
    }
}

Thank you.

如果您保留它直到购买操作完全完成,这将更加有用。.这意味着在情况1(SKPaymentTransactionStatePurchased)中,您隐藏了指标,也不要忘记隐藏它,以防购买失败。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM