FBSDKSharingContent.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #import <FBSDKCoreKit/FBSDKCopying.h>
  20. #import <FBSDKShareKit/FBSDKSharingValidation.h>
  21. @class FBSDKHashtag;
  22. /**
  23. A base interface for content to be shared.
  24. */
  25. @protocol FBSDKSharingContent <FBSDKCopying, FBSDKSharingValidation, NSSecureCoding>
  26. /**
  27. URL for the content being shared.
  28. This URL will be checked for all link meta tags for linking in platform specific ways. See documentation
  29. for App Links (https://developers.facebook.com/docs/applinks/)
  30. @return URL representation of the content link
  31. */
  32. @property (nonatomic, copy) NSURL *contentURL;
  33. /**
  34. Hashtag for the content being shared.
  35. @return The hashtag for the content being shared.
  36. */
  37. @property (nonatomic, copy) FBSDKHashtag *hashtag;
  38. /**
  39. List of IDs for taggable people to tag with this content.
  40. See documentation for Taggable Friends
  41. (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends)
  42. @return Array of IDs for people to tag (NSString)
  43. */
  44. @property (nonatomic, copy) NSArray *peopleIDs;
  45. /**
  46. The ID for a place to tag with this content.
  47. @return The ID for the place to tag
  48. */
  49. @property (nonatomic, copy) NSString *placeID;
  50. /**
  51. A value to be added to the referrer URL when a person follows a link from this shared content on feed.
  52. @return The ref for the content.
  53. */
  54. @property (nonatomic, copy) NSString *ref;
  55. /**
  56. For shares into Messenger, this pageID will be used to map the app to page and attach attribution to the share.
  57. @return The ID of the Facebok page this share is associated with.
  58. */
  59. @property (nonatomic, copy) NSString *pageID;
  60. /**
  61. A unique identifier for a share involving this content, useful for tracking purposes.
  62. @return A unique string identifying this share data.
  63. */
  64. @property (nonatomic, copy, readonly) NSString *shareUUID;
  65. /**
  66. Adds content to an existing dictionary as key/value pairs and returns the
  67. updated dictionary
  68. @param existingParameters An immutable dictionary of existing values
  69. @param bridgeOptions The options for bridging
  70. @return A new dictionary with the modified contents
  71. */
  72. - (NSDictionary<NSString *, id> *)addParameters:(NSDictionary<NSString *, id> *)existingParameters
  73. bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions;
  74. /**
  75. Adds content to a dictionary as key/value pairs.
  76. @param parameters A mutable dictionary that may be appended with key/value pairs of content.
  77. @param bridgeOptions The options for bridging
  78. */
  79. - (void)addToParameters:(NSMutableDictionary<NSString *, id> *)parameters
  80. bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions
  81. DEPRECATED_MSG_ATTRIBUTE("`addToParameters` is deprecated. Use `addParameters`");
  82. @end