|
@@ -39,22 +39,18 @@ SwiftyStoreKit supports this by calling `completeTransactions()` when the app st
|
|
|
|
|
|
```swift
|
|
```swift
|
|
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
|
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
|
-
|
|
|
|
- SwiftyStoreKit.completeTransactions(atomically: true) { purchases in
|
|
|
|
-
|
|
|
|
- for purchase in purchases {
|
|
|
|
-
|
|
|
|
- if purchase.transaction.transactionState == .purchased || purchase.transaction.transactionState == .restored {
|
|
|
|
-
|
|
|
|
- if purchase.needsFinishTransaction {
|
|
|
|
- // Deliver content from server, then:
|
|
|
|
- SwiftyStoreKit.finishTransaction(purchase.transaction)
|
|
|
|
- }
|
|
|
|
- print("purchased: \(purchase)")
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return true
|
|
|
|
|
|
+ SwiftyStoreKit.completeTransactions(atomically: true) { purchases in
|
|
|
|
+ for purchase in purchases {
|
|
|
|
+ if purchase.transaction.transactionState == .purchased || purchase.transaction.transactionState == .restored {
|
|
|
|
+ if purchase.needsFinishTransaction {
|
|
|
|
+ // Deliver content from server, then:
|
|
|
|
+ SwiftyStoreKit.finishTransaction(purchase.transaction)
|
|
|
|
+ }
|
|
|
|
+ print("purchased: \(purchase)")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true
|
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|