FBSDKShareKit-Swift.h 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. #if 0
  2. #elif defined(__arm64__) && __arm64__
  3. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
  4. #ifndef FBSDKSHAREKIT_SWIFT_H
  5. #define FBSDKSHAREKIT_SWIFT_H
  6. #pragma clang diagnostic push
  7. #pragma clang diagnostic ignored "-Wgcc-compat"
  8. #if !defined(__has_include)
  9. # define __has_include(x) 0
  10. #endif
  11. #if !defined(__has_attribute)
  12. # define __has_attribute(x) 0
  13. #endif
  14. #if !defined(__has_feature)
  15. # define __has_feature(x) 0
  16. #endif
  17. #if !defined(__has_warning)
  18. # define __has_warning(x) 0
  19. #endif
  20. #if __has_include(<swift/objc-prologue.h>)
  21. # include <swift/objc-prologue.h>
  22. #endif
  23. #pragma clang diagnostic ignored "-Wauto-import"
  24. #if defined(__OBJC__)
  25. #include <Foundation/Foundation.h>
  26. #endif
  27. #if defined(__cplusplus)
  28. #include <cstdint>
  29. #include <cstddef>
  30. #include <cstdbool>
  31. #include <cstring>
  32. #include <stdlib.h>
  33. #include <new>
  34. #include <type_traits>
  35. #else
  36. #include <stdint.h>
  37. #include <stddef.h>
  38. #include <stdbool.h>
  39. #include <string.h>
  40. #endif
  41. #if defined(__cplusplus)
  42. #if defined(__arm64e__) && __has_include(<ptrauth.h>)
  43. # include <ptrauth.h>
  44. #else
  45. #pragma clang diagnostic push
  46. #pragma clang diagnostic ignored "-Wreserved-macro-identifier"
  47. # ifndef __ptrauth_swift_value_witness_function_pointer
  48. # define __ptrauth_swift_value_witness_function_pointer(x)
  49. # endif
  50. # ifndef __ptrauth_swift_class_method_pointer
  51. # define __ptrauth_swift_class_method_pointer(x)
  52. # endif
  53. #pragma clang diagnostic pop
  54. #endif
  55. #endif
  56. #if !defined(SWIFT_TYPEDEFS)
  57. # define SWIFT_TYPEDEFS 1
  58. # if __has_include(<uchar.h>)
  59. # include <uchar.h>
  60. # elif !defined(__cplusplus)
  61. typedef uint_least16_t char16_t;
  62. typedef uint_least32_t char32_t;
  63. # endif
  64. typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
  65. typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
  66. typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
  67. typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
  68. typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
  69. typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
  70. typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
  71. typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
  72. typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
  73. typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
  74. typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
  75. typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
  76. #endif
  77. #if !defined(SWIFT_PASTE)
  78. # define SWIFT_PASTE_HELPER(x, y) x##y
  79. # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
  80. #endif
  81. #if !defined(SWIFT_METATYPE)
  82. # define SWIFT_METATYPE(X) Class
  83. #endif
  84. #if !defined(SWIFT_CLASS_PROPERTY)
  85. # if __has_feature(objc_class_property)
  86. # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
  87. # else
  88. # define SWIFT_CLASS_PROPERTY(...)
  89. # endif
  90. #endif
  91. #if !defined(SWIFT_RUNTIME_NAME)
  92. # if __has_attribute(objc_runtime_name)
  93. # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
  94. # else
  95. # define SWIFT_RUNTIME_NAME(X)
  96. # endif
  97. #endif
  98. #if !defined(SWIFT_COMPILE_NAME)
  99. # if __has_attribute(swift_name)
  100. # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
  101. # else
  102. # define SWIFT_COMPILE_NAME(X)
  103. # endif
  104. #endif
  105. #if !defined(SWIFT_METHOD_FAMILY)
  106. # if __has_attribute(objc_method_family)
  107. # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
  108. # else
  109. # define SWIFT_METHOD_FAMILY(X)
  110. # endif
  111. #endif
  112. #if !defined(SWIFT_NOESCAPE)
  113. # if __has_attribute(noescape)
  114. # define SWIFT_NOESCAPE __attribute__((noescape))
  115. # else
  116. # define SWIFT_NOESCAPE
  117. # endif
  118. #endif
  119. #if !defined(SWIFT_RELEASES_ARGUMENT)
  120. # if __has_attribute(ns_consumed)
  121. # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
  122. # else
  123. # define SWIFT_RELEASES_ARGUMENT
  124. # endif
  125. #endif
  126. #if !defined(SWIFT_WARN_UNUSED_RESULT)
  127. # if __has_attribute(warn_unused_result)
  128. # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  129. # else
  130. # define SWIFT_WARN_UNUSED_RESULT
  131. # endif
  132. #endif
  133. #if !defined(SWIFT_NORETURN)
  134. # if __has_attribute(noreturn)
  135. # define SWIFT_NORETURN __attribute__((noreturn))
  136. # else
  137. # define SWIFT_NORETURN
  138. # endif
  139. #endif
  140. #if !defined(SWIFT_CLASS_EXTRA)
  141. # define SWIFT_CLASS_EXTRA
  142. #endif
  143. #if !defined(SWIFT_PROTOCOL_EXTRA)
  144. # define SWIFT_PROTOCOL_EXTRA
  145. #endif
  146. #if !defined(SWIFT_ENUM_EXTRA)
  147. # define SWIFT_ENUM_EXTRA
  148. #endif
  149. #if !defined(SWIFT_CLASS)
  150. # if __has_attribute(objc_subclassing_restricted)
  151. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
  152. # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  153. # else
  154. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  155. # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  156. # endif
  157. #endif
  158. #if !defined(SWIFT_RESILIENT_CLASS)
  159. # if __has_attribute(objc_class_stub)
  160. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
  161. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
  162. # else
  163. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
  164. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
  165. # endif
  166. #endif
  167. #if !defined(SWIFT_PROTOCOL)
  168. # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  169. # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  170. #endif
  171. #if !defined(SWIFT_EXTENSION)
  172. # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
  173. #endif
  174. #if !defined(OBJC_DESIGNATED_INITIALIZER)
  175. # if __has_attribute(objc_designated_initializer)
  176. # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  177. # else
  178. # define OBJC_DESIGNATED_INITIALIZER
  179. # endif
  180. #endif
  181. #if !defined(SWIFT_ENUM_ATTR)
  182. # if __has_attribute(enum_extensibility)
  183. # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
  184. # else
  185. # define SWIFT_ENUM_ATTR(_extensibility)
  186. # endif
  187. #endif
  188. #if !defined(SWIFT_ENUM)
  189. # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  190. # if __has_feature(generalized_swift_name)
  191. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  192. # else
  193. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
  194. # endif
  195. #endif
  196. #if !defined(SWIFT_UNAVAILABLE)
  197. # define SWIFT_UNAVAILABLE __attribute__((unavailable))
  198. #endif
  199. #if !defined(SWIFT_UNAVAILABLE_MSG)
  200. # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
  201. #endif
  202. #if !defined(SWIFT_AVAILABILITY)
  203. # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
  204. #endif
  205. #if !defined(SWIFT_WEAK_IMPORT)
  206. # define SWIFT_WEAK_IMPORT __attribute__((weak_import))
  207. #endif
  208. #if !defined(SWIFT_DEPRECATED)
  209. # define SWIFT_DEPRECATED __attribute__((deprecated))
  210. #endif
  211. #if !defined(SWIFT_DEPRECATED_MSG)
  212. # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
  213. #endif
  214. #if !defined(SWIFT_DEPRECATED_OBJC)
  215. # if __has_feature(attribute_diagnose_if_objc)
  216. # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
  217. # else
  218. # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
  219. # endif
  220. #endif
  221. #if defined(__OBJC__)
  222. #if !defined(IBSegueAction)
  223. # define IBSegueAction
  224. #endif
  225. #endif
  226. #if !defined(SWIFT_EXTERN)
  227. # if defined(__cplusplus)
  228. # define SWIFT_EXTERN extern "C"
  229. # else
  230. # define SWIFT_EXTERN extern
  231. # endif
  232. #endif
  233. #if !defined(SWIFT_CALL)
  234. # define SWIFT_CALL __attribute__((swiftcall))
  235. #endif
  236. #if !defined(SWIFT_INDIRECT_RESULT)
  237. # define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
  238. #endif
  239. #if !defined(SWIFT_CONTEXT)
  240. # define SWIFT_CONTEXT __attribute__((swift_context))
  241. #endif
  242. #if !defined(SWIFT_ERROR_RESULT)
  243. # define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
  244. #endif
  245. #if defined(__cplusplus)
  246. # define SWIFT_NOEXCEPT noexcept
  247. #else
  248. # define SWIFT_NOEXCEPT
  249. #endif
  250. #if !defined(SWIFT_C_INLINE_THUNK)
  251. # if __has_attribute(always_inline)
  252. # if __has_attribute(nodebug)
  253. # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
  254. # else
  255. # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
  256. # endif
  257. # else
  258. # define SWIFT_C_INLINE_THUNK inline
  259. # endif
  260. #endif
  261. #if defined(_WIN32)
  262. #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
  263. # define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
  264. #endif
  265. #else
  266. #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
  267. # define SWIFT_IMPORT_STDLIB_SYMBOL
  268. #endif
  269. #endif
  270. #if defined(__OBJC__)
  271. #if __has_feature(objc_modules)
  272. #if __has_warning("-Watimport-in-framework-header")
  273. #pragma clang diagnostic ignored "-Watimport-in-framework-header"
  274. #endif
  275. @import CoreFoundation;
  276. @import FBSDKCoreKit;
  277. @import Foundation;
  278. @import ObjectiveC;
  279. #endif
  280. #import <FBSDKShareKit/FBSDKShareKit.h>
  281. #endif
  282. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  283. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  284. #if __has_warning("-Wpragma-clang-attribute")
  285. # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
  286. #endif
  287. #pragma clang diagnostic ignored "-Wunknown-pragmas"
  288. #pragma clang diagnostic ignored "-Wnullability"
  289. #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
  290. #if __has_attribute(external_source_symbol)
  291. # pragma push_macro("any")
  292. # undef any
  293. # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FBSDKShareKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
  294. # pragma pop_macro("any")
  295. #endif
  296. #if defined(__OBJC__)
  297. @class NSURL;
  298. @class NSString;
  299. enum FBSDKAppInviteDestination : NSInteger;
  300. /// A model for app invite
  301. SWIFT_CLASS_NAMED("AppInviteContent")
  302. @interface FBSDKAppInviteContent : NSObject
  303. /// A URL to a preview image that will be displayed with the app invite
  304. /// This is optional. If you don’t include it a fallback image will be used.
  305. @property (nonatomic, copy) NSURL * _Nullable appInvitePreviewImageURL;
  306. /// An app link target that will be used as a target when the user accept the invite.
  307. @property (nonatomic, copy) NSURL * _Nonnull appLinkURL;
  308. /// Promotional code to be displayed while sending and receiving the invite.
  309. /// This is optional. This can be between 0 and 10 characters long and can contain
  310. /// alphanumeric characters only. To set a promo code, you need to set promo text.
  311. @property (nonatomic, copy) NSString * _Nullable promotionCode;
  312. /// Promotional text to be displayed while sending and receiving the invite.
  313. /// This is optional. This can be between 0 and 80 characters long and can contain
  314. /// alphanumeric and spaces only.
  315. @property (nonatomic, copy) NSString * _Nullable promotionText;
  316. /// Destination for the app invite. The default value is <code>.facebook</code>.
  317. @property (nonatomic) enum FBSDKAppInviteDestination destination;
  318. - (nonnull instancetype)initWithAppLinkURL:(NSURL * _Nonnull)appLinkURL OBJC_DESIGNATED_INITIALIZER;
  319. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  320. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  321. @end
  322. /// Specifies the privacy of a group.
  323. typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKAppInviteDestination, "Destination", open) {
  324. /// Deliver to Facebook
  325. FBSDKAppInviteDestinationFacebook = 0,
  326. FBSDKAppInviteDestinationMessenger = 1,
  327. };
  328. /// An interface for validatable content and media.
  329. SWIFT_PROTOCOL_NAMED("SharingValidatable")
  330. @protocol FBSDKSharingValidatable
  331. /// Validate that this content or media contains valid values.
  332. /// \param options The share bridge options to use for validation.
  333. ///
  334. ///
  335. /// throws:
  336. /// If the values are not valid.
  337. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)options error:(NSError * _Nullable * _Nullable)error;
  338. @end
  339. @interface FBSDKAppInviteContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingValidatable>
  340. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  341. @end
  342. /// A container of arguments for a camera effect.
  343. /// An argument is a <code>String</code> or <code>[String]</code> identified by a <code>String</code> key.
  344. SWIFT_CLASS_NAMED("CameraEffectArguments")
  345. @interface FBSDKCameraEffectArguments : NSObject
  346. /// Sets a string argument in the container.
  347. /// @param string The argument
  348. /// @param key The key for the argument
  349. - (void)setString:(NSString * _Nullable)string forKey:(NSString * _Nonnull)key;
  350. /// Gets a string argument from the container.
  351. /// @param key The key for the argument
  352. /// @return The string value or nil
  353. - (NSString * _Nullable)stringForKey:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
  354. /// Sets a string array argument in the container.
  355. /// @param array The array argument
  356. /// @param key The key for the argument
  357. - (void)setArray:(NSArray<NSString *> * _Nullable)array forKey:(NSString * _Nonnull)key;
  358. /// Gets an array argument from the container.
  359. /// @param key The key for the argument
  360. /// @return The array argument
  361. - (NSArray<NSString *> * _Nullable)arrayForKey:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
  362. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  363. @end
  364. @class UIImage;
  365. /// A container of textures for a camera effect.
  366. /// A texture for a camera effect is an UIImages identified by a NSString key.
  367. SWIFT_CLASS_NAMED("CameraEffectTextures")
  368. @interface FBSDKCameraEffectTextures : NSObject
  369. /// Sets the image for a texture key.
  370. /// @param image The <code>UIImage</code> for the texture
  371. /// @param key The key for the texture
  372. - (void)setImage:(UIImage * _Nullable)image forKey:(NSString * _Nonnull)key;
  373. /// Gets the image for a texture key.
  374. /// @param key The key for the texture
  375. /// @return The texture <code>UIImage</code> or nil
  376. - (UIImage * _Nullable)imageForKey:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
  377. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  378. @end
  379. @protocol FBSDKSharingContent;
  380. /// The common interface for sharing buttons.
  381. /// See FBSendButton and FBShareButton
  382. SWIFT_PROTOCOL_NAMED("SharingButton")
  383. @protocol FBSDKSharingButton
  384. /// The content to be shared.
  385. @property (nonatomic, strong) id <FBSDKSharingContent> _Nullable shareContent;
  386. @end
  387. @class FBSDKMessageDialog;
  388. @class NSCoder;
  389. /// A button to send content through Messenger.
  390. /// Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot
  391. /// be shown, the button will be disable.
  392. SWIFT_CLASS_NAMED("FBSendButton")
  393. @interface FBSDKSendButton : FBSDKButton <FBSDKButtonImpressionLogging, FBSDKSharingButton>
  394. @property (nonatomic, strong) FBSDKMessageDialog * _Nullable dialog;
  395. @property (nonatomic, strong) id <FBSDKSharingContent> _Nullable shareContent;
  396. @property (nonatomic, readonly, copy) NSDictionary<FBSDKAppEventParameterName, id> * _Nullable analyticsParameters;
  397. @property (nonatomic, readonly) FBSDKAppEventName _Nonnull impressionTrackingEventName;
  398. @property (nonatomic, readonly, copy) NSString * _Nonnull impressionTrackingIdentifier;
  399. @property (nonatomic, readonly, getter=isImplicitlyDisabled) BOOL implicitlyDisabled;
  400. - (void)configureButton;
  401. - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
  402. - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
  403. @end
  404. /// A button to share content.
  405. /// Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot
  406. /// be shown, the button will be disabled.
  407. SWIFT_CLASS_NAMED("FBShareButton")
  408. @interface FBSDKShareButton : FBSDKButton <FBSDKSharingButton>
  409. @property (nonatomic, strong) id <FBSDKSharingContent> _Nullable shareContent;
  410. @property (nonatomic, readonly, copy) NSDictionary<FBSDKAppEventParameterName, id> * _Nullable analyticsParameters;
  411. @property (nonatomic, readonly) FBSDKAppEventName _Nonnull impressionTrackingEventName;
  412. @property (nonatomic, readonly, copy) NSString * _Nonnull impressionTrackingIdentifier;
  413. @property (nonatomic, readonly, getter=isImplicitlyDisabled) BOOL implicitlyDisabled;
  414. - (void)configureButton;
  415. - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
  416. - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
  417. @end
  418. /// Represents a single hashtag that can be used with the share dialog.
  419. SWIFT_CLASS_NAMED("Hashtag")
  420. @interface FBSDKHashtag : NSObject
  421. /// The hashtag string.
  422. /// You are responsible for making sure that <code>stringRepresentation</code> is a valid hashtag (a single ‘#’ followed by one or more
  423. /// word characters). Invalid hashtags are ignored when sharing content. You can check validity with the<code>valid</code> property.
  424. /// @return The hashtag string
  425. @property (nonatomic, copy) NSString * _Nonnull stringRepresentation;
  426. - (nonnull instancetype)initWithString:(NSString * _Nonnull)string OBJC_DESIGNATED_INITIALIZER;
  427. @property (nonatomic, readonly, copy) NSString * _Nonnull description;
  428. /// Tests if a hashtag is valid.
  429. /// A valid hashtag matches the regular expression “#\w+”: A single ‘#’ followed by one or more word characters.
  430. /// @return true if the hashtag is valid, false otherwise.
  431. @property (nonatomic, readonly) BOOL isValid;
  432. @property (nonatomic, readonly) NSUInteger hash;
  433. - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
  434. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  435. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  436. @end
  437. @protocol FBSDKSharingDelegate;
  438. /// The common interface for components that initiate sharing.
  439. /// See ShareDialog, MessageDialog
  440. SWIFT_PROTOCOL_NAMED("Sharing")
  441. @protocol FBSDKSharing
  442. /// The receiver’s delegate or nil if it doesn’t have a delegate.
  443. @property (nonatomic, weak) id <FBSDKSharingDelegate> _Nullable delegate;
  444. /// The content to be shared.
  445. @property (nonatomic, strong) id <FBSDKSharingContent> _Nullable shareContent;
  446. /// A boolean value that indicates whether the receiver should fail if it finds an error with the share content.
  447. /// If <code>false</code>, the sharer will still be displayed without the data that was misconfigured. For example, an
  448. /// invalid <code>placeID</code> specified on the <code>shareContent</code> would produce a data error.
  449. @property (nonatomic) BOOL shouldFailOnDataError;
  450. /// Validates the content on the receiver.
  451. /// @throws An error if the content is invalid
  452. - (BOOL)validateWithError:(NSError * _Nullable * _Nullable)error;
  453. @end
  454. /// The common interface for dialogs that initiate sharing.
  455. SWIFT_PROTOCOL_NAMED("SharingDialog")
  456. @protocol FBSDKSharingDialog <FBSDKSharing>
  457. /// A boolean value that indicates whether the receiver can initiate a share.
  458. /// May return <code>false</code> if the appropriate Facebook app is not installed and is required or an access token is
  459. /// required but not available. This method does not validate the content on the receiver, so this can be checked before
  460. /// building up the content.
  461. /// See <code>Sharing.validate(error:)</code>
  462. /// @return <code>true</code> if the receiver can share, otherwise <code>false</code>.
  463. @property (nonatomic, readonly) BOOL canShow;
  464. /// Shows the dialog.
  465. /// @return <code>true</code> if the receiver was able to begin sharing, otherwise <code>false</code>.
  466. - (BOOL)show;
  467. @end
  468. /// A dialog for sharing content through Messenger.
  469. /// SUPPORTED SHARE TYPES
  470. /// <ul>
  471. /// <li>
  472. /// FBSDKShareLinkContent
  473. /// </li>
  474. /// </ul>
  475. /// UNSUPPORTED SHARE TYPES (DEPRECATED AUGUST 2018)
  476. /// <ul>
  477. /// <li>
  478. /// FBSDKShareOpenGraphContent
  479. /// </li>
  480. /// <li>
  481. /// FBSDKSharePhotoContent
  482. /// </li>
  483. /// <li>
  484. /// FBSDKShareVideoContent
  485. /// </li>
  486. /// <li>
  487. /// FBSDKShareMessengerOpenGraphMusicTemplateContent
  488. /// </li>
  489. /// <li>
  490. /// FBSDKShareMessengerMediaTemplateContent
  491. /// </li>
  492. /// <li>
  493. /// FBSDKShareMessengerGenericTemplateContent
  494. /// </li>
  495. /// <li>
  496. /// Any other types that are not one of the four supported types listed above
  497. /// </li>
  498. /// </ul>
  499. SWIFT_CLASS_NAMED("MessageDialog")
  500. @interface FBSDKMessageDialog : NSObject <FBSDKSharingDialog>
  501. /// The receiver’s delegate or nil if it doesn’t have a delegate.
  502. @property (nonatomic, weak) id <FBSDKSharingDelegate> _Nullable delegate;
  503. /// The content to be shared.
  504. @property (nonatomic, strong) id <FBSDKSharingContent> _Nullable shareContent;
  505. /// A Boolean value that indicates whether the receiver should fail if it finds an error with the share content.
  506. /// If <code>false</code>, the sharer will still be displayed without the data that was mis-configured. For example, an
  507. /// invalid placeID specified on the shareContent would produce a data error.
  508. @property (nonatomic) BOOL shouldFailOnDataError;
  509. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  510. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  511. /// Convenience initializer to return a Message Share Dialog with content and a delegate.
  512. /// @param content The content to be shared.
  513. /// @param delegate The receiver’s delegate.
  514. - (nonnull instancetype)initWithContent:(id <FBSDKSharingContent> _Nullable)content delegate:(id <FBSDKSharingDelegate> _Nullable)delegate;
  515. /// Convenience method to return a Message Share Dialog with content and a delegate.
  516. /// @param content The content to be shared.
  517. /// @param delegate The receiver’s delegate.
  518. + (FBSDKMessageDialog * _Nonnull)dialogWithContent:(id <FBSDKSharingContent> _Nullable)content delegate:(id <FBSDKSharingDelegate> _Nullable)delegate SWIFT_WARN_UNUSED_RESULT;
  519. /// Convenience method to show a Message Share Dialog with content and a delegate.
  520. /// @param content The content to be shared.
  521. /// @param delegate The receiver’s delegate.
  522. + (FBSDKMessageDialog * _Nonnull)showWithContent:(id <FBSDKSharingContent> _Nullable)content delegate:(id <FBSDKSharingDelegate> _Nullable)delegate SWIFT_WARN_UNUSED_RESULT;
  523. /// A Boolean value that indicates whether the receiver can initiate a share.
  524. /// May return <code>false</code> if the appropriate Facebook app is not installed and is required or an access token is
  525. /// required but not available. This method does not validate the content on the receiver, so this can be checked before
  526. /// building up the content.
  527. /// See <code>Sharing.validate()</code>
  528. /// @return <code>true</code> if the receiver can share, otherwise <code>false</code>.
  529. @property (nonatomic, readonly) BOOL canShow;
  530. /// Shows the dialog.
  531. /// @return <code>true</code> if the receiver was able to begin sharing, otherwise <code>false</code>.
  532. - (BOOL)show;
  533. /// Validates the content on the receiver.
  534. /// @return <code>true</code> if the content is valid, otherwise <code>false</code>.
  535. - (BOOL)validateWithError:(NSError * _Nullable * _Nullable)error;
  536. @end
  537. /// A model for content to share with a Facebook camera effect.
  538. SWIFT_CLASS_NAMED("ShareCameraEffectContent")
  539. @interface FBSDKShareCameraEffectContent : NSObject
  540. /// ID of the camera effect to use.
  541. @property (nonatomic, copy) NSString * _Nonnull effectID;
  542. /// Arguments for the effect.
  543. @property (nonatomic, strong) FBSDKCameraEffectArguments * _Nonnull effectArguments;
  544. /// Textures for the effect.
  545. @property (nonatomic, strong) FBSDKCameraEffectTextures * _Nonnull effectTextures;
  546. /// URL for the content being shared.
  547. /// This URL will be checked for all link meta tags for linking in platform specific ways. See documentation
  548. /// for App Links (https://developers.facebook.com/docs/applinks/)
  549. @property (nonatomic, copy) NSURL * _Nullable contentURL;
  550. /// Hashtag for the content being shared.
  551. @property (nonatomic, strong) FBSDKHashtag * _Nullable hashtag;
  552. /// List of IDs for taggable people to tag with this content.
  553. /// See documentation for Taggable Friends
  554. /// (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends)
  555. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull peopleIDs;
  556. /// The ID for a place to tag with this content.
  557. @property (nonatomic, copy) NSString * _Nullable placeID;
  558. /// A value to be added to the referrer URL when a person follows a link from this shared content on feed.
  559. @property (nonatomic, copy) NSString * _Nullable ref;
  560. /// For shares into Messenger, this pageID will be used to map the app to page and attach attribution to the share.
  561. @property (nonatomic, copy) NSString * _Nullable pageID;
  562. /// A unique identifier for a share involving this content, useful for tracking purposes.
  563. @property (nonatomic, readonly, copy) NSString * _Nullable shareUUID;
  564. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  565. @end
  566. /// A base interface for content to be shared.
  567. SWIFT_PROTOCOL_NAMED("SharingContent")
  568. @protocol FBSDKSharingContent <FBSDKSharingValidatable, NSObject>
  569. /// URL for the content being shared.
  570. /// This URL will be checked for all link meta tags for linking in platform specific ways.
  571. /// See documentation for App Links (https://developers.facebook.com/docs/applinks/)
  572. @property (nonatomic, copy) NSURL * _Nullable contentURL;
  573. /// Hashtag for the content being shared.
  574. @property (nonatomic, strong) FBSDKHashtag * _Nullable hashtag;
  575. /// List of IDs for taggable people to tag with this content.
  576. /// See documentation for Taggable Friends
  577. /// (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends)
  578. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull peopleIDs;
  579. /// The ID for a place to tag with this content.
  580. @property (nonatomic, copy) NSString * _Nullable placeID;
  581. /// A value to be added to the referrer URL when a person follows a link from this shared content on feed.
  582. @property (nonatomic, copy) NSString * _Nullable ref;
  583. /// For shares into Messenger, this pageID will be used to map the app to page and attach attribution to the share.
  584. @property (nonatomic, copy) NSString * _Nullable pageID;
  585. /// A unique identifier for a share involving this content, useful for tracking purposes.
  586. @property (nonatomic, readonly, copy) NSString * _Nullable shareUUID;
  587. /// Adds content to an existing dictionary as key/value pairs and returns the
  588. /// updated dictionary
  589. /// @param existingParameters An immutable dictionary of existing values
  590. /// @param bridgeOptions The options for bridging
  591. /// @return A new dictionary with the modified contents
  592. - (NSDictionary<NSString *, id> * _Nonnull)addParameters:(NSDictionary<NSString *, id> * _Nonnull)existingParameters bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions SWIFT_WARN_UNUSED_RESULT;
  593. @end
  594. @interface FBSDKShareCameraEffectContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingContent>
  595. /// Adds content to an existing dictionary as key/value pairs and returns the
  596. /// updated dictionary
  597. /// @param existingParameters An immutable dictionary of existing values
  598. /// @param bridgeOptions The options for bridging
  599. /// @return A new dictionary with the modified contents
  600. - (NSDictionary<NSString *, id> * _Nonnull)addParameters:(NSDictionary<NSString *, id> * _Nonnull)existingParameters bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions SWIFT_WARN_UNUSED_RESULT;
  601. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  602. @end
  603. @class UIViewController;
  604. enum FBSDKShareDialogMode : NSUInteger;
  605. /// A dialog for sharing content on Facebook.
  606. SWIFT_CLASS_NAMED("ShareDialog")
  607. @interface FBSDKShareDialog : NSObject <FBSDKSharingDialog>
  608. /// A UIViewController from which to present the dialog.
  609. /// If not specified, the topmost view controller will be automatically determined as best as possible.
  610. @property (nonatomic, weak) UIViewController * _Nullable fromViewController;
  611. /// The mode with which to display the dialog.
  612. /// Defaults to <code>.automatic</code>, which will automatically choose the best available mode.
  613. @property (nonatomic) enum FBSDKShareDialogMode mode;
  614. /// The receiver’s delegate or nil if it doesn’t have a delegate.
  615. @property (nonatomic, weak) id <FBSDKSharingDelegate> _Nullable delegate;
  616. /// The content to be shared.
  617. @property (nonatomic, strong) id <FBSDKSharingContent> _Nullable shareContent;
  618. /// A Boolean value that indicates whether the receiver should fail if it finds an error with the share content.
  619. /// If <code>false</code>, the sharer will still be displayed without the data that was misconfigured. For example, an
  620. /// invalid <code>placeID</code> specified on the <code>shareContent</code> would produce a data error.
  621. @property (nonatomic) BOOL shouldFailOnDataError;
  622. /// Convenience initializer to initialize a <code>ShareDialog</code> with a view controller, content and delegate.
  623. /// @param viewController A view controller from which to present the dialog, if appropriate.
  624. /// @param content The content to be shared.
  625. /// @param delegate The dialog’s delegate.
  626. - (nonnull instancetype)initWithViewController:(UIViewController * _Nullable)viewController content:(id <FBSDKSharingContent> _Nullable)content delegate:(id <FBSDKSharingDelegate> _Nullable)delegate OBJC_DESIGNATED_INITIALIZER;
  627. /// Convenience method to create a <code>ShareDialog</code> with a view controller, content and delegate.
  628. /// @param viewController A view controller from which to present the dialog, if appropriate.
  629. /// @param content The content to be shared.
  630. /// @param delegate The dialog’s delegate.
  631. + (FBSDKShareDialog * _Nonnull)dialogWithViewController:(UIViewController * _Nullable)viewController withContent:(id <FBSDKSharingContent> _Nullable)content delegate:(id <FBSDKSharingDelegate> _Nullable)delegate SWIFT_WARN_UNUSED_RESULT;
  632. /// Convenience method to show a <code>ShareDialog</code> with a view controller, content and delegate.
  633. /// @param viewController A view controller from which to present the dialog, if appropriate.
  634. /// @param content The content to be shared.
  635. /// @param delegate The dialog’s delegate.
  636. + (FBSDKShareDialog * _Nonnull)showFromViewController:(UIViewController * _Nullable)viewController withContent:(id <FBSDKSharingContent> _Nullable)content delegate:(id <FBSDKSharingDelegate> _Nullable)delegate;
  637. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  638. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  639. @end
  640. @interface FBSDKShareDialog (SWIFT_EXTENSION(FBSDKShareKit))
  641. @end
  642. /// Modes for the FBSDKShareDialog.
  643. /// The automatic mode will progressively check the availability of different modes and open the most
  644. /// appropriate mode for the dialog that is available.
  645. typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKShareDialogMode, "Mode", open) {
  646. /// Acts with the most appropriate mode that is available.
  647. FBSDKShareDialogModeAutomatic = 0,
  648. /// Displays the dialog in the main native Facebook app.
  649. FBSDKShareDialogModeNative = 1,
  650. /// Displays the dialog in the iOS integrated share sheet.
  651. FBSDKShareDialogModeShareSheet = 2,
  652. /// Displays the dialog in Safari.
  653. FBSDKShareDialogModeBrowser = 3,
  654. /// Displays the dialog in a WKWebView within the app.
  655. FBSDKShareDialogModeWeb = 4,
  656. /// Displays the feed dialog in Safari.
  657. FBSDKShareDialogModeFeedBrowser = 5,
  658. /// Displays the feed dialog in a WKWebView within the app.
  659. FBSDKShareDialogModeFeedWeb = 6,
  660. };
  661. @class FBSDKWebDialog;
  662. @interface FBSDKShareDialog (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKWebDialogDelegate>
  663. - (void)webDialog:(FBSDKWebDialog * _Nonnull)webDialog didCompleteWithResults:(NSDictionary<NSString *, id> * _Nonnull)results;
  664. - (void)webDialog:(FBSDKWebDialog * _Nonnull)webDialog didFailWithError:(NSError * _Nonnull)error;
  665. - (void)webDialogDidCancel:(FBSDKWebDialog * _Nonnull)webDialog;
  666. @end
  667. @interface FBSDKShareDialog (SWIFT_EXTENSION(FBSDKShareKit))
  668. @property (nonatomic, readonly) BOOL canShow;
  669. - (BOOL)show;
  670. - (BOOL)validateWithError:(NSError * _Nullable * _Nullable)error;
  671. @end
  672. /// ShareError
  673. /// Error codes for ShareErrorDomain.
  674. typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKShareError, "ShareError", open) {
  675. /// Reserved
  676. FBSDKShareErrorReserved = 200,
  677. /// The error code for errors from uploading open graph objects.
  678. FBSDKShareErrorOpenGraph = 201,
  679. /// The error code for when a sharing dialog is not available.
  680. /// Use the canShare methods to check for this case before calling show.
  681. FBSDKShareErrorDialogNotAvailable = 202,
  682. /// The error code for unknown errors.
  683. FBSDKShareErrorUnknown = 203,
  684. };
  685. /// A model for status and link content to be shared.
  686. SWIFT_CLASS_NAMED("ShareLinkContent")
  687. @interface FBSDKShareLinkContent : NSObject
  688. /// Some quote text of the link.
  689. /// If specified, the quote text will render with custom styling on top of the link.
  690. @property (nonatomic, copy) NSString * _Nullable quote;
  691. /// URL for the content being shared.
  692. /// This URL will be checked for all link meta tags for linking in platform specific ways. See documentation
  693. /// for App Links (https://developers.facebook.com/docs/applinks/)
  694. @property (nonatomic, copy) NSURL * _Nullable contentURL;
  695. /// Hashtag for the content being shared.
  696. @property (nonatomic, strong) FBSDKHashtag * _Nullable hashtag;
  697. /// List of IDs for taggable people to tag with this content.
  698. /// See documentation for Taggable Friends
  699. /// (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends)
  700. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull peopleIDs;
  701. /// The ID for a place to tag with this content.
  702. @property (nonatomic, copy) NSString * _Nullable placeID;
  703. /// A value to be added to the referrer URL when a person follows a link from this shared content on feed.
  704. @property (nonatomic, copy) NSString * _Nullable ref;
  705. /// For shares into Messenger, this pageID will be used to map the app to page and attach attribution to the share.
  706. @property (nonatomic, copy) NSString * _Nullable pageID;
  707. /// A unique identifier for a share involving this content, useful for tracking purposes.
  708. @property (nonatomic, readonly, copy) NSString * _Nullable shareUUID;
  709. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  710. @end
  711. @interface FBSDKShareLinkContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingContent>
  712. /// Adds content to an existing dictionary as key/value pairs and returns the
  713. /// updated dictionary
  714. /// @param existingParameters An immutable dictionary of existing values
  715. /// @param bridgeOptions The options for bridging
  716. /// @return A new dictionary with the modified contents
  717. - (NSDictionary<NSString *, id> * _Nonnull)addParameters:(NSDictionary<NSString *, id> * _Nonnull)existingParameters bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions SWIFT_WARN_UNUSED_RESULT;
  718. @end
  719. @interface FBSDKShareLinkContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingValidatable>
  720. /// Asks the receiver to validate that its content or media values are valid.
  721. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  722. @end
  723. /// A protocol for media content (photo or video) to be shared.
  724. SWIFT_PROTOCOL_NAMED("ShareMedia")
  725. @protocol FBSDKShareMedia
  726. @end
  727. /// A model for media content (photo or video) to be shared.
  728. SWIFT_CLASS_NAMED("ShareMediaContent")
  729. @interface FBSDKShareMediaContent : NSObject
  730. /// Media to be shared: an array of <code>SharePhoto</code> or <code>ShareVideo</code>
  731. @property (nonatomic, copy) NSArray<id <FBSDKShareMedia>> * _Nonnull media;
  732. /// URL for the content being shared.
  733. /// This URL will be checked for all link meta tags for linking in platform specific ways. See documentation
  734. /// for App Links (https://developers.facebook.com/docs/applinks/)
  735. @property (nonatomic, copy) NSURL * _Nullable contentURL;
  736. /// Hashtag for the content being shared.
  737. @property (nonatomic, strong) FBSDKHashtag * _Nullable hashtag;
  738. /// List of IDs for taggable people to tag with this content.
  739. /// See documentation for Taggable Friends
  740. /// (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends)
  741. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull peopleIDs;
  742. /// The ID for a place to tag with this content.
  743. @property (nonatomic, copy) NSString * _Nullable placeID;
  744. /// A value to be added to the referrer URL when a person follows a link from this shared content on feed.
  745. @property (nonatomic, copy) NSString * _Nullable ref;
  746. /// For shares into Messenger, this pageID will be used to map the app to page and attach attribution to the share.
  747. @property (nonatomic, copy) NSString * _Nullable pageID;
  748. /// A unique identifier for a share involving this content, useful for tracking purposes.
  749. @property (nonatomic, readonly, copy) NSString * _Nullable shareUUID;
  750. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  751. @end
  752. @interface FBSDKShareMediaContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingValidatable>
  753. /// Asks the receiver to validate that its content or media values are valid.
  754. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  755. @end
  756. @interface FBSDKShareMediaContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingContent>
  757. /// Adds content to an existing dictionary as key/value pairs and returns the
  758. /// updated dictionary
  759. /// @param existingParameters An immutable dictionary of existing values
  760. /// @param bridgeOptions The options for bridging
  761. /// @return A new dictionary with the modified contents
  762. - (NSDictionary<NSString *, id> * _Nonnull)addParameters:(NSDictionary<NSString *, id> * _Nonnull)existingParameters bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions SWIFT_WARN_UNUSED_RESULT;
  763. @end
  764. @class PHAsset;
  765. /// A photo for sharing.
  766. SWIFT_CLASS_NAMED("SharePhoto")
  767. @interface FBSDKSharePhoto : NSObject <FBSDKShareMedia>
  768. /// If the photo is resident in memory, this method supplies the data.
  769. @property (nonatomic, strong) UIImage * _Nullable image;
  770. /// URL that points to a network location or the location of the photo on disk
  771. @property (nonatomic, copy) NSURL * _Nullable imageURL;
  772. /// The representation of the photo in the Photos library.
  773. @property (nonatomic, strong) PHAsset * _Nullable photoAsset;
  774. /// Specifies whether the photo represented by the receiver was generated by the user (<code>true</code>)
  775. /// or by the application (<code>false</code>).
  776. @property (nonatomic) BOOL isUserGenerated;
  777. /// The user-generated caption for the photo. Note that the ‘caption’ must come from
  778. /// the user, as pre-filled content is forbidden by the Platform Policies (2.3).
  779. @property (nonatomic, copy) NSString * _Nullable caption;
  780. /// Convenience method to build a new photo object with an image.
  781. /// \param image If the photo is resident in memory, this method supplies the data
  782. ///
  783. /// \param isUserGenerated Specifies whether the photo represented by the receiver was generated by the user or by the
  784. /// application
  785. ///
  786. - (nonnull instancetype)initWithImage:(UIImage * _Nonnull)image isUserGenerated:(BOOL)isUserGenerated;
  787. /// Convenience method to build a new photo object with an imageURL.
  788. /// This method should only be used when adding photo content to open graph stories.
  789. /// For example, if you’re trying to share a photo from the web by itself, download the image and use
  790. /// <code>init(image:isUserGenerated:)</code> instead.
  791. /// \param imageURL The URL to the photo
  792. ///
  793. /// \param isUserGenerated Specifies whether the photo represented by the receiver was generated by the user or by the
  794. /// application
  795. ///
  796. - (nonnull instancetype)initWithImageURL:(NSURL * _Nonnull)imageURL isUserGenerated:(BOOL)isUserGenerated;
  797. /// Convenience method to build a new photo object with a PHAsset.
  798. /// \param photoAsset The PHAsset that represents the photo in the Photos library.
  799. ///
  800. /// \param isUserGenerated Specifies whether the photo represented by the receiver was generated by the user or by
  801. /// the application
  802. ///
  803. - (nonnull instancetype)initWithPhotoAsset:(PHAsset * _Nonnull)photoAsset isUserGenerated:(BOOL)isUserGenerated;
  804. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  805. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  806. @end
  807. @interface FBSDKSharePhoto (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingValidatable>
  808. /// Asks the receiver to validate that its content or media values are valid.
  809. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  810. @end
  811. /// A model for photo content to be shared.
  812. SWIFT_CLASS_NAMED("SharePhotoContent")
  813. @interface FBSDKSharePhotoContent : NSObject
  814. /// Photos to be shared.
  815. @property (nonatomic, copy) NSArray<FBSDKSharePhoto *> * _Nonnull photos;
  816. /// URL for the content being shared.
  817. /// This URL will be checked for all link meta tags for linking in platform specific ways. See documentation
  818. /// for App Links (https://developers.facebook.com/docs/applinks/)
  819. @property (nonatomic, copy) NSURL * _Nullable contentURL;
  820. /// Hashtag for the content being shared.
  821. @property (nonatomic, strong) FBSDKHashtag * _Nullable hashtag;
  822. /// List of IDs for taggable people to tag with this content.
  823. /// See documentation for Taggable Friends
  824. /// (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends)
  825. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull peopleIDs;
  826. /// The ID for a place to tag with this content.
  827. @property (nonatomic, copy) NSString * _Nullable placeID;
  828. /// A value to be added to the referrer URL when a person follows a link from this shared content on feed.
  829. @property (nonatomic, copy) NSString * _Nullable ref;
  830. /// For shares into Messenger, this pageID will be used to map the app to page and attach attribution to the share.
  831. @property (nonatomic, copy) NSString * _Nullable pageID;
  832. /// A unique identifier for a share involving this content, useful for tracking purposes.
  833. @property (nonatomic, readonly, copy) NSString * _Nullable shareUUID;
  834. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  835. @end
  836. @interface FBSDKSharePhotoContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingContent>
  837. /// Adds content to an existing dictionary as key/value pairs and returns the
  838. /// updated dictionary
  839. /// @param existingParameters An immutable dictionary of existing values
  840. /// @param bridgeOptions The options for bridging
  841. /// @return A new dictionary with the modified contents
  842. - (NSDictionary<NSString *, id> * _Nonnull)addParameters:(NSDictionary<NSString *, id> * _Nonnull)existingParameters bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions SWIFT_WARN_UNUSED_RESULT;
  843. @end
  844. @interface FBSDKSharePhotoContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingValidatable>
  845. /// Validate that this content contains valid values
  846. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  847. @end
  848. @class NSData;
  849. /// A video for sharing.
  850. SWIFT_CLASS_NAMED("ShareVideo")
  851. @interface FBSDKShareVideo : NSObject <FBSDKShareMedia>
  852. /// The raw video data.
  853. @property (nonatomic, copy) NSData * _Nullable data;
  854. /// The representation of the video in the Photos library.
  855. @property (nonatomic, strong) PHAsset * _Nullable videoAsset;
  856. /// The file URL to the video.
  857. @property (nonatomic, copy) NSURL * _Nullable videoURL;
  858. /// The photo that represents the video.
  859. @property (nonatomic, strong) FBSDKSharePhoto * _Nullable previewPhoto;
  860. /// Convenience method to build a new video object from raw data and an optional preview photo.
  861. /// \param data The Data object that holds the raw video data.
  862. ///
  863. /// \param previewPhoto The photo that represents the video.
  864. ///
  865. - (nonnull instancetype)initWithData:(NSData * _Nonnull)data previewPhoto:(FBSDKSharePhoto * _Nullable)previewPhoto;
  866. /// Convenience method to build a new video object from a PHAsset and an optional preview photo.
  867. /// \param videoAsset The PHAsset that represents the video in the Photos library.
  868. ///
  869. /// \param previewPhoto The photo that represents the video.
  870. ///
  871. - (nonnull instancetype)initWithVideoAsset:(PHAsset * _Nonnull)videoAsset previewPhoto:(FBSDKSharePhoto * _Nullable)previewPhoto;
  872. /// Convenience method to build a new video object from a URL and an optional preview photo.
  873. /// \param videoURL The URL to the video.
  874. ///
  875. /// \param previewPhoto The photo that represents the video.
  876. ///
  877. - (nonnull instancetype)initWithVideoURL:(NSURL * _Nonnull)videoURL previewPhoto:(FBSDKSharePhoto * _Nullable)previewPhoto;
  878. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  879. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  880. @end
  881. @interface FBSDKShareVideo (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingValidatable>
  882. /// Asks the receiver to validate that its content or media values are valid.
  883. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  884. @end
  885. /// A model for video content to be shared.
  886. SWIFT_CLASS_NAMED("ShareVideoContent")
  887. @interface FBSDKShareVideoContent : NSObject
  888. /// The video to be shared
  889. @property (nonatomic, strong) FBSDKShareVideo * _Nonnull video;
  890. /// URL for the content being shared.
  891. /// This URL will be checked for all link meta tags for linking in platform specific ways. See documentation
  892. /// for App Links (https://developers.facebook.com/docs/applinks/)
  893. @property (nonatomic, copy) NSURL * _Nullable contentURL;
  894. /// Hashtag for the content being shared.
  895. @property (nonatomic, strong) FBSDKHashtag * _Nullable hashtag;
  896. /// List of IDs for taggable people to tag with this content.
  897. /// See documentation for Taggable Friends
  898. /// (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends)
  899. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull peopleIDs;
  900. /// The ID for a place to tag with this content.
  901. @property (nonatomic, copy) NSString * _Nullable placeID;
  902. /// A value to be added to the referrer URL when a person follows a link from this shared content on feed.
  903. @property (nonatomic, copy) NSString * _Nullable ref;
  904. /// For shares into Messenger, this pageID will be used to map the app to page and attach attribution to the share.
  905. @property (nonatomic, copy) NSString * _Nullable pageID;
  906. /// A unique identifier for a share involving this content, useful for tracking purposes.
  907. @property (nonatomic, readonly, copy) NSString * _Nullable shareUUID;
  908. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  909. @end
  910. @interface FBSDKShareVideoContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingContent>
  911. /// Adds content to an existing dictionary as key/value pairs and returns the
  912. /// updated dictionary
  913. /// @param existingParameters An immutable dictionary of existing values
  914. /// @param bridgeOptions The options for bridging
  915. /// @return A new dictionary with the modified contents
  916. - (NSDictionary<NSString *, id> * _Nonnull)addParameters:(NSDictionary<NSString *, id> * _Nonnull)existingParameters bridgeOptions:(FBSDKShareBridgeOptions)bridgeOptions SWIFT_WARN_UNUSED_RESULT;
  917. @end
  918. @interface FBSDKShareVideoContent (SWIFT_EXTENSION(FBSDKShareKit)) <FBSDKSharingValidatable>
  919. - (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError * _Nullable * _Nullable)error;
  920. @end
  921. /// A delegate for types conforming to the <code>Sharing</code> protocol.
  922. /// The delegate is notified with the results of the sharer as long as the application has permissions to
  923. /// receive the information. For example, if the person is not signed into the containing app, the sharer may not be able
  924. /// to distinguish between completion of a share and cancellation.
  925. SWIFT_PROTOCOL_NAMED("SharingDelegate")
  926. @protocol FBSDKSharingDelegate
  927. /// Sent to the delegate when sharing completes without error or cancellation.
  928. /// @param sharer The sharer that completed.
  929. /// @param results The results from the sharer. This may be nil or empty.
  930. - (void)sharer:(id <FBSDKSharing> _Nonnull)sharer didCompleteWithResults:(NSDictionary<NSString *, id> * _Nonnull)results;
  931. /// Sent to the delegate when the sharer encounters an error.
  932. /// @param sharer The sharer that completed.
  933. /// @param error The error.
  934. - (void)sharer:(id <FBSDKSharing> _Nonnull)sharer didFailWithError:(NSError * _Nonnull)error;
  935. /// Sent to the delegate when the sharer is cancelled.
  936. /// @param sharer The sharer that completed.
  937. - (void)sharerDidCancel:(id <FBSDKSharing> _Nonnull)sharer;
  938. @end
  939. #endif
  940. #if __has_attribute(external_source_symbol)
  941. # pragma clang attribute pop
  942. #endif
  943. #if defined(__cplusplus)
  944. #endif
  945. #pragma clang diagnostic pop
  946. #endif
  947. #else
  948. #error unsupported Swift architecture
  949. #endif