I have some restore transactions still stuck in my payments queue - because I never called finishTransaction
with the transaction once it was restored when I was testing a flawed restore purchases action.
From some online research, I realise I have to manually force unfinished transactions in my payments queue to finish.
Someone posted this code in Objective-C:
// take current payment queue
SKPaymentQueue* currentQueue = [SKPaymentQueue defaultQueue];
// finish ALL transactions in queue
[currentQueue.transactions enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[currentQueue finishTransaction:(SKPaymentTransaction *)obj];
}];
I have no idea how to convert it to Swift 2.0.
Can anyone pls help me do this? Thanks :-)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…