Closed gmkohler closed 6 years ago
Try latest version, 2.10.1
I implemented permissions completely within the plugin using a 3rd party library, rather than from within the Cordova Activity. See if that changes the behaviour for you.
@christocracy That did not seem to change this behavior
I will attempt to reproduce
Okay. Is there a reason that the provider is only accessible on change?
Yes, I didn't feel like it.
Any way to expose it in the state object?
It’s not necessary to place it in state object. The plugin fires the providerchange event as soon as #configure is called.
Configuring also fires a permission request right away, non? We do not want the permission dialog to show up until we actually need location permission from the user.
In 2.10.1
, the plugin doesn't request permission until you #start
the plugin, just like iOS.
Hopefully that will render this issue a moot point. Thanks for the heads up.
@christocracy:
2.10.1
indeed does not request permission on Android 7.x, which makes configuring nice. I am noticing that I do not receive a provider change event when I "allow location access" via the dialog that pops up while configuring for the first time with the app, however.
Additionally, although I know this plugin does not yet support Android 8.0, the #configure
function still seems to ask for permissions immediately for the 8.0 OS.
The plugin isn’t going to ask permission until the plugin’s #start or #getCurrrntPosition method is executed.
Version of Cordova / Android does not affect when the plugin asks for permission.
@christocracy Okay, I'll go through the process again on Android 8 later to make sure I had the updated plugin in the manifest.
Is a providerchange
event supposed to come through after explicitly granting the device location permission via the dialog that pops up during BackgroundGeolocation.start()
(i.e., after explicitly changing the provider status)? I do not see one coming through, even on 7.x.x.
providerchange
is not involved with user location authorization. providerchange
is fired only when you change Settings -> Location
I have location services on globally, but turned off for my app, and I receive provider status 2 when booting my app. When I then turn location permission on for my app via apps>my app>permissions, and reboot the app, I receive status 3. I also receive status 3 when granting permission via the dialog, then rebooting my app.
I don't understand how providerchange
would be related only to the global location services, and not related to app-specific permissions, based on these observations. Can you shed some light or point me in the direction of where to learn more?
I suppose that doesn't invalidate that the providerchange
event is only related to the device-level location permission, but the provider status changed--I would expect a change in a property of the provider to be considered a "change of provider". If that is not the case, is there a way to listen to the provider status via this plugin?
It’s not easy to capture user authorization events. Android provides no such Broadcast of this event.
On Tue, Feb 13, 2018 at 3:00 PM Gregory M Kohler notifications@github.com wrote:
I suppose that doesn't invalidate that the providerchange event is only related to the device-level location permission, but the provider status changed--I would expect a change in a property of the provider to be considered a "change of provider". If that is not the case, is there a way to listen to the provider status via this plugin?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/604#issuecomment-365385928, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA6l0Og6PJxxf4_z-BzBQbDFiWjzh_Kks5tUenCgaJpZM4SAo_e .
-- Snet form Gmail Mobile
I should receive a 'providerchange' event when I change the location permission from disabled to enabled while the app is closed
Are we talking about Device Location Permission or Application Location Permission. The two are different:
providerchange
event.providerchange
.
Your Environment
Plugin version: 2.8.5
Platform: iOS or Android Android
OS version: 7.1.2 and 8.1.0
Device manufacturer / model:
Nexus 5X (7.1.2) and Pixel (8.1.0)
Cordova version (
cordova -v
): 7.1.0Cordova platform version (
cordova platform ls
):6.4.1
Expected Behavior
I should receive a
'providerchange'
event when I change the location permission from disabled to enabled while the app is closed, which is the behavior when I change the location permission from enabled to disabled while the app is closed.Actual Behavior
I do not receive
'providerchange'
eventSteps to Reproduce
Context
Know whether my location is authorized on boot. My setup (in Ember):
app/pods/application/route.js
Debug logs