Capacitor Geolocation Plugin Permission Request Timing for iOS Background Updates
0 reputation · 01 Feb 2022, 10:56 UTC
Goal: Verify that the Capacitor Geolocation plugin is fully initialized before requesting background location permission on iOS to prevent silent deployment failures.
Uncertainty: While plugin initialization occurs during native startup before the WebView loads, the JavaScript side typically waits for the deviceready event to access plugins. It is unclear whether the deviceready event reliably indicates that the native bridge for the Geolocation plugin is ready, especially when additional iOS background mode entries are present in capacitor.config.ts.
Questions:
- Does the Capacitor Geolocation plugin guarantee that its native implementation is ready before the deviceready event fires?
- Should the permission request be deferred until after a specific Capacitor plugin lifecycle signal (e.g., a pluginReady callback) rather than deviceready?
- Is there a documented method to query the plugin’s initialization status from JavaScript before invoking permission APIs?