|
@@ -32,11 +32,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
|
|
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
|
|
|
|
|
|
|
|
+ verifyReceipt()
|
|
|
|
+
|
|
completeIAPTransactions()
|
|
completeIAPTransactions()
|
|
-
|
|
|
|
|
|
+
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ func verifyReceipt() {
|
|
|
|
+
|
|
|
|
+ SwiftyStoreKit.verifyReceipt(password: "your-shared-secret") { result in
|
|
|
|
+ switch result {
|
|
|
|
+ case .success(let receipt):
|
|
|
|
+ print("\(receipt)")
|
|
|
|
+ case .error(let error):
|
|
|
|
+ if case .noReceiptData = error {
|
|
|
|
+ SwiftyStoreKit.refreshReceipt { result in }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
func completeIAPTransactions() {
|
|
func completeIAPTransactions() {
|
|
|
|
|
|
SwiftyStoreKit.completeTransactions() { completedTransactions in
|
|
SwiftyStoreKit.completeTransactions() { completedTransactions in
|