FBSDKAppEvents.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. #import <Foundation/Foundation.h>
  9. #if !TARGET_OS_TV
  10. #import <WebKit/WebKit.h>
  11. #endif
  12. #import <FBSDKCoreKit/FBSDKAppEventName.h>
  13. #import <FBSDKCoreKit/FBSDKAppEventParameterName.h>
  14. #import <FBSDKCoreKit/FBSDKAppEventsConfiguring.h>
  15. #import <FBSDKCoreKit/FBSDKAppEventsFlushBehavior.h>
  16. #import <FBSDKCoreKit/FBSDKAppEventUserDataType.h>
  17. #import <FBSDKCoreKit/FBSDKApplicationActivating.h>
  18. #import <FBSDKCoreKit/FBSDKApplicationLifecycleObserving.h>
  19. #import <FBSDKCoreKit/FBSDKApplicationStateSetting.h>
  20. #import <FBSDKCoreKit/FBSDKEventLogging.h>
  21. #import <FBSDKCoreKit/FBSDKGraphRequest.h>
  22. #import <FBSDKCoreKit/FBSDKGraphRequestConnection.h>
  23. #import <FBSDKCoreKit/FBSDKProductAvailability.h>
  24. #import <FBSDKCoreKit/FBSDKProductCondition.h>
  25. #import <FBSDKCoreKit/FBSDKSourceApplicationTracking.h>
  26. #import <FBSDKCoreKit/FBSDKUserIDProviding.h>
  27. NS_ASSUME_NONNULL_BEGIN
  28. @class FBSDKAccessToken;
  29. /// Optional plist key ("FacebookLoggingOverrideAppID") for setting `loggingOverrideAppID`
  30. FOUNDATION_EXPORT NSString *const FBSDKAppEventsOverrideAppIDBundleKey
  31. NS_SWIFT_NAME(AppEventsOverrideAppIDBundleKey);
  32. /**
  33. Client-side event logging for specialized application analytics available through Facebook App Insights
  34. and for use with Facebook Ads conversion tracking and optimization.
  35. The `FBSDKAppEvents` static class has a few related roles:
  36. + Logging predefined and application-defined events to Facebook App Insights with a
  37. numeric value to sum across a large number of events, and an optional set of key/value
  38. parameters that define "segments" for this event (e.g., 'purchaserStatus' : 'frequent', or
  39. 'gamerLevel' : 'intermediate')
  40. + Logging events to later be used for ads optimization around lifetime value.
  41. + Methods that control the way in which events are flushed out to the Facebook servers.
  42. Here are some important characteristics of the logging mechanism provided by `FBSDKAppEvents`:
  43. + Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers
  44. in a number of situations:
  45. - when an event count threshold is passed (currently 100 logged events).
  46. - when a time threshold is passed (currently 15 seconds).
  47. - when an app has gone to background and is then brought back to the foreground.
  48. + Events will be accumulated when the app is in a disconnected state, and sent when the connection is
  49. restored and one of the above 'flush' conditions are met.
  50. + The `FBSDKAppEvents` class is thread-safe in that events may be logged from any of the app's threads.
  51. + The developer can set the `flushBehavior` on `FBSDKAppEvents` to force the flushing of events to only
  52. occur on an explicit call to the `flush` method.
  53. + The developer can turn on console debug output for event logging and flushing to the server by using
  54. the `FBSDKLoggingBehaviorAppEvents` value in `[FBSettings setLoggingBehavior:]`.
  55. Some things to note when logging events:
  56. + There is a limit on the number of unique event names an app can use, on the order of 1000.
  57. + There is a limit to the number of unique parameter names in the provided parameters that can
  58. be used per event, on the order of 25. This is not just for an individual call, but for all
  59. invocations for that eventName.
  60. + Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and
  61. must consist of alphanumeric characters, _, -, or spaces.
  62. + The length of each parameter value can be no more than on the order of 100 characters.
  63. */
  64. NS_SWIFT_NAME(AppEvents)
  65. @interface FBSDKAppEvents : NSObject <
  66. FBSDKEventLogging,
  67. FBSDKAppEventsConfiguring,
  68. FBSDKApplicationActivating,
  69. FBSDKApplicationLifecycleObserving,
  70. FBSDKApplicationStateSetting,
  71. FBSDKSourceApplicationTracking,
  72. FBSDKUserIDProviding
  73. >
  74. - (instancetype)init NS_UNAVAILABLE;
  75. + (instancetype)new NS_UNAVAILABLE;
  76. /// The shared instance of AppEvents.
  77. @property (class, nonatomic, readonly, strong) FBSDKAppEvents *shared;
  78. /// Control over event batching/flushing
  79. /// The current event flushing behavior specifying when events are sent back to Facebook servers.
  80. @property (nonatomic) FBSDKAppEventsFlushBehavior flushBehavior;
  81. /**
  82. Set the 'override' App ID for App Event logging.
  83. In some cases, apps want to use one Facebook App ID for login and social presence and another
  84. for App Event logging. (An example is if multiple apps from the same company share an app ID for login, but
  85. want distinct logging.) By default, this value is `nil`, and defers to the `FBSDKAppEventsOverrideAppIDBundleKey`
  86. plist value. If that's not set, it defaults to `Settings.shared.appID`.
  87. This should be set before any other calls are made to `AppEvents`. Thus, you should set it in your application
  88. delegate's `application(_:didFinishLaunchingWithOptions:)` method.
  89. */
  90. @property (nullable, nonatomic, copy) NSString *loggingOverrideAppID;
  91. /**
  92. The custom user ID to associate with all app events.
  93. The userID is persisted until it is cleared by passing `nil`.
  94. */
  95. @property (nullable, nonatomic, copy) NSString *userID;
  96. /// Returns generated anonymous id that persisted with current install of the app
  97. @property (nonatomic, readonly) NSString *anonymousID;
  98. /*
  99. * Basic event logging
  100. */
  101. /**
  102. Log an event with just an event name.
  103. @param eventName The name of the event to record. Limitations on number of events and name length
  104. are given in the `AppEvents` documentation.
  105. */
  106. - (void)logEvent:(FBSDKAppEventName)eventName;
  107. /**
  108. Log an event with an event name and a numeric value to be aggregated with other events of this name.
  109. @param eventName The name of the event to record. Limitations on number of events and name length
  110. are given in the `AppEvents` documentation. Common event names are provided in `AppEvents.Name` constants.
  111. @param valueToSum Amount to be aggregated into all events of this event name, and App Insights will report
  112. the cumulative and average value of this amount.
  113. */
  114. - (void)logEvent:(FBSDKAppEventName)eventName
  115. valueToSum:(double)valueToSum;
  116. /**
  117. Log an event with an event name and a set of key/value pairs in the parameters dictionary.
  118. Parameter limitations are described above.
  119. @param eventName The name of the event to record. Limitations on number of events and name construction
  120. are given in the `AppEvents` documentation. Common event names are provided in `AppEvents.Name` constants.
  121. @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
  122. be `NSString`s, and the values are expected to be `NSString` or `NSNumber`. Limitations on the number of
  123. parameters and name construction are given in the `AppEvents` documentation. Commonly used parameter names
  124. are provided in `AppEvents.ParameterName` constants.
  125. */
  126. - (void)logEvent:(FBSDKAppEventName)eventName
  127. parameters:(nullable NSDictionary<FBSDKAppEventParameterName, id> *)parameters;
  128. /**
  129. Log an event with an event name, a numeric value to be aggregated with other events of this name,
  130. and a set of key/value pairs in the parameters dictionary.
  131. @param eventName The name of the event to record. Limitations on number of events and name construction
  132. are given in the `AppEvents` documentation. Common event names are provided in `AppEvents.Name` constants.
  133. @param valueToSum Amount to be aggregated into all events of this event name, and App Insights will report
  134. the cumulative and average value of this amount.
  135. @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
  136. be `NSString`s, and the values are expected to be `NSString` or `NSNumber`. Limitations on the number of
  137. parameters and name construction are given in the `AppEvents` documentation. Commonly used parameter names
  138. are provided in `AppEvents.ParameterName` constants.
  139. */
  140. - (void)logEvent:(FBSDKAppEventName)eventName
  141. valueToSum:(double)valueToSum
  142. parameters:(nullable NSDictionary<FBSDKAppEventParameterName, id> *)parameters;
  143. /**
  144. Log an event with an event name, a numeric value to be aggregated with other events of this name,
  145. and a set of key/value pairs in the parameters dictionary.
  146. @param eventName The name of the event to record. Limitations on number of events and name construction
  147. are given in the `AppEvents` documentation. Common event names are provided in `AppEvents.Name` constants.
  148. @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report
  149. the cumulative and average value of this amount. Note that this is an `NSNumber`, and a value of `nil` denotes
  150. that this event doesn't have a value associated with it for summation.
  151. @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
  152. be `NSString`s, and the values are expected to be `NSString` or `NSNumber`. Limitations on the number of
  153. parameters and name construction are given in the `AppEvents` documentation. Commonly used parameter names
  154. are provided in `AppEvents.ParameterName` constants.
  155. @param accessToken The optional access token to log the event as.
  156. */
  157. - (void)logEvent:(FBSDKAppEventName)eventName
  158. valueToSum:(nullable NSNumber *)valueToSum
  159. parameters:(nullable NSDictionary<FBSDKAppEventParameterName, id> *)parameters
  160. accessToken:(nullable FBSDKAccessToken *)accessToken;
  161. /*
  162. * Purchase logging
  163. */
  164. /**
  165. Log a purchase of the specified amount, in the specified currency.
  166. @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value
  167. will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
  168. @param currency Currency string (e.g., "USD", "EUR", "GBP"); see ISO-4217 for
  169. specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
  170. This event immediately triggers a flush of the `AppEvents` event queue, unless the `flushBehavior` is set
  171. to `FBSDKAppEventsFlushBehaviorExplicitOnly`.
  172. */
  173. // UNCRUSTIFY_FORMAT_OFF
  174. - (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency
  175. NS_SWIFT_NAME(logPurchase(amount:currency:));
  176. // UNCRUSTIFY_FORMAT_ON
  177. /**
  178. Log a purchase of the specified amount, in the specified currency, also providing a set of
  179. additional characteristics describing the purchase.
  180. @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value
  181. will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
  182. @param currency Currency string (e.g., "USD", "EUR", "GBP"); see ISO-4217 for
  183. specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
  184. @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
  185. be `NSString`s, and the values are expected to be `NSString` or `NSNumber`. Limitations on the number of
  186. parameters and name construction are given in the `AppEvents` documentation. Commonly used parameter names
  187. are provided in `AppEvents.ParameterName` constants.
  188. This event immediately triggers a flush of the `AppEvents` event queue, unless the `flushBehavior` is set
  189. to `FBSDKAppEventsFlushBehaviorExplicitOnly`.
  190. */
  191. // UNCRUSTIFY_FORMAT_OFF
  192. - (void)logPurchase:(double)purchaseAmount
  193. currency:(NSString *)currency
  194. parameters:(nullable NSDictionary<FBSDKAppEventParameterName, id> *)parameters
  195. NS_SWIFT_NAME(logPurchase(amount:currency:parameters:));
  196. // UNCRUSTIFY_FORMAT_ON
  197. /**
  198. Log a purchase of the specified amount, in the specified currency, also providing a set of
  199. additional characteristics describing the purchase.
  200. @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value
  201. will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
  202. @param currency Currency string (e.g., "USD", "EUR", "GBP"); see ISO-4217 for
  203. specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
  204. @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
  205. be `NSString`s, and the values are expected to be `NSString` or `NSNumber`. Limitations on the number of
  206. parameters and name construction are given in the `AppEvents` documentation. Commonly used parameter names
  207. are provided in `AppEvents.ParameterName` constants.
  208. @param accessToken The optional access token to log the event as.
  209. This event immediately triggers a flush of the `AppEvents` event queue, unless the `flushBehavior` is set
  210. to `FBSDKAppEventsFlushBehaviorExplicitOnly`.
  211. */
  212. // UNCRUSTIFY_FORMAT_OFF
  213. - (void)logPurchase:(double)purchaseAmount
  214. currency:(NSString *)currency
  215. parameters:(nullable NSDictionary<FBSDKAppEventParameterName, id> *)parameters
  216. accessToken:(nullable FBSDKAccessToken *)accessToken
  217. NS_SWIFT_NAME(logPurchase(amount:currency:parameters:accessToken:));
  218. // UNCRUSTIFY_FORMAT_ON
  219. /*
  220. * Push Notifications Logging
  221. */
  222. /**
  223. Log an app event that tracks that the application was open via Push Notification.
  224. @param payload Notification payload received via `UIApplicationDelegate`.
  225. */
  226. // UNCRUSTIFY_FORMAT_OFF
  227. - (void)logPushNotificationOpen:(NSDictionary<NSString *, id> *)payload
  228. NS_SWIFT_NAME(logPushNotificationOpen(payload:));
  229. // UNCRUSTIFY_FORMAT_ON
  230. /**
  231. Log an app event that tracks that a custom action was taken from a push notification.
  232. @param payload Notification payload received via `UIApplicationDelegate`.
  233. @param action Name of the action that was taken.
  234. */
  235. // UNCRUSTIFY_FORMAT_OFF
  236. - (void)logPushNotificationOpen:(NSDictionary<NSString *, id> *)payload action:(NSString *)action
  237. NS_SWIFT_NAME(logPushNotificationOpen(payload:action:));
  238. // UNCRUSTIFY_FORMAT_ON
  239. /**
  240. Uploads product catalog product item as an app event
  241. @param itemID Unique ID for the item. Can be a variant for a product.
  242. Max size is 100.
  243. @param availability If item is in stock. Accepted values are:
  244. in stock - Item ships immediately
  245. out of stock - No plan to restock
  246. preorder - Available in future
  247. available for order - Ships in 1-2 weeks
  248. discontinued - Discontinued
  249. @param condition Product condition: new, refurbished or used.
  250. @param description Short text describing product. Max size is 5000.
  251. @param imageLink Link to item image used in ad.
  252. @param link Link to merchant's site where someone can buy the item.
  253. @param title Title of item.
  254. @param priceAmount Amount of purchase, in the currency specified by the 'currency'
  255. parameter. This value will be rounded to the thousandths place
  256. (e.g., 12.34567 becomes 12.346).
  257. @param currency Currency string (e.g., "USD", "EUR", "GBP"); see ISO-4217 for
  258. specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
  259. @param gtin Global Trade Item Number including UPC, EAN, JAN and ISBN
  260. @param mpn Unique manufacture ID for product
  261. @param brand Name of the brand
  262. Note: Either gtin, mpn or brand is required.
  263. @param parameters Optional fields for deep link specification.
  264. */
  265. // UNCRUSTIFY_FORMAT_OFF
  266. - (void)logProductItem:(NSString *)itemID
  267. availability:(FBSDKProductAvailability)availability
  268. condition:(FBSDKProductCondition)condition
  269. description:(NSString *)description
  270. imageLink:(NSString *)imageLink
  271. link:(NSString *)link
  272. title:(NSString *)title
  273. priceAmount:(double)priceAmount
  274. currency:(NSString *)currency
  275. gtin:(nullable NSString *)gtin
  276. mpn:(nullable NSString *)mpn
  277. brand:(nullable NSString *)brand
  278. parameters:(nullable NSDictionary<NSString *, id> *)parameters
  279. NS_SWIFT_NAME(logProductItem(id:availability:condition:description:imageLink:link:title:priceAmount:currency:gtin:mpn:brand:parameters:));
  280. // UNCRUSTIFY_FORMAT_ON
  281. /**
  282. Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event.
  283. This function is called automatically from FBSDKApplicationDelegate applicationDidBecomeActive, unless
  284. one overrides 'FacebookAutoLogAppEventsEnabled' key to false in the project info plist file.
  285. In case 'FacebookAutoLogAppEventsEnabled' is set to false, then it should typically be placed in the
  286. app delegates' `applicationDidBecomeActive:` method.
  287. This method also takes care of logging the event indicating the first time this app has been launched, which, among other things, is used to
  288. track user acquisition and app install ads conversions.
  289. `activateApp` will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded.
  290. "activated app" events will be logged when the app has not been active for more than 60 seconds. This method also causes a "deactivated app"
  291. event to be logged when sessions are "completed", and these events are logged with the session length, with an indication of how much
  292. time has elapsed between sessions, and with the number of background/foreground interruptions that session had. This data
  293. is all visible in your app's App Events Insights.
  294. */
  295. - (void)activateApp;
  296. /*
  297. * Push Notifications Registration and Uninstall Tracking
  298. */
  299. /**
  300. Sets and sends device token to register the current application for push notifications.
  301. Sets and sends a device token from the `Data` representation that you get from
  302. `UIApplicationDelegate.application(_:didRegisterForRemoteNotificationsWithDeviceToken:)`.
  303. @param deviceToken Device token data.
  304. */
  305. - (void)setPushNotificationsDeviceToken:(nullable NSData *)deviceToken;
  306. /**
  307. Sets and sends device token string to register the current application for push notifications.
  308. Sets and sends a device token string
  309. @param deviceTokenString Device token string.
  310. */
  311. // UNCRUSTIFY_FORMAT_OFF
  312. - (void)setPushNotificationsDeviceTokenString:(nullable NSString *)deviceTokenString
  313. NS_SWIFT_NAME(setPushNotificationsDeviceToken(_:));
  314. // UNCRUSTIFY_FORMAT_ON
  315. /**
  316. Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate
  317. kick off. Server failures will be reported through the NotificationCenter with notification ID `FBSDKAppEventsLoggingResultNotification`.
  318. */
  319. - (void)flush;
  320. /**
  321. Creates a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user.
  322. Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with,
  323. and then use the resultant Custom Audience to target ads.
  324. The JSON in the request's response will include a "custom_audience_third_party_id" key/value pair with the value being the ID retrieved.
  325. This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID.
  326. Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior
  327. across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences.
  328. The ID retrieved represents the Facebook user identified in the following way: if the specified access token is valid,
  329. the ID will represent the user associated with that token; otherwise the ID will represent the user logged into the
  330. native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out
  331. at the iOS level from ad tracking, then a `nil` ID will be returned.
  332. This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage
  333. via the `Settings.shared.isEventDataUsageLimited` flag, or a specific Facebook user cannot be identified.
  334. @param accessToken The access token to use to establish the user's identity for users logged into Facebook through this app.
  335. If `nil`, then `AccessToken.current` is used.
  336. */
  337. // UNCRUSTIFY_FORMAT_OFF
  338. - (nullable FBSDKGraphRequest *)requestForCustomAudienceThirdPartyIDWithAccessToken:(nullable FBSDKAccessToken *)accessToken
  339. NS_SWIFT_NAME(requestForCustomAudienceThirdPartyID(accessToken:));
  340. // UNCRUSTIFY_FORMAT_ON
  341. /**
  342. Sets custom user data to associate with all app events. All user data are hashed
  343. and used to match Facebook user from this instance of an application.
  344. The user data will be persisted between application instances.
  345. @param email user's email
  346. @param firstName user's first name
  347. @param lastName user's last name
  348. @param phone user's phone
  349. @param dateOfBirth user's date of birth
  350. @param gender user's gender
  351. @param city user's city
  352. @param state user's state
  353. @param zip user's zip
  354. @param country user's country
  355. */
  356. // UNCRUSTIFY_FORMAT_OFF
  357. - (void)setUserEmail:(nullable NSString *)email
  358. firstName:(nullable NSString *)firstName
  359. lastName:(nullable NSString *)lastName
  360. phone:(nullable NSString *)phone
  361. dateOfBirth:(nullable NSString *)dateOfBirth
  362. gender:(nullable NSString *)gender
  363. city:(nullable NSString *)city
  364. state:(nullable NSString *)state
  365. zip:(nullable NSString *)zip
  366. country:(nullable NSString *)country
  367. NS_SWIFT_NAME(setUser(email:firstName:lastName:phone:dateOfBirth:gender:city:state:zip:country:));
  368. // UNCRUSTIFY_FORMAT_ON
  369. /// Returns the set user data else nil
  370. - (nullable NSString *)getUserData;
  371. /// Clears the current user data
  372. - (void)clearUserData;
  373. /**
  374. Sets custom user data to associate with all app events. All user data are hashed
  375. and used to match Facebook user from this instance of an application.
  376. The user data will be persisted between application instances.
  377. @param data data
  378. @param type data type, e.g. FBSDKAppEventEmail, FBSDKAppEventPhone
  379. */
  380. - (void)setUserData:(nullable NSString *)data
  381. forType:(FBSDKAppEventUserDataType)type;
  382. /// Clears the current user data of certain type
  383. - (void)clearUserDataForType:(FBSDKAppEventUserDataType)type;
  384. #if !TARGET_OS_TV
  385. /**
  386. Intended to be used as part of a hybrid webapp.
  387. If you call this method, the FB SDK will inject a new JavaScript object into your webview.
  388. If the FB Pixel is used within the webview, and references the app ID of this app,
  389. then it will detect the presence of this injected JavaScript object
  390. and pass Pixel events back to the FB SDK for logging using the AppEvents framework.
  391. @param webView The webview to augment with the additional JavaScript behavior
  392. */
  393. - (void)augmentHybridWebView:(WKWebView *)webView;
  394. #endif
  395. /*
  396. * Unity helper functions
  397. */
  398. /**
  399. Set whether Unity is already initialized.
  400. @param isUnityInitialized Whether Unity is initialized.
  401. */
  402. - (void)setIsUnityInitialized:(BOOL)isUnityInitialized;
  403. /// Send event bindings to Unity
  404. - (void)sendEventBindingsToUnity;
  405. /*
  406. * SDK Specific Event Logging
  407. * Do not call directly outside of the SDK itself.
  408. */
  409. /**
  410. Internal Type exposed to facilitate transition to Swift.
  411. API Subject to change or removal without warning. Do not use.
  412. @warning INTERNAL - DO NOT USE
  413. */
  414. - (void)logInternalEvent:(FBSDKAppEventName)eventName
  415. parameters:(nullable NSDictionary<FBSDKAppEventParameterName, id> *)parameters
  416. isImplicitlyLogged:(BOOL)isImplicitlyLogged;
  417. /**
  418. Internal Type exposed to facilitate transition to Swift.
  419. API Subject to change or removal without warning. Do not use.
  420. @warning INTERNAL - DO NOT USE
  421. */
  422. - (void)logInternalEvent:(FBSDKAppEventName)eventName
  423. parameters:(nullable NSDictionary<FBSDKAppEventParameterName, id> *)parameters
  424. isImplicitlyLogged:(BOOL)isImplicitlyLogged
  425. accessToken:(nullable FBSDKAccessToken *)accessToken;
  426. - (void)flushForReason:(FBSDKAppEventsFlushReason)flushReason;
  427. @end
  428. NS_ASSUME_NONNULL_END