These notes are for checking whether Tasker iBeacon detection works without the optional compatibility monitor.
- Tasker-triggered scans first check
BeaconCachefor a matching beacon seen in the last 30 seconds. - If there is no cache hit,
TaskerFireReceiverstarts an on-demand Bluetooth LE scan. - The compatibility monitor is optional. Its main purpose is to support devices where Tasker background scans are unreliable by keeping
BeaconCachewarm in a foreground service. - A successful Tasker result soon after another scan may be coming from the 30-second cache, not from a fresh scan.
Use ADB while the phone is connected:
adb shell dumpsys activity services io.github.smailzhu.ibeacontasker | grep -i BeaconMonitorServiceExpected when the monitor is stopped: no output.
Check for the compatibility monitor notification:
adb shell dumpsys notification --noredact | grep -i "iBeacon compatibility monitor"Expected when the monitor is stopped: no output.
After any successful scan, wait at least 35 seconds before testing again.
The Tasker cache max age is currently:
BeaconCache.TASKER_MAX_AGE_MS = 30000So a result inside 30 seconds may not prove that a fresh background scan worked.
Run all tests with the compatibility monitor stopped.
- App open, Tasker trigger works.
- App sent to background, wait 2 minutes, Tasker trigger works.
- App removed from recent apps, wait 2 minutes, Tasker trigger works.
- Screen off, wait 10-30 minutes, Tasker trigger works.
- Beacon turned off or far away, wait 35 seconds, Tasker reports
ibeacon_found=false. - Phone rebooted, do not open the app, Tasker trigger works.
Do not use Android Settings > Force stop as the main test. Force stop puts the package into a stopped state and can block normal background delivery until the app is opened again.
It should be reasonable to remove:
BeaconMonitorService- the Start/Stop compatibility monitor button
- the foreground-service notification and notification channel
POST_NOTIFICATIONSFOREGROUND_SERVICE_CONNECTED_DEVICE- monitor-specific permission checks
Keep background location permission unless testing proves Tasker-triggered scans still work while the app is not visible without it.
app/src/main/java/io/github/smailzhu/ibeacontasker/TaskerFireReceiver.javaapp/src/main/java/io/github/smailzhu/ibeacontasker/BeaconCache.javaapp/src/main/java/io/github/smailzhu/ibeacontasker/BeaconMonitorService.javaapp/src/main/java/io/github/smailzhu/ibeacontasker/PermissionUtils.javaapp/src/main/AndroidManifest.xml