FBSDKLoginConstants.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  2. //
  3. // You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
  4. // copy, modify, and distribute this software in source code or binary form for use
  5. // in connection with the web services and APIs provided by Facebook.
  6. //
  7. // As with any software that integrates with the Facebook platform, your use of
  8. // this software is subject to the Facebook Developer Principles and Policies
  9. // [http://developers.facebook.com/policy/]. This copyright notice shall be
  10. // included in all copies or substantial portions of the software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  14. // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  15. // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  16. // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. #import <Foundation/Foundation.h>
  19. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
  20. /**
  21. The error domain for all errors from FBSDKLoginKit
  22. Error codes from the SDK in the range 300-399 are reserved for this domain.
  23. */
  24. FOUNDATION_EXPORT NSErrorDomain const FBSDKLoginErrorDomain;
  25. #else
  26. /**
  27. The error domain for all errors from FBSDKLoginKit
  28. Error codes from the SDK in the range 300-399 are reserved for this domain.
  29. */
  30. FOUNDATION_EXPORT NSString *const FBSDKLoginErrorDomain;
  31. #endif
  32. #ifndef NS_ERROR_ENUM
  33. #define NS_ERROR_ENUM(_domain, _name) \
  34. enum _name: NSInteger _name; \
  35. enum __attribute__((ns_error_domain(_domain))) _name: NSInteger
  36. #endif
  37. /**
  38. FBSDKLoginError
  39. Error codes for FBSDKLoginErrorDomain.
  40. */
  41. typedef NS_ERROR_ENUM(FBSDKLoginErrorDomain, FBSDKLoginError)
  42. {
  43. /**
  44. Reserved.
  45. */
  46. FBSDKLoginErrorReserved = 300,
  47. /**
  48. The error code for unknown errors.
  49. */
  50. FBSDKLoginErrorUnknown,
  51. /**
  52. The user's password has changed and must log in again
  53. */
  54. FBSDKLoginErrorPasswordChanged,
  55. /**
  56. The user must log in to their account on www.facebook.com to restore access
  57. */
  58. FBSDKLoginErrorUserCheckpointed,
  59. /**
  60. Indicates a failure to request new permissions because the user has changed.
  61. */
  62. FBSDKLoginErrorUserMismatch,
  63. /**
  64. The user must confirm their account with Facebook before logging in
  65. */
  66. FBSDKLoginErrorUnconfirmedUser,
  67. /**
  68. The Accounts framework failed without returning an error, indicating the
  69. app's slider in the iOS Facebook Settings (device Settings -> Facebook -> App Name) has
  70. been disabled.
  71. */
  72. FBSDKLoginErrorSystemAccountAppDisabled,
  73. /**
  74. An error occurred related to Facebook system Account store
  75. */
  76. FBSDKLoginErrorSystemAccountUnavailable,
  77. /**
  78. The login response was missing a valid challenge string.
  79. */
  80. FBSDKLoginErrorBadChallengeString,
  81. };
  82. /**
  83. FBSDKDeviceLoginError
  84. Error codes for FBSDKDeviceLoginErrorDomain.
  85. */
  86. typedef NS_ERROR_ENUM(FBSDKLoginErrorDomain, FBSDKDeviceLoginError) {
  87. /**
  88. Your device is polling too frequently.
  89. */
  90. FBSDKDeviceLoginErrorExcessivePolling = 1349172,
  91. /**
  92. User has declined to authorize your application.
  93. */
  94. FBSDKDeviceLoginErrorAuthorizationDeclined = 1349173,
  95. /**
  96. User has not yet authorized your application. Continue polling.
  97. */
  98. FBSDKDeviceLoginErrorAuthorizationPending = 1349174,
  99. /**
  100. The code you entered has expired.
  101. */
  102. FBSDKDeviceLoginErrorCodeExpired = 1349152
  103. };
  104. /**
  105. Deprecated
  106. */
  107. typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode)
  108. {
  109. FBSDKLoginReservedErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorReserved instead") = FBSDKLoginErrorReserved,
  110. FBSDKLoginUnknownErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorUnknown instead"),
  111. FBSDKLoginPasswordChangedErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorPasswordChanged instead"),
  112. FBSDKLoginUserCheckpointedErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorUserCheckpointed instead"),
  113. FBSDKLoginUserMismatchErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorUserMismatch instead"),
  114. FBSDKLoginUnconfirmedUserErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorUnconfirmedUser instead"),
  115. FBSDKLoginSystemAccountAppDisabledErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorSystemAccountAppDisabled instead"),
  116. FBSDKLoginSystemAccountUnavailableErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorSystemAccountUnavailable instead"),
  117. FBSDKLoginBadChallengeString DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginErrorBadChallengeString instead"),
  118. } DEPRECATED_MSG_ATTRIBUTE("use FBSDKLoginError instead");
  119. /**
  120. Deprecated
  121. */
  122. typedef NS_ENUM(NSUInteger, FBSDKDeviceLoginErrorSubcode) {
  123. FBSDKDeviceLoginExcessivePollingErrorSubcode DEPRECATED_MSG_ATTRIBUTE("use FBSDKDeviceLoginErrorExcessivePolling instead") = FBSDKDeviceLoginErrorExcessivePolling,
  124. FBSDKDeviceLoginAuthorizationDeclinedErrorSubcode DEPRECATED_MSG_ATTRIBUTE("use FBSDKDeviceLoginErrorAuthorizationDeclined instead") = FBSDKDeviceLoginErrorAuthorizationDeclined,
  125. FBSDKDeviceLoginAuthorizationPendingErrorSubcode DEPRECATED_MSG_ATTRIBUTE("use FBSDKDeviceLoginErrorAuthorizationPending instead") = FBSDKDeviceLoginErrorAuthorizationPending,
  126. FBSDKDeviceLoginCodeExpiredErrorSubcode DEPRECATED_MSG_ATTRIBUTE("use FBSDKDeviceLoginErrorCodeExpired instead") = FBSDKDeviceLoginErrorCodeExpired
  127. } DEPRECATED_MSG_ATTRIBUTE("use FBSDKDeviceLoginError instead");