Exemplo n.º 1
0
        async Task <bool> CheckPermissions(Permission permission)
        {
            var status = await _permissionsService.CheckPermissionStatusAsync(permission);

            if (status != PermissionStatus.Granted)
            {
                Console.WriteLine("Currently do not have Location permissions, requesting permissions");

                var request = await _permissionsService.RequestPermissionsAsync(permission);

                if (request[permission] != PermissionStatus.Granted)
                {
                    Console.WriteLine("Location permission denied, can not get positions async.");
                    return(false);
                }
            }
            return(true);
        }