简体   繁体   English

处理iOS 7本机登录弹出窗口中的“取消”选择

[英]Handling the selection of Cancel in iOS 7 native login popup

I am writing some in-app purchase related code. 我正在编写一些与应用内购买相关的代码。 When I initiate the in-app purchase, iOS pops up a native login popup as shown in the image below. 当我启动应用内购买时,iOS会弹出本机登录弹出窗口,如下图所示。 I am also starting to animate a UIActivityIndicatorView. 我也开始为UIActivityIndi​​catorView设置动画。 If the user selects the Cancel option, I want to stop animating the UIActivityIndicatorView. 如果用户选择“取消”选项,则我想停止为UIActivityIndi​​catorView设置动画。 What is the way to handle the selection of Cancel in iOS 7 native login popup. 在iOS 7本机登录弹出窗口中处理“取消”选择的方法是什么。

iOS 7本机登录弹出窗口

The following function is not being called: 不调用以下函数:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
 - (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error 

above method get called when user presses cancel on restore alert. 当用户在还原警报上按“取消”时,将调用上述方法。

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
            default:
                break;
        }
    }
}

When user presses the cancel button SKPaymentTransactionStateFailed get called, 当用户按下取消按钮SKPaymentTransactionStateFailed被调用时,
NOTE: This is not always the case, this also get called for some other response also 注意:并非总是如此,这也需要其他响应

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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