protected virtual async Task <PermissionResult> DoRequest(string[] permissions)
            {
                TaskCompletionSource <PermissionResult> tcs;

                lock (locker)
                {
                    tcs = new TaskCompletionSource <PermissionResult>();

                    requestCode = Platform.NextRequestCode();

                    requests.Add(requestCode, tcs);
                }

                if (!MainThread.IsMainThread)
                {
                    throw new PermissionException("Permission request must be invoked on main thread.");
                }

                ActivityCompat.RequestPermissions(Platform.GetCurrentActivity(true), permissions.ToArray(), requestCode);

                var result = await tcs.Task;

                return(result);
            }