SKPayementQueue: restoring transactions finishes without calling 'updatedTransactions' in release config but not debug config

99封情书 提交于 2019-11-28 23:14:07

问题


I'm debugging restoring transactions and in my debug configuration everything works normally:

IE I call:

  [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

sometime later the queueCalls:

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

and sometime after that it calls:

- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {

and everyone is happy.

BUT in my release configuration, I never see the call to updatedTransactions and so I never actually restore the purchases.

possibly related, after I attempt the restore and it doesn't work. I restart the application and I find that I don't get a response when I ask the store for a product list.


回答1:


This error condition had nothing to do with the configuration. It is an intermittent bug in store kit.




回答2:


Carl, as you said it seems to be an intermittent bug. However, I have also found out that it doesn't happen (or at least I haven't seen it yet) if I test it using the US Store. I've been using a UK test user and today it was failing miserably every single time. Created a US test user, and, after being switched to the US store automatically, it works perfectly again. It is not a fix, but it may be useful ;)




回答3:


Do you add your payment object in the payment queue in this way?

SKPayment *payment = [SKPayment paymentWithProductIdentifier:"Your Product identifier"]; [[SKPaymentQueue defaultQueue] addPayment:payment];

If you are using this way,then the UpdatedTransactions is called right after adding the payment object in the payment queue.You dont have to call it explicitly.It is handeled by store kit.



来源:https://stackoverflow.com/questions/1726654/skpayementqueue-restoring-transactions-finishes-without-calling-updatedtransac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!