Skip to content

Commit

Permalink
Merge pull request #26 from JamestsaiTW/JamestsaiTW-patch-readme
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
maxkatz6 authored Jan 2, 2025
2 parents 55f7a2d + b851c0a commit 015a05c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ Demo project to try: https://github.com/AvaloniaUI/AvaloniaMauiHybrid/tree/main/
```csharp
private async void Button_OnClick(object? sender, RoutedEventArgs e)
{
var location = await Geolocation.GetLocationAsync();
Console.WriteLine(location.ToString());
var location = await Geolocation.GetLocationAsync();
if (location != null)
Console.WriteLine($"Latitude: {location.Latitude}, Longitude: {location.Longitude}, Altitude: {location.Altitude}");
}
```
Don't forget about enabling specific permissions. In the case of Geolocation class, you can follow [this documentation](https://learn.microsoft.com/en-us/xamarin/essentials/geolocation?tabs=android) from Microsoft.
Don't forget about enabling specific permissions. In the case of Geolocation class, you can follow [this documentation](https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/device/geolocation) from Microsoft.

0 comments on commit 015a05c

Please sign in to comment.