I’ve implemented RevenueCat on iOS, following the onboarding guide, and my app has been rejected.
struct MainApp: App {
@AppStorage("isPaying") var isPaying = false
// inject into SwiftUI life-cycle via adaptor !!!
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
init() {
Purchases.logLevel = .debug
Purchases.configure(withAPIKey: "***", appUserID: nil)
}
...
}
// in PaymentsView
Purchases.shared.purchase(package: package) { (transaction, customerInfo, error, userCancelled) in
isLoading = false
print(customerInfo)
if customerInfo?.entitlementsn"pro_entitlement"]?.isActive == true {
isPaying = true
}
}