当应用内购买 UIAlertView 显示时如何隐藏我的等待屏幕?

发布于 2025-01-01 17:51:20 字数 1129 浏览 0 评论 0原文

我添加了一个 UIAlertView,其中 UIActivityIndi​​catior 作为我的应用程序的子视图。此警报视图仅在购买正在进行时显示。当应用内购买 UIAlertView 显示时如何隐藏我的等待屏幕?

应用内购买 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;
        }
    }
}

谢谢。

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?

In app purchase 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

草莓酥 2025-01-08 17:51:20

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

it will be more useful if you keep it until the purchase operation is fully completed .. thats mean in case 1 (SKPaymentTransactionStatePurchased) you hide the indicatore ,, also dont forget to hide it in case the purchase failed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文