Exemple #1
0
        public async Task RequirePermission(Func <Task> task, Permissions.BasePermission permission, Func <Task> taskToNotPermission = null)
        {
            var status = await PermissionService.CheckAndRequestPermissionAsync(permission);

            if (status != Xamarin.Essentials.PermissionStatus.Granted)
            {
                //await UserDialogService.AlertAsync("Não é possive continuar, permissão não concedida");

                if (taskToNotPermission != null)
                {
                    await taskToNotPermission.Invoke();
                }

                return;
            }

            await task.Invoke();
        }