- ✅
bluetooth-centralbackground mode (scanning) - ✅
bluetooth-peripheralbackground mode (advertising) - ✅
processingbackground mode (task processing)
- ✅
FOREGROUND_SERVICEpermission - ✅
FOREGROUND_SERVICE_CONNECTED_DEVICEpermission (Android 14+) - ✅
WAKE_LOCKpermission (prevents CPU sleep)
- ✅
isBackgroundEnabled: truealready configured - ✅ Both
centralandperipheralmodes enabled
CRITICAL: These are native configuration changes. You MUST rebuild:
# For Android
npx expo run:android
# For iOS
npx expo run:iosexpo start will NOT apply these changes!
- Scanning: Continues in background with reduced frequency
- Advertising: Continues with longer intervals
- Wake-up: App wakes when matching service UUIDs found
- Battery: iOS optimizes automatically
- Foreground Service: Shows persistent notification
- Continuous Operation: BLE runs without interruption
- Wake Lock: Prevents CPU sleep during operations
- Battery: May require whitelisting in settings
- Start app and begin BLE scanning
- Press home button (app goes to background)
- Bring another anon0mesh device nearby
- Check logs - should detect device
- Start app with BLE advertising enabled
- Press home button
- Use another device to scan
- Should discover your device
- Use Service UUID filtering (already implemented)
- Limit connections to max 4 devices
- Android: Whitelist app in battery settings
- iOS: Background scan interval is automatic
- Verify Bluetooth is ON
- Check Console.app for CBCentralManager logs
- Ensure scanning with service UUID
- Check foreground service notification appears
- Verify app isn't battery optimized
- Look for permission denials in logcat
✅ Configuration complete ✅ Permissions added ✅ Background modes enabled ⏳ Awaiting native rebuild
- Rebuild:
npx expo run:android - Test: Background scanning/advertising
- Monitor: Battery usage and performance
- Optimize: Adjust parameters if needed
See BLE_BACKGROUND_SETUP.md for detailed documentation.