FBSDKShareConstants.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 FBSDKShareKit.
  22. Error codes from the SDK in the range 200-299 are reserved for this domain.
  23. */
  24. FOUNDATION_EXPORT NSErrorDomain const FBSDKShareErrorDomain;
  25. #else
  26. /**
  27. The error domain for all errors from FBSDKShareKit.
  28. Error codes from the SDK in the range 200-299 are reserved for this domain.
  29. */
  30. FOUNDATION_EXPORT NSString *const FBSDKShareErrorDomain;
  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. FBSDKShareError
  39. Error codes for FBSDKShareErrorDomain.
  40. */
  41. typedef NS_ERROR_ENUM(FBSDKShareErrorDomain, FBSDKShareError)
  42. {
  43. /**
  44. Reserved.
  45. */
  46. FBSDKShareErrorReserved = 200,
  47. /**
  48. The error code for errors from uploading open graph objects.
  49. */
  50. FBSDKShareErrorOpenGraph,
  51. /**
  52. The error code for when a sharing dialog is not available.
  53. Use the canShare methods to check for this case before calling show.
  54. */
  55. FBSDKShareErrorDialogNotAvailable,
  56. /**
  57. @The error code for unknown errors.
  58. */
  59. FBSDKShareErrorUnknown,
  60. };
  61. /**
  62. Deprecated
  63. */
  64. typedef NS_ENUM(NSInteger, FBSDKShareErrorCode)
  65. {
  66. FBSDKShareReservedErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKShareErrorReserved instead") = 200,
  67. FBSDKShareOpenGraphErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKShareErrorOpenGraph instead"),
  68. FBSDKShareDialogNotAvailableErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKShareErrorDialogNotAvailable instead"),
  69. FBSDKShareUnknownErrorCode DEPRECATED_MSG_ATTRIBUTE("use FBSDKShareErrorUnknown instead"),
  70. } DEPRECATED_MSG_ATTRIBUTE("use FBSDKShareError instead");