-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
🐛 Problem Description
There are two critical issues with Android beacon monitoring that have been tested on both the latest version and version 8.0.2 (most stable). Both issues work perfectly on iOS.
🚨 Issue #1: No Background Beacon Detection
When the Android app goes to background, beacon region monitoring completely stops working. The app appears to be running in background, but the monitoring functionality is non-functional.
🚨 Issue #2: Permission Prompts Don't Work
When requesting permissions using capgo methods (requestWhenInUseAuthorization(), requestAlwaysAuthorization()), Android Studio shows repeated "Location not available" errors. This appears to be a missing callback implementation in the Android native code.
📱 Environment
- Plugin Version:
@capgo/capacitor-ibeacon@8.0.2(also tested on latest version) - Capacitor Version:
^7.4.1 - Target Platform: Android (iOS works correctly)
- Framework: Angular + Ionic + NX Monorepo
🔧 Current Setup
Plugins Used for Android Background Support
- Background Service:
@capacitor-community/background-geolocation@1.2.26(for maintaining background execution) - Location Permissions:
@capacitor/geolocation@7.1.5(native Capacitor plugin) - Bluetooth Permissions:
@capacitor-community/bluetooth-le@7.2.0(for nearby device permissions) - Beacon Monitoring:
@capgo/capacitor-ibeacon@8.0.2
🚀 Reproduction Steps
For Issue #1 (Background Detection):
- Initialize beacon monitoring
- Call
startMonitoringForRegion()for beacon region - Put the Android app in background
- Move device within range of beacon transmitter
- Result: No
didEnterRegionevents fired (works perfectly on iOS)
For Issue #2 (Permission Prompts):
- Call
CapacitorIbeacon.requestWhenInUseAuthorization()orrequestAlwaysAuthorization() - Observe Android Studio logcat
- Result:
"Location not available"errors appear (works perfectly on iOS)
Expected (iOS behavior):
- Background beacon detection works
- Permission prompts appear correctly
- No location-related errors
Actual (Android behavior):
- Background beacon monitoring non-functional
- Permission prompts fail with location errors
- Missing callback implementation causes errors
🔍 Error Details
The error "Location not available" appears to be triggered by a missing callback implementation in the Android native layer of the plugin. This suggests that the Android code is expecting a location callback that is not properly implemented or handled.
❓ Questions
-
Are these known Android-specific issues that are being worked on?
-
Is there a workaround for the missing callback implementation that causes permission prompt failures?
-
Why does background monitoring stop working on Android when it works perfectly on iOS?
-
Should we avoid using capgo permission methods on Android and use alternative approaches?
🔍 Additional Context
- iOS works perfectly: Both background detection and permission prompts function as expected
- Android permissions can be granted manually but capgo methods fail
- Foreground beacon detection works on Android
- Tested on both latest version and 8.0.2 with same results
- Physical beacon hardware confirmed working (detected by other apps and iOS)
💡 Impact
These issues make the plugin unusable for production Android apps that require:
- Background beacon detection (critical for most beacon use cases)
- Programmatic permission requests (essential for user experience)
The Android implementation appears to need significant work to match iOS functionality.