Skip to main content
Question

Losing subscription status after sometime in sandbox mode

  • February 4, 2025
  • 3 replies
  • 28 views

Forum|alt.badge.img+2

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?

This post has been closed for comments

Forum|alt.badge.img+2
  • New Member
  • February 5, 2025

I just noticed the “Expires” column, I’m guessing this by default gets set to something really low for sandbox mode?


Forum|alt.badge.img+2
  • New Member
  • February 5, 2025

I also see that by default the purchase keeps getting renewed every hour? 
 

I’m not renewing this manually, then after about 10 renewals, it stops and I lose my subscription status. I’m guessing this is just a feature of sandbox mode, but please let me know if I’m wrong.

 


joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6

Hi ​@ben-dev,

You are correct, this is intentional in sandbox and it’s a feature done by the App Store. You have a shorter renewal rate so it’s easier to test all the different cases, as well as automatic renewal for several times and then it auto-cancels as well.

It looks like you’ve develop it successfully and it works as expected!

 

Best,


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings