Skip to content

Lifecycle & configuration ​

2.1 Startup — one entry point ​

kotlin
SensorBioSDK.initialize(context)                                             // once, top of Application.onCreate

initialize stands up the encrypted sdk_prefs store, runs the one-time legacy-prefs migrator (no re-login on upgrade), and wires the subsystems. SensorBioSDK.isInitialized: Boolean reports whether it has run.

2.2 Static configuration knobs ​

Plain vars the host sets once after initialize:

PropertyTypeControls
environmentSB_EnvironmentgRPC target (dev/prod). Prefer SB_AppConfig.environment — see below. This setter is for switching at runtime
sdkCredentialsSB_SDKCredentials?the organization id + single-use sdk_token your backend's exchange returned. Set immediately before registerUser — see §5.1
logHandler((SB_LogLevel, String?, Array<out Any?>) -> Unit)?sink for SDK logs (unset = silent)

App identity is set-once config passed into initialize(context); every field of SB_AppConfig is defaulted, so a customer passes nothing but the context.

Set SB_AppConfig.environment if you target anything but production. initialize starts authenticated network activity of its own — the foreground credential check, the connectivity drain, the stale-submission sweep, and the white-label fetch — so the environment has to be known before it runs, not assigned afterwards. Assigning SensorBioSDK.environment after initialize returns leaves those first calls pointed at the default (PRODUCTION); against a staging session the server rejects the token and the 401 path ends the session (SB-2179). The SensorBioSDK.environment setter remains for hosts that switch at runtime, and rebuilds the channel when it does. SB_AppType/appFlavor are gone (SB-2095) — every value was a Sensr-Bio brand, so a third-party integration had no correct one to pass, and it had no effect on one either. App version + build are self-read from the PackageManager at init. SB_FirmwareConfig (S3 bucket + Cognito pool) is supplied out-of-band via the internal-only configureFirmware, not here.


Sensor Bio Mobile SDK — iOS & Android integration reference.