purchases-ios
purchases-ios copied to clipboard
Cannot get the active entitlements in `Sandbox` environment when having same type of entitlements in `Prod`.
- [X] I have updated Purchases SDK to the latest version
- [X] I have read the Contribution Guidelines
- [X] I have searched the Community
- [X] I have read docs.revenuecat.com
- [X] I have searched for existing Github issues
Describe the bug
The user data in prod
environment will override the sandbox
environment for active entitlements. I have same entitlements type(not exactly same as different expire dates.) in both prod
and sandbox
env when using customerInfo?.entitlements.activeInAnyEnvironment
I can only get the prod
env active entitlements. Which is fine. But when using customerInfo?.entitlements.activeInCurrentEnvironment
I get no active entitlements no, as empty.
- Environment
- Platform: iOS
- SDK version: 4.32.0
- StoreKit version:
- [x] StoreKit 1
- [ ] StoreKit 2 (enabled with
usesStoreKit2IfAvailable(true)
)
- OS version: 17.0
- Xcode version: 15.x
- Device and/or simulator:
- [X] Device
- [X] Simulator
- Environment:
- [X] Sandbox
- [ ] TestFight
- [ ] Production
- How widespread is the issue. Percentage of devices affected.
-
Debug logs that reproduce the issue. Complete logs with
Purchases.logLevel = .verbose
will help us debug this issue.
Logs here
- Steps to reproduce, with a description of expected vs. actual behavior
- Create a user with same type of active entitlement in both prod and sandbox env.
- Use
customerInfo?.entitlements.activeInCurrentEnvironment
to fetch the data.
Expected behavior
- Client should get expected data same as shown in console in corresponding environment.
Actual behavior
- In
sandbox
env, the result is empty. - In
prod
env, the result is correct.
-
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.) If I "remove" the active entitlement from
prod
env user(either transfer to another user or delete it), I can get correct active entitlement insandbox
env. -
Additional context