I have a problem with the plugin Geolocator
it gives me the error of the authorization of the photos:
This is the xaml code :
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Test"
x:Class="Test.MainPage">
<StackLayout>
<!-- Place new controls here -->
<Label x:Name="Lat" Text="Latitud"
HorizontalOptions="Center"
VerticalOptions="Center" />
<Label x:Name="Long" Text="Logitud"
HorizontalOptions="Center"
VerticalOptions="Center" />
<Button x:Name ="TestB"
Text="Hola"
Clicked="Button_Clicked"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"/>
</StackLayout>
</ContentPage>
This is the code c # :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Plugin.Geolocator;
namespace Test
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private async void Button_Clicked(object sender, EventArgs e)
{
var locator = CrossGeolocator.Current;
locator.DesiredAccuracy = 20;
var position = await locator.GetPositionAsync();
Lat.Text = "Latitude: " + position.Latitude.ToString();
Long.Text = "Longitude: " + position.Longitude.ToString();
}
}
}
Manifest
Error