Apress / using-mvvm-light-w-your-xamarin-apps

Source code for 'Using MVVM Light with your Xamarin Apps' by Paul Johnson
https://www.apress.com/9781484224748
Other
5 stars 4 forks source link

cannot convert from 'int' to 'System.TimeSpan' (CS1503) (geolocation_plugin.iOS) #3

Open nicofr69 opened 6 years ago

nicofr69 commented 6 years ago

Hello,

I encounter a build error in chapter4/geolocalisation_plugin Could you help out, please? Thanks.

    public void StartListening()
    {
        CrossGeolocator.Current.StartListeningAsync(3000, 10, true);
        if (CrossGeolocator.Current.IsListening)
            CrossGeolocator.Current.GetPositionAsync(3000).ContinueWith((t) =>

/Users/MacUser/Projects/using-mvvm-light-w-your-xamarin-apps/chapter 4/geolocation_plugin/iOS/Services/GeoLocation.cs(57,57): Error CS1503: Argument 1: cannot convert from 'int' to 'System.TimeSpan' (CS1503) (geolocation_plugin.iOS)

smaritem commented 5 years ago

Hey,

you can use this one CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3000), 10 );

OR FromMinutes FromTicks

and more.....