New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branch.setUseTestBranchKey(true) is ignored during initialization and all events reported into LIVE environment if Branch.getInstance() called before the initialization #1370
Comments
@vitalii-tym Mind filing a support ticket so we can go into more details about your specific setup? Thanks. |
Ticket submitted. Case number is 00379841. |
I have run an additional debugging session and found that: (2) the fact that these calls are made prematurely isn't a big problem, because logout(), for example, has a double-check (3) even though these premature |
As a workaround I have tried to move the
If it is not a bug but a deliberately designed behavior, I suggest to revise the piece of documentation about "Branch Test Key", which recommends to place this piece of code "before the initSession() method". With high probability this can become an issue for everyone who have delayed initialization implemented. |
Describe the bug
I have two keys - "test" and "live" in the .plist file:
The SDK is asked to use one of the keys depending on the build being created: everything built for debugging or testing has either DEV or STAGE in Active Compilation Conditions in Build Settings. There can be no mistake, because the same #if ... #endif is used to choose between Dev, Stage, and Prod servers.
My initialization code is:
It is hard to tell about "install" and "open" events, because they are expected to come many times in all environments. However, I have noticed that the PURCHASE event is sometimes sent to the LIVE environment when no real purchases were made in Production (but there were purchases made in dev environment).
This happens sporadically, most of the time events go to correct "live" or "test" destinations. For businesses with big num of clients and smaller checks such a deviation might not be an issue, but we have small amount of users doing big checks - this makes us very sensitive to deviations like these.
Is there a way to ensure the
Branch.setUseTestBranchKey(true)
is be more reliable without workarounds (like temporary removing the "test" key from the .plist file when I build for Production)? Or maybe am I usingsetUseTestBranchKey()
in a wrong way during initialization?Steps to reproduce
for example:
Actual Result: most of the time the event is reported to the TEST environment, but sometimes it can be seen erroneously reported to the LIVE environment:
Expected behavior
The event initialized with
setUseTestBranchKey(true)
is never expected to appear in the LIVE environment and is not expected to interfere with data from production.SDK Version
3.3.0
XCode Version
15.0
Device
iPhone 12 mini ("iPhone13,1"), iOS 17.2.1
OS
13.6.5
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: