Example #1
0
        /// <summary>
        /// Check whether we are authorized to use the Photo Library
        /// </summary>
        /// <param name="onAuthorized">Callback <see cref="Action"/> which triggers when we are authorized</param>
        public void CheckPhotoAuthorization(Action onAuthorized)
        {
            PHPhotoLibrary.RequestAuthorization(status =>
            {
                switch (status)
                {
                case PHAuthorizationStatus.Restricted:
                case PHAuthorizationStatus.Denied:
                    CameraRollUnauthorized?.Invoke(this, EventArgs.Empty);
                    break;

                case PHAuthorizationStatus.Authorized:
                    onAuthorized?.Invoke();
                    break;
                }
            });
        }
Example #2
0
 private void OnCameraRollUnauthorized(object sender, EventArgs e)
 {
     CameraRollUnauthorized?.Invoke(this, e);
 }