I’m testing my app and purchases with RevenueCat in sanbox mode and I’ve noticed that often after not using the app for about a day my subscription status will revert back to free mode. I’m using a boolean in a view controller to track subscription status and on launch call this function to update that bool
@MainActor
func updateCustomerInfo() async {
do {
let customerInfo = try await Purchases.shared.customerInfo()
self.customerInfo = customerInfo
// Check if user has pro access
isPro = customerInfo.entitlements"Lectura Pro"]?.isActive == true
} catch {
self.error = error.localizedDescription
}
}
Also at app launch in my delegate I try to init the RevenueCat config with firebase auth id, and if it’s not available i use anonymous id:
if let user = Auth.auth().currentUser {
Purchases.configure(withAPIKey: Secrets().revenueCatProjectKey, appUserID: user.uid)
print("on app launch and we are setting up revenue cat with firebase auth id")
} else {
Purchases.configure(withAPIKey: Secrets().revenueCatProjectKey)
print("we don't have the auth user, using anonymous id for revenue cat. Call the login function later")
}
When I’m logged in to the same firebase auth account, and after a day or so, my pro subscription will revert back to a free account. The restore purchases function also doesn’t restore the status, and if I purchase the pro account, it doesn’t mention that I already had made the purchase.
Is this just behavior in sandbox mode? Is there also a better way for me to test the behavior of this once the app is on the app store?