如何在等待应用内购买商店加载后停止 uiactivityindicator

发布于 2024-12-27 11:24:48 字数 1241 浏览 0 评论 0原文

我认为其中之一可以做到这一点,但没有一个被调用 -_-

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    NSLog(@"flag paymentQueue");

// spinner.hidden=YES; //这去哪儿了?

    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchasing:
            //    [self stillPurchasing]; // this creates an alertView and shows
                NSLog(@"flag SKPaymentTransactionStatePurchasing");

                break;
            case SKPaymentTransactionStatePurchased:
                NSLog(@"flag SKPaymentTransactionStatePurchased");

                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                NSLog(@"flag SKPaymentTransactionStateFailed");

                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                NSLog(@"flag SKPaymentTransactionStateRestored");

                [self restoreTransaction:transaction];
           //     spinner.hidden=YES;
                break;

谢谢!!!

I thought one of these would do it, none of them are getting called -_-

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    NSLog(@"flag paymentQueue");

// spinner.hidden=YES; //where does this go?

    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchasing:
            //    [self stillPurchasing]; // this creates an alertView and shows
                NSLog(@"flag SKPaymentTransactionStatePurchasing");

                break;
            case SKPaymentTransactionStatePurchased:
                NSLog(@"flag SKPaymentTransactionStatePurchased");

                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                NSLog(@"flag SKPaymentTransactionStateFailed");

                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                NSLog(@"flag SKPaymentTransactionStateRestored");

                [self restoreTransaction:transaction];
           //     spinner.hidden=YES;
                break;

thanks!!!

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

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

发布评论

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

评论(2

失去的东西太少 2025-01-03 11:24:48

您可以通过以下方法隐藏微调器 -

    - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
      [target hideSpinner];
     }

You can hide spinner in following method-

    - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
      [target hideSpinner];
     }
柠檬心 2025-01-03 11:24:48

应该不错。在以下 3 种情况下,您应该隐藏微调器:
- SKPaymentTransactionStatePurchased
- SKPaymentTransactionStateFailed
- SKPaymentTransactionStateRestored

您检查过您的代表吗?
你的类应该实现以下委托方法:
-> SKPaymentTransactionObserver

我的声明如下:
@interface InAppPurchaseStoreManager : NSObject

it should be good. You should hide your spinner in the 3 cases :
- SKPaymentTransactionStatePurchased
- SKPaymentTransactionStateFailed
- SKPaymentTransactionStateRestored

Have you checked your delegates ?
your class should implement the delegate method of :
-> SKPaymentTransactionObserver

Mine is declared like that :
@interface InAppPurchaseStoreManager : NSObject

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