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?