コード例 #1
0
        private async Task <bool> EnsureHasPermissions()
        {
            _loggingService.Trace("Executing LocationManager.EnsureHasPermissions");

            var locAlwaysPermission = await _permissions.CheckStatusAsync <Permissions.LocationAlways>();

            if (locAlwaysPermission != PermissionStatus.Granted)
            {
                locAlwaysPermission = await _permissions.RequestAsync <Permissions.LocationAlways>();
            }

            if (locAlwaysPermission != PermissionStatus.Granted)
            {
                return(false);
            }

            return(true);
        }