-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetPositionAsync issue when choosing "Only when using the App" rather then "Always Allow" #274
Comments
Correct, this is how I had to implement it as Apple doesn't raise an event so I wait a while and return a result. Nothing I can do. Don't add the background permit if you don't need it. |
Hi James, Well I don't get your answer... there are a number of apps out there that request for the "Always" permissions for which if we only allow "Only when Using" don't stop from working even on a subset of the possible functionalities. Meaning, if the system allows for another answer than "Always", choosing it shouldn't break the app, only restrict the way it is allowed to work. At least, the 4.2.0 version of your plugin does also trace the "Currently does not have Location permissions" and "AuthorizedWhenInUse" trace messages when calling GetPositionAsync but returns as soon as it gets a valid location which is better then the current behavior. Because of that, I'm forced to stick with this 4.2.0 version rather than the newer one. |
Perhaps I missunderstood what was going on in your original bug. It is hard without having sample code to fully understand what is being called. It seems as though what when you called "GetPositionAsync" that it eventually returned and gave you back the position and future calls did not have the issue? I have a longer thread on how I fixed it here: jamesmontemagno/PermissionsPlugin#75 |
Yes it seems very related to that issue. With the latest version of the Geolocator plugin, when answering "Only when using the App" rather than "Always Allow", GetPositionAsync always return the correct location but within the timeout you probably set waiting for the event that should fire if the user had chosen "Always", event which you say never fires in that specific case. GetPositionAsync calls CheckPermissions, so if the latter isn't working properly, the former won't either. I'll try to make some complementary tests with your sample to see if I can pinpoint the exact issue. |
Just a suggestion reading the source... could GetPositionAsync only request for
|
To further build onto this I had an issue where requesting |
Hey James, |
Can you make a PR |
There you go. PR #278 |
Hi James, I just tried with the new 4.5.1-beta version of Geolocator (which I assume has the fix) and with the I suppose related 4.0.0-beta version of Permissions... now requesting Location requires NSAppleMusicUsageDescription?! Is it some kind of mix up? I tried to downgrade only Permissions to 3.0.0.12 and no weird NSAppleMusicUsageDescription requirement, but behavior is the same as described at the top of this issue... |
Where and how do you see this error message? |
If you got this email from apple then their scanner must have changed and now are trying to force even if the API is in the app :( had this issue with contacts too, which is what 4.0 takes place. Looks like iOS 12 sdk may do something odd. I am pushing 4.0.1-beta of permissions for you to try out. |
Just for you know, I was seeing this message on the device itself when requesting the Location permission. |
Yeah, most likely because i removed the enum from it so it was messed up. I updated and pushed out a new geolocator plugin built against it :) |
Bug Information
Version Number of Plugin: 4.5.0.6
Device Tested On: iPhone 6S - iOS 11.4
Simulator Tested On: iPhone 8 - iOS 11.4
Version of VS: VS for Mac 7.6.3
Version of Xamarin: 11.14.0.14
Steps to reproduce the Behavior
Set up an app that requests background location updates
When app prompts for permissions, select "Only when using the App" rather than "Always Allow"
Expected Behavior
GetPositionAsync should still return the location as if we had chosen the "Always Allow" i.e. without hanging.
Actual Behavior
GetPositionAsync hangs for a few seconds (see traces below) and complains.
Eventually, it exits with the correct location and without exception.
It works as expected though if we had chosen "Always Allow".
Worth mentioning, Geolocator version 4.2.0 (which also requires downgrading Permissions to 2.2.1) works as expected in both scenario.
The text was updated successfully, but these errors were encountered: