Skip to content

more functional Geolocator.RequestAccessAsync() - #1998

Closed
pkar70 wants to merge 2 commits into
unoplatform:masterfrom
pkar70:patch-17
Closed

pkar70 wants to merge 2 commits into
unoplatform:masterfrom
pkar70:patch-17

Conversation

@pkar70

@pkar70 pkar70 commented Oct 31, 2019

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): #1967

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

RequestAccessAsync() => GeolocationAccessStatus.Allowed;

What is the new behavior?

Above is correct only on API <23.
Now, it RequestAccessAsync() returns real GeolocationAccessStatus.

PR Checklist

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • [X ] Associated with an issue (GitHub or internal)

Other information

Internal Issue (If applicable):

RequestAccessAsync() => GeolocationAccessStatus.Allowed;
is true only on API <23. 
RequestAccessAsync() should use
src\Uno.UI\Extensions\PermissionsHelper.Android.cs
src\Uno.UWP\Extensions\PermissionsHelper.cs
but something is wrong, and dialog requesting permission is not displayed.
So, this change is only half-way,
@pkar70

pkar70 commented Nov 1, 2019

Copy link
Copy Markdown
Contributor Author

I cannot imagine any test for this PR...

}

// check if permission is granted
if (Android.Support.V4.Content.ContextCompat.CheckSelfPermission(Uno.UI.ContextHelper.Current, Android.Manifest.Permission.AccessFineLocation)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should AccessCoarseLocation be considered also?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, but I have no idea how to really convert between permission system on UWP and on Android. On Windows, we have requestprecision in meters; on Android, only coarse/fine (and I found no article with any precise info what is coarse, and what is fine).
And on UWP you can RequestAccess, than set requested precision. If RequestAsync ask system about coarse, than app would not be able to change to fine...

@pkar70

pkar70 commented Nov 5, 2019

Copy link
Copy Markdown
Contributor Author

Recreated (to have only one Commit) as PR#2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants