Skip to main content

After I implement RevenueCat with Swift Package Manager, everything works fine till user verification process. I create a checkStatus function:

 

class SettingsController: UIViewController {

static var subscriptionStatus = false

 

Purchases.shared.getCustomerInfo {(customerInfo, error) in

            if let error = error {

                print("Get Customer Status Error: \(error.localizedDescription)")

            } else {

                if customerInfo?.entitlementsnRevenueCatAPI.entitlementID]?.isActive == true {

                    DispatchQueue.main.async {

                        SettingsController.subscriptionStatus = true

                        print(SettingsController.subscriptionStatus)

                    }

                } else {

                    DispatchQueue.main.async {

                        SettingsController.subscriptionStatus = false

                        print(SettingsController.subscriptionStatus)

                    }

                }

            }

        }

I need to reach that subscriptionStatus result from my mainViewController but it is imposible now. Before the implemantation I use lots of static variable any they still work and reachable but when I delete them I can’t add them again… Please Help Me?

Sometimes XCODE 15 frezing and not let you to call static variables from that page. You should restart the XCODE then if it is not work you have to close all the ViewController.swift page one by one. After that everything will be fixed.


Reply