Search…
6. SDK Status Updates
This step is optional, but recommended if you want to be kept up-to-date with changes to the SDK detection status. Status updates are usually triggered by changes to the device state and settings (e.g. airplane mode, location permission/mode, etc.). Handling these updates gives you the chance to instruct your user, when applicable, to properly adjust the device configuration for optimal SDK detections.
To get notified of status updates, implement the OnSdkStatusUpdatehandler interface:
1
OnSdkStatusUpdateHandler statusHandler = new OnSdkStatusUpdateHandler() {
2
@Override
3
public void onSdkStatusUpdate(SdkStatus status) {
4
}
5
};
Copied!
Then set it on the SdkConfig.Builder:
1
SdkConfig sdkConfig = new SdkConfig.Builder(APP_ID, SECRET, notification)
2
.setOnSdkStatusUpdateHandler(statusHandler)
3
.build();
Copied!
You will now receive updates as an SdkStatus object. A sample OnSdkStatusUpdateHandler implementation can be found on our Github page.
Copy link