예제 #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;
                }
            });
        }
예제 #2
0
 private void OnCameraRollUnauthorized(object sender, EventArgs e)
 {
     CameraRollUnauthorized?.Invoke(this, e);
 }