geolocator doesn't work in ios

bilel miled 21 Reputation points
2021-01-19T14:28:47.357+00:00

i try to listen when the position change ,the app detect it . with android it works well , but in ios it's not working i have followed this: geolocation

async Task StartListening()  
        {  
            await DisplayAlert("1", "moving", "OK");  
  
            await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(5), 10, true, new Plugin.Geolocator.Abstractions.ListenerSettings  
            {  
                ActivityType = Plugin.Geolocator.Abstractions.ActivityType.AutomotiveNavigation,  
                AllowBackgroundUpdates = true,  
                DeferLocationUpdates = true,  
                DeferralDistanceMeters = 1,  
                DeferralTime = TimeSpan.FromSeconds(1),  
                ListenForSignificantChanges = true,  
                PauseLocationUpdatesAutomatically = false  
  
            });  
            await DisplayAlert("2", "moving", "OK");  
  
            CrossGeolocator.Current.PositionChanged += PositionChangedAsync;  
        }  

the first alert works but the second doesn't work . please need help

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,366 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.