Mercurial > public > geoquiz
comparison GeoQuiz/GeoQuizApp.swift @ 11:039b26a99a48
implementing RevenueCat
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Sun, 09 Oct 2022 17:02:34 +0200 |
parents | 413e2d21333e |
children | ce7ea84f67f5 |
comparison
equal
deleted
inserted
replaced
10:a793f33f05fb | 11:039b26a99a48 |
---|---|
4 // | 4 // |
5 // Created by Dennis Concepción Martín on 4/9/22. | 5 // Created by Dennis Concepción Martín on 4/9/22. |
6 // | 6 // |
7 | 7 |
8 import SwiftUI | 8 import SwiftUI |
9 import RevenueCat | |
9 | 10 |
10 @main | 11 @main |
11 struct GeoQuizApp: App { | 12 struct GeoQuizApp: App { |
13 | |
14 init() { | |
15 Purchases.configure(withAPIKey: "appl_BymTxroeoaWiXAraaFjcPlHlqbf") | |
16 } | |
17 | |
12 var body: some Scene { | 18 var body: some Scene { |
13 WindowGroup { | 19 WindowGroup { |
14 ContentView() | 20 ContentView() |
21 .onAppear(perform: testRevenueCat) | |
22 } | |
23 } | |
24 | |
25 private func testRevenueCat() { | |
26 Purchases.shared.getOfferings { (offerings, error) in | |
27 if let packages = offerings?.current?.availablePackages { | |
28 // Display packages for sale | |
29 print(packages) | |
30 } | |
15 } | 31 } |
16 } | 32 } |
17 } | 33 } |