diff LazyBear/Tests/RevenueCatTest.swift @ 423:bdfdf3a1b34e

Testing RevenueCat
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sun, 13 Jun 2021 19:40:18 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LazyBear/Tests/RevenueCatTest.swift	Sun Jun 13 19:40:18 2021 +0200
@@ -0,0 +1,32 @@
+//
+//  RevenueCatTest.swift
+//  LazyBear
+//
+//  Created by Dennis Concepción Martín on 13/6/21.
+//
+
+import SwiftUI
+import Purchases
+
+struct RevenueCatTest: View {
+    var body: some View {
+        Text("Hello world")
+            .onAppear { showOfferings() }
+    }
+    
+    private func showOfferings() {
+        Purchases.shared.offerings { (offerings, error) in
+            if let offerings = offerings {
+              // Display current offering with offerings.current
+                print(offerings.current as Any)
+                print("dennis")
+          }
+        }
+    }
+}
+
+struct RevenueCatTest_Previews: PreviewProvider {
+    static var previews: some View {
+        RevenueCatTest()
+    }
+}