menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Design+Code

A place to learn iOS 11 design and code. Some of the topics we focus on are Sketch, SwiftUI, Swift, React, React Native, Vuejs, Figma design system, Framer and Framer Playground, ARKit, SpriteKit, Unity, etc.

Channels
Team

Does anyone have experience with SwiftyStoreKit?

December 19, 2018 at 9:15am

Does anyone have experience with SwiftyStoreKit?

December 19, 2018 at 9:15am
I can't really find any detailed explanation on this, but how can I trigger the following callback from SwiftyStoreKit. Also, it is only necessary to call finishTransaction, if your app is downloading content from a server?
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in
for purchase in purchases {
switch purchase.transaction.transactionState {
case .purchased, .restored:
if purchase.needsFinishTransaction {
// TODO: Set flags here that the user has now purchased the product
SwiftyStoreKit.finishTransaction(purchase.transaction)
}
// Unlock content
case .failed, .purchasing, .deferred:
break // do nothing
}
}
}
No messages yet