Safe to run
Search
⌃K

Application setup

We assume you have already configured safe to run 'resilience' as outlined here:
To get started, add the gradle dependency:
"com.safetorun.safeToRunLogger:$safeToRunVersion"
Then, where you are using your existing 'safeToRun' configuration - simply use "safeToRunWithLogger" - name the check something intuitive, as this is what will appear in the logs on the backend
Use the API key for the application setup in the safe to run - plus portal.
val result = safeToRunWithLogger(
logger = loggerForCheck(apiKey, checkName),
{ verifySignatureCheck() },
{ banAvdEmulatorCheck() }
)
if (!result) {
throw UnsafeDeviceException()
}
Every time the safe to run check is triggered, it will pass the success status along with debug information about the device to the safe to run app.
The logs may not appear instantly - the synchronisation is periodic so it may take a while to appear on the API. The timestamp will be correct for the time that the event happened (rather than the time it was received by the server)