The SDK is ready to scan for beacons, Nfc tags, Geofences, and return experiences after the successful call to init(). To start scanning, call startScan().
This will display a notification about the application in the system status bar. On latest android versions, 8 and higher, this is the only way to make sure the application can detect beacons in the background. You can customize the notification by passing a notification to the startScan call, or just pass null and the SDK will use the default notification.
mFootmarksAPI.startScan(notification, new FootmarksAPI.InitCallback() { @Override public void onError(FootmarksSdkError footmarksSdkError) { Log.w(TAG, String.format("Error type:%1$s message:%2$s", footmarksSdkError.getError().toString(), footmarksSdkError.getMessage())); switch (footmarksSdkError.getError()) { case LOCATION_PERMISSION_NOT_ENABLED: break; case BLUETOOTH_NOT_ON: break; case BLE_NOT_SUPPORTED: break; } }
Note
mFootmarksAPI.stopScan() call will stop the scanning.