Hey there, good morning!
I have this React Native app, and I have 2 separate environments for it: TEST and PROD. Naturally, both environments have separate DBs and users. My app is not live yet and I'll soon be integrating with RevenueCat, and I have a few questions on how do that, especially when I'm using the TEST env.
Question 1
Should I have separate RevenueCat projects for TEST and PROD? I believe it's best to try and avoid this, as it sounds it might get too confusing, handling multiple API keys, etc. This is an indie project, btw.
Question 2
Is it a good practice to upload TEST builds to the app store for testing? I'm assuming the best practice for sandbox testing is to always use PROD builds.
Question 3
Assuming I'll have a single RevCat PROD project and doing sandbox testing with PROD builds, that means that my TEST builds won't have any connection with RevCat/stores whatsoever. How to handle the RevCat-related code in my TEST env?
I guess I'll need to check for the TEST env and bypass the RevCat calls, implementing some dummy test behavior. Probably I won't even be able to fetch and display the offers in my TEST env.
Ex: free test user using my TEST build
- See offers
- I'll need to bypass await Purchases.getOfferings(); and fetch and display some dummy offers (ofc using the same response shape, as I'd get from RevCat)
- User selects an offer and buys it
- Then my BE will process their request, checking the env for TEST, and responding with a dummy success response, simulating that they have bought the offer.
- Maybe I can add some flag to my user DB, saying that they are now a "premium test user"
- Checks subscription status
- As I won't be able to check it using RevCat with await Purchases.getCustomerInfo(); Maybe I'll need to check some user test flag in my TEST env DB. If they have the flag, they are a premium test user.
I usually don't like to write ENV-specific code, as both environments should offer same funcionality, but in this case, I believe this is the best solution for my problem.
Do you agree? Has anybody set up their projects like this?