暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AppleErrorExtensions.cs 589B

1234567891011121314151617181920
  1. using AppleAuth.Enums;
  2. using AppleAuth.Interfaces;
  3. using System;
  4. namespace AppleAuth.Extensions
  5. {
  6. public static class AppleErrorExtensions
  7. {
  8. public static AuthorizationErrorCode GetAuthorizationErrorCode(this IAppleError error)
  9. {
  10. if (error.Domain == "com.apple.AuthenticationServices.AuthorizationError" &&
  11. Enum.IsDefined(typeof(AuthorizationErrorCode), error.Code))
  12. {
  13. return (AuthorizationErrorCode)error.Code;
  14. }
  15. return AuthorizationErrorCode.Unknown;
  16. }
  17. }
  18. }