I am looking for a solution on how to detect that my app started inside the pre-launch report. Long story short - I have a game which is already live on google play with unity ads inside and I want to release an update. If I will put my new version on google play it will be checked using pre-launch reports and will generate fake ads impressions. I can't disable ads via unity "operate dashboard" coz it will affect live version users. I don't want to disable pre-launch reposts either, they are very helpful.
So, I am looking for a solution, either code vise or general flow vise.
After a few days of searching the internet, I was able to find two potentials solutions, but neither of them is working.
Solution 1: using this documentation - Firebase and StackOwerflow answer, and this example Unity forum i have come up with this code:
public bool IsTestLab()
{
using (var actClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
var context = actClass.GetStatic<AndroidJavaObject>("currentActivity");
var systemGlobal = new AndroidJavaClass("android.provider.Settings$Global");
var testLab = systemGlobal.CallStatic<string>("getString", context.Call<AndroidJavaObject>("getContentResolver"), "firebase.test.lab");
return testLab == "true"
}
}
Solution 2: Based on Another Firebase doc I have tried also this:
public bool IsTestLab()
{
return TestLabManager.Instantiate().IsTestingScenario;
}
Can someone share how they are going around this problem?
Thanks in advance!