Solved

Eligibility of introductory offers is not shown correctly in iOS sandbox account

  • 3 March 2024
  • 5 replies
  • 101 views

Badge +2

The following code published at https://www.revenuecat.com/docs/subscription-guidance/subscription-offers#checking-eligibility is unable to detect the trial offer eligibility correctly in the sandbox environment. Is there any solution to this? Thank you! 

Purchases.shared.getOfferings { offerings, error in
if let product = offerings?.current?.availablePackages.first?.storeProduct {
Purchases.shared.checkTrialOrIntroDiscountEligibility(product: product) { eligibility in
if eligibility == .eligible {
// show trial/introductory terms
} else {
// user is not eligible, show non-trial/introductory terms
}
}
}
}

icon

Best answer by sharif 6 March 2024, 18:14

View original

This post has been closed for comments

5 replies

Same problem.

Sandbox App Store Interface shows that user has 1-week free trial, but RevenueCat Debug shows that IntroEligibilityStatus.ineligible.

 

 

Userlevel 5
Badge +9

Hello all,

I’m not sure if both of you have the same issues - @jbb-8532ff can you provide some screenshots and debug logs so I can take a look?

@mineemeel it looks like the sandbox user already redeemed the free trial, is that correct? If so, the user is no longer eligible for the trial.

But if the log is from before you redeemed the trial, it’s possible that’s due to sandbox issues. The receipt is not available when you first install the app from Xcode which means RevenueCat can’t check the intro eligibility. The solution to this is to make a purchase to force the device to generate a receipt, which can make testing difficult. I recommend two options:

  1. Make a consumable product that’s only available in sandbox (meaning don’t publish it to the App Store) and purchase that whenever you need a real receipt on the device. Then check for intro eligibility.
  2. Try using StoreKitTest, which mocks Apple’s systems and can work better: https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store#ios-14-only-testing-on-the-simulator

Hello all,

I’m not sure if both of you have the same issues - @jbb-8532ff can you provide some screenshots and debug logs so I can take a look?

@mineemeel it looks like the sandbox user already redeemed the free trial, is that correct? If so, the user is no longer eligible for the trial.

But if the log is from before you redeemed the trial, it’s possible that’s due to sandbox issues. The receipt is not available when you first install the app from Xcode which means RevenueCat can’t check the intro eligibility. The solution to this is to make a purchase to force the device to generate a receipt, which can make testing difficult. I recommend two options:

  1. Make a consumable product that’s only available in sandbox (meaning don’t publish it to the App Store) and purchase that whenever you need a real receipt on the device. Then check for intro eligibility.
  2. Try using StoreKitTest, which mocks Apple’s systems and can work better: https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store#ios-14-only-testing-on-the-simulator
  1. If the sandbox user is no longer eligible, why can I subscribe to it for free on the first screenshot? Two screenshots were taken at the same time.
  2. What about function to reset eligibility for sandbox users? I used it to reset the user eligibility

 

upd. make a consumable product helps. Thanks!

Badge +2

One thing I’ve noticed that quite a few customers listed under RevenueCat Sandbox are shown with a subscription expiration date which actually ends one month later, instead of just 5 minutes since start, the setting under the sandbox; hence, all those customers are still shown active with their initial subscription. 

 

I wonder how it happened. I sometimes tested with a simulator, sometimes with a device; and also alternated between the scheme with or without storekit config. In doing so, did I accidentally bypassed the testing in sandbox only? 

 

I’m new to the subscription area. Any guidance is greatly appreciated!

 

 

 

Badge +2

Update: After researching in this forum, I found out the reason - for the simulator testing, the renewal time need to be shortened inside Storekit config; app store setting doesn’t have the effect.