About AdmixLocalConfig
Admix comes with a config file that can be configured for multiple use cases. The file name is AdmixLocalConfig.txt and it is located in: Assets/Admix/AdmixAssets/Resources/. It can be used to determine:
- Admix initialization type
- Log level for debugging
Please note! AdmixLocalConfig.txt has other priorities for Admix settings, such as endpoint URLs. Please keep them set as default, as they can prevent Admix from working properly on the production line.
About Admix initialization
By default, the Admix SDK initializes as an app launches. It will gain all necessary settings from Admix servers and prepare everything on the backend to serve ads during runtime. Then, during gameplay, it will send ad requests from any scenes where In-Play banners have been added.
However, this default behaviour isn't always ideal. If there is a need to prevent Admix from being initialized as the app launches (due to users first needing to accept a Privacy Policy or adhere to GDPR guidelines), then Admix must be initialized AFTER this has occurred.
This page describes how you can delay Admix initialization to occur when a user prefers.
Please note, the delayed initialization feature is implemented starting with the SDK version 2.2
How do you delay Admix initialization?
Admix comes with a config file that determines how Admix should be initialized. The file name is AdmixLocalConfig.txt, and is located in: Assets/Admix/AdmixAssets/Resources/. If you open this file, you will find a line reading as "InstantLoading" with the value "true". This line allows Admix to initialize right after an app is launched.
In order to delay initialization, simply change the value from "true" to "false" as shown in the picture below:
You can then easily initiate Admix through code whenever you want. You can do this using the public method AdmixInitializer.Start()
using Admix.AdmixCore;
...
void Start()
{
AdmixInitializer.Start();
}
Admix initialization instance state
Starting with the SDK2.3+, developers can use the state of Admix SDK to determine if it is successfully initiated or not. For example, this is useful if you would like to set the GDPR string for Admix. For this, you'll need to be sure that Admix SDK is successfully initialized — or, for example, you can also use it for re-initializing Admix SDK in the case that it was not properly initialized due to connection issues, etc. Here is an example of initialization using checking the Admix initialization:
if(AdmixInitializer.IsInitialized == false)
{
AdmixInitializer.Start();
}
About Admix debug level
For testing purposes, you may need to debug more processes related to Admix. AdmixLocalConfig.txt allows you to setup different level of the log debugging for Admix. Here is how it looks by default:
"LoggerConfig": {
"IsEnabled": false,
"Level": 4,
"IsFileWriter": false
}
If you'd like to enable the log level, simply change "IsEnabled" to true.
"IsEnabled": true
There are multiple levels of logs that can be enabled:
- "Level": 0 // off
- "Level": 1 // Info
- "Level": 2 // Warning
- "Level": 3 // Error
- "Level": 4 // Debug all