Forum Xamarin Xamarin.Forms

IOS location permissions doesn't appear under settings in some IOS devices

AshwinJeyananadAshwinJeyananad INMember ✭✭
edited June 2017 in Xamarin.Forms

Hi All,````

I have developed the Xamarin.Forms app and deployed in Physical devices.

At App installation,
Such devices requesting location permission and updated under the app settings. App is working fine.
Some device location permission not asked and it doesn't have under settings. App installed successfully and then splash screen shown but unable to continue work.

below keys are added for location privacy key in info.plist

<key>NSLocationWhenInUseUsageDescription</key>
<string>WhenInUseUsageDescription</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>LocationAlwaysUsageDescription</string>

Any ideas?

Thanks in advance.
Ashwin C

Posts

  • VenkataSwamyVenkataSwamy INMember ✭✭✭

    Hi @AshwinJeyananad

    Might be the below code useful for you

    In App.cs:

        public App()
          {
            try
            {
                IGeolocator locator = CrossGeolocator.Current;
                locator.DesiredAccuracy = 50;
    
                if (locator.IsGeolocationEnabled && locator.IsGeolocationAvailable)
                {
    
                }
                else
                {
                    await DisplayAlert("Message", "Please enable Gps for locations.", "Ok");                    
                }
            }
            catch (Exception ex)
            {
    
            }
     }
    
  • AshwinJeyananadAshwinJeyananad INMember ✭✭

    @VenkataSwamyBalaraju said:
    Hi @AshwinJeyananad

    Might be the below code useful for you

    In App.cs:

    public App()
    {
    try
    {
    IGeolocator locator = CrossGeolocator.Current;
    locator.DesiredAccuracy = 50;

              if (locator.IsGeolocationEnabled && locator.IsGeolocationAvailable)
              {
    
              }
              else
              {
                  await DisplayAlert("Message", "Please enable Gps for locations.", "Ok");                    
              }
          }
          catch (Exception ex)
          {
    
          }
    

    }

    Thanks @VenkataSwamyBalaraju

    Its help to check the location services is enabled or not.

    I have an issue location services enabled settings are not displayed under the setting against the installed app.
    It will not occurred in all devices. It happened in some devices. looking solution for this.

Sign In or Register to comment.