简体   繁体   English

第一次更新交易,调用旧队列

[英]updatedTransactions first time, call old queue

Firs time i tried to make a subscription this function call for all transactions, but after then if i tried to subscribe it calls just 1 state. 第一次,我尝试为所有交易进行此功能的订阅,但是之后,如果我尝试进行订阅,则仅调用1状态。 This code same as in apple developer documentation 此代码与Apple开发人员文档中的代码相同

- (void)paymentQueue:(SKPaymentQueue *)queue
 updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions) {
             switch (transaction.transactionState) {
        case SKPaymentTransactionStatePurchasing:
                NSLog(@"purchasing in progress");
                break;
            case SKPaymentTransactionStateDeferred:
                NSLog(@"Stade deferred");
                break;
            case SKPaymentTransactionStateFailed:
                NSLog(@"State failed");
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                break;
            case SKPaymentTransactionStatePurchased:
                NSLog(@"Sucsess purchased");
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                NSLog(@"restored");
                break;
            default:
                // For debugging
                NSLog(@"Unexpected transaction state %@",@(transaction.transactionState));
                break;
        }
    }
}

updatedTransactions is called only for updated transactions (see Apple docs https://developer.apple.com/library/prerelease/ios/documentation/StoreKit/Reference/SKPaymentTransactionObserver_Protocol/ ) 只为更新的事务调用updatedTransactions(请参阅Apple文档https://developer.apple.com/library/prerelease/ios/documentation/StoreKit/Reference/SKPaymentTransactionObserver_Protocol/

transactions - An array of the transactions that were updated. 交易-已更新的交易的数组。

But on application start or first purchase iOS sends every transaction from SKPaymentQueue: defaultQueue. 但是在应用程序启动或首次购买时,iOS会从SKPaymentQueue发送所有交易:defaultQueue。

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/DeliverProduct.html : Terminate and relaunch your app. https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/DeliverProduct.html :终止并重新启动您的应用程序。 Store Kit calls the paymentQueue:updatedTransactions: method again shortly after launch; 启动后不久,Store Kit再次调用paymentQueue:updatedTransactions:方法; this time, let your app respond normally. 这次,让您的应用正常响应。 Verify that your app correctly delivers the product and completes the transaction 验证您的应用正确交付了产品并完成了交易

So if app should view all transactions, it should request SKPaymentQueue: defaultQueue. 因此,如果应用程序应查看所有交易,则应请求SKPaymentQueue:defaultQueue。

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

相关问题 paymentQueue:(SKPaymentQueue *)队列updatedTransactions :( NSArray *)事务在restoreCompletedTransactions时不被调用 - paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions is not called while restoreCompletedTransactions 在-(void)paymentQueue:(SKPaymentQueue *)queueupdatedTransactions:(NSArray *)事务之后,如何处理所有事务? - What to do with all transactions after - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions? HTTP调用第一次运行,但是永远等待 - HTTP call runs first time but then waits forever 尝试调用`didSelectRowAtIndexPath`但第一次没有调用 - Try to call `didSelectRowAtIndexPath` but not called for first time 为什么从不调用 updateTransactions? - Why is updatedTransactions never called? iOS IAP paymentQueue:updatedTransactions - iOS IAP paymentQueue:updatedTransactions SKPaymentQueue updatedTransactions未被调用 - SKPaymentQueue updatedTransactions not being called paymentQueueRestoreCompletedTransactions完成:vs updatedTransactions: - paymentQueueRestoreCompletedTransactionsFinished: vs updatedTransactions: 从队列中删除旧的SKPayment - Remove Old SKPayment From Queue UIImageView第一次显示图像然后突然回到Swift3中的旧图像 - UIImageView shows the image for first time and then suddenly goes back to the old image in Swift3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM