commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
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 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
|
9f077b
|
21 |
#if !TARGET_OS_TV |
H |
22 |
#import <WebKit/WebKit.h> |
|
23 |
#endif |
|
24 |
|
49b883
|
25 |
#ifdef BUCK |
9febd9
|
26 |
#import <FBSDKCoreKit/FBSDKGraphRequestConnection.h> |
49b883
|
27 |
#else |
L |
28 |
#import "FBSDKGraphRequestConnection.h" |
|
29 |
#endif |
9febd9
|
30 |
|
e81c27
|
31 |
NS_ASSUME_NONNULL_BEGIN |
H |
32 |
|
bad748
|
33 |
@class FBSDKAccessToken; |
W |
34 |
@class FBSDKGraphRequest; |
|
35 |
|
13e53a
|
36 |
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 |
H |
37 |
|
9febd9
|
38 |
/** NSNotificationCenter name indicating a result of a failed log flush attempt. The posted object will be an NSError instance. */ |
e81c27
|
39 |
FOUNDATION_EXPORT NSNotificationName const FBSDKAppEventsLoggingResultNotification |
H |
40 |
NS_SWIFT_NAME(AppEventsLoggingResult); |
13e53a
|
41 |
|
H |
42 |
#else |
|
43 |
|
|
44 |
/** NSNotificationCenter name indicating a result of a failed log flush attempt. The posted object will be an NSError instance. */ |
e81c27
|
45 |
FOUNDATION_EXPORT NSString *const FBSDKAppEventsLoggingResultNotification |
H |
46 |
NS_SWIFT_NAME(AppEventsLoggingResultNotification); |
13e53a
|
47 |
|
H |
48 |
#endif |
bad748
|
49 |
|
9febd9
|
50 |
/** optional plist key ("FacebookLoggingOverrideAppID") for setting `loggingOverrideAppID` */ |
e81c27
|
51 |
FOUNDATION_EXPORT NSString *const FBSDKAppEventsOverrideAppIDBundleKey |
H |
52 |
NS_SWIFT_NAME(AppEventsOverrideAppIDBundleKey); |
bad748
|
53 |
|
9febd9
|
54 |
/** |
bad748
|
55 |
|
9febd9
|
56 |
NS_ENUM (NSUInteger, FBSDKAppEventsFlushBehavior) |
bad748
|
57 |
|
9febd9
|
58 |
Specifies when `FBSDKAppEvents` sends log events to the server. |
bad748
|
59 |
|
W |
60 |
*/ |
|
61 |
typedef NS_ENUM(NSUInteger, FBSDKAppEventsFlushBehavior) |
|
62 |
{ |
|
63 |
|
9febd9
|
64 |
/** Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ |
bad748
|
65 |
FBSDKAppEventsFlushBehaviorAuto = 0, |
W |
66 |
|
9febd9
|
67 |
/** Only flush when the `flush` method is called. When an app is moved to background/terminated, the |
bad748
|
68 |
events are persisted and re-established at activation, but they will only be written with an |
W |
69 |
explicit call to `flush`. */ |
|
70 |
FBSDKAppEventsFlushBehaviorExplicitOnly, |
e81c27
|
71 |
} NS_SWIFT_NAME(AppEvents.FlushBehavior); |
bad748
|
72 |
|
9febd9
|
73 |
/** |
13e53a
|
74 |
NS_ENUM(NSUInteger, FBSDKProductAvailability) |
H |
75 |
Specifies product availability for Product Catalog product item update |
|
76 |
*/ |
|
77 |
typedef NS_ENUM(NSUInteger, FBSDKProductAvailability) |
|
78 |
{ |
|
79 |
/** |
|
80 |
* Item ships immediately |
|
81 |
*/ |
|
82 |
FBSDKProductAvailabilityInStock = 0, |
|
83 |
/** |
|
84 |
* No plan to restock |
|
85 |
*/ |
|
86 |
FBSDKProductAvailabilityOutOfStock, |
|
87 |
/** |
|
88 |
* Available in future |
|
89 |
*/ |
|
90 |
FBSDKProductAvailabilityPreOrder, |
|
91 |
/** |
|
92 |
* Ships in 1-2 weeks |
|
93 |
*/ |
|
94 |
FBSDKProductAvailabilityAvailableForOrder, |
|
95 |
/** |
|
96 |
* Discontinued |
|
97 |
*/ |
|
98 |
FBSDKProductAvailabilityDiscontinued, |
e81c27
|
99 |
} NS_SWIFT_NAME(AppEvents.ProductAvailability); |
13e53a
|
100 |
|
H |
101 |
/** |
|
102 |
NS_ENUM(NSUInteger, FBSDKProductCondition) |
|
103 |
Specifies product condition for Product Catalog product item update |
|
104 |
*/ |
|
105 |
typedef NS_ENUM(NSUInteger, FBSDKProductCondition) |
|
106 |
{ |
|
107 |
FBSDKProductConditionNew = 0, |
|
108 |
FBSDKProductConditionRefurbished, |
|
109 |
FBSDKProductConditionUsed, |
e81c27
|
110 |
} NS_SWIFT_NAME(AppEvents.ProductCondition); |
13e53a
|
111 |
|
H |
112 |
/** |
bad748
|
113 |
@methodgroup Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBSDKAppEvents`. |
W |
114 |
Common event parameters are provided in the `FBSDKAppEventsParameterNames*` constants. |
|
115 |
*/ |
|
116 |
|
e81c27
|
117 |
/// typedef for FBSDKAppEventName |
H |
118 |
typedef NSString *const FBSDKAppEventName NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(AppEvents.Name); |
|
119 |
|
9febd9
|
120 |
/** Log this event when the user has achieved a level in the app. */ |
e81c27
|
121 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameAchievedLevel; |
bad748
|
122 |
|
9febd9
|
123 |
/** Log this event when the user has entered their payment info. */ |
e81c27
|
124 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameAddedPaymentInfo; |
bad748
|
125 |
|
9febd9
|
126 |
/** Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */ |
e81c27
|
127 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameAddedToCart; |
bad748
|
128 |
|
9febd9
|
129 |
/** Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */ |
e81c27
|
130 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameAddedToWishlist; |
bad748
|
131 |
|
9febd9
|
132 |
/** Log this event when a user has completed registration with the app. */ |
e81c27
|
133 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameCompletedRegistration; |
bad748
|
134 |
|
9febd9
|
135 |
/** Log this event when the user has completed a tutorial in the app. */ |
e81c27
|
136 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameCompletedTutorial; |
bad748
|
137 |
|
9febd9
|
138 |
/** Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */ |
e81c27
|
139 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameInitiatedCheckout; |
H |
140 |
|
|
141 |
/** Log this event when the user has completed a transaction. The valueToSum passed to logEvent should be the total price of the transaction. */ |
|
142 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNamePurchased; |
bad748
|
143 |
|
9febd9
|
144 |
/** Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */ |
e81c27
|
145 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameRated; |
bad748
|
146 |
|
9febd9
|
147 |
/** Log this event when a user has performed a search within the app. */ |
e81c27
|
148 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameSearched; |
bad748
|
149 |
|
9febd9
|
150 |
/** Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */ |
e81c27
|
151 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameSpentCredits; |
bad748
|
152 |
|
9febd9
|
153 |
/** Log this event when the user has unlocked an achievement in the app. */ |
e81c27
|
154 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameUnlockedAchievement; |
bad748
|
155 |
|
9febd9
|
156 |
/** Log this event when a user has viewed a form of content in the app. */ |
e81c27
|
157 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameViewedContent; |
13e53a
|
158 |
|
H |
159 |
/** A telephone/SMS, email, chat or other type of contact between a customer and your business. */ |
e81c27
|
160 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameContact; |
13e53a
|
161 |
|
H |
162 |
/** The customization of products through a configuration tool or other application your business owns. */ |
e81c27
|
163 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameCustomizeProduct; |
13e53a
|
164 |
|
H |
165 |
/** The donation of funds to your organization or cause. */ |
e81c27
|
166 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameDonate; |
13e53a
|
167 |
|
H |
168 |
/** When a person finds one of your locations via web or application, with an intention to visit (example: find product at a local store). */ |
e81c27
|
169 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameFindLocation; |
13e53a
|
170 |
|
H |
171 |
/** The booking of an appointment to visit one of your locations. */ |
e81c27
|
172 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameSchedule; |
13e53a
|
173 |
|
H |
174 |
/** The start of a free trial of a product or service you offer (example: trial subscription). */ |
e81c27
|
175 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameStartTrial; |
13e53a
|
176 |
|
H |
177 |
/** The submission of an application for a product, service or program you offer (example: credit card, educational program or job). */ |
e81c27
|
178 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameSubmitApplication; |
13e53a
|
179 |
|
H |
180 |
/** The start of a paid subscription for a product or service you offer. */ |
e81c27
|
181 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameSubscribe; |
13e53a
|
182 |
|
H |
183 |
/** Log this event when the user views an ad. */ |
e81c27
|
184 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameAdImpression; |
13e53a
|
185 |
|
H |
186 |
/** Log this event when the user clicks an ad. */ |
e81c27
|
187 |
FOUNDATION_EXPORT FBSDKAppEventName FBSDKAppEventNameAdClick; |
bad748
|
188 |
|
9febd9
|
189 |
/** |
bad748
|
190 |
@methodgroup Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family |
W |
191 |
of methods on `FBSDKAppEvents`. Common event names are provided in the `FBAppEventName*` constants. |
|
192 |
*/ |
e81c27
|
193 |
|
H |
194 |
/// typedef for FBSDKAppEventParameterName |
|
195 |
typedef NSString *const FBSDKAppEventParameterName NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(AppEvents.ParameterName); |
bad748
|
196 |
|
27832c
|
197 |
/** |
H |
198 |
* Parameter key used to specify data for the one or more pieces of content being logged about. |
|
199 |
* Data should be a JSON encoded string. |
|
200 |
* Example: |
|
201 |
* "[{\"id\": \"1234\", \"quantity\": 2, \"item_price\": 5.99}, {\"id\": \"5678\", \"quantity\": 1, \"item_price\": 9.99}]" |
|
202 |
*/ |
e81c27
|
203 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameContent; |
27832c
|
204 |
|
9febd9
|
205 |
/** Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */ |
e81c27
|
206 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameContentID; |
bad748
|
207 |
|
9febd9
|
208 |
/** Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */ |
e81c27
|
209 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameContentType; |
bad748
|
210 |
|
9febd9
|
211 |
/** Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>. */ |
e81c27
|
212 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameCurrency; |
bad748
|
213 |
|
9febd9
|
214 |
/** Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */ |
e81c27
|
215 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameDescription; |
bad748
|
216 |
|
9febd9
|
217 |
/** Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ |
e81c27
|
218 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameLevel; |
bad748
|
219 |
|
9febd9
|
220 |
/** Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ |
e81c27
|
221 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameMaxRatingValue; |
bad748
|
222 |
|
9febd9
|
223 |
/** Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ |
e81c27
|
224 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameNumItems; |
bad748
|
225 |
|
9febd9
|
226 |
/** Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ |
e81c27
|
227 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNamePaymentInfoAvailable; |
bad748
|
228 |
|
9febd9
|
229 |
/** Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ |
e81c27
|
230 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameRegistrationMethod; |
bad748
|
231 |
|
9febd9
|
232 |
/** Parameter key used to specify the string provided by the user for a search operation. */ |
e81c27
|
233 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameSearchString; |
bad748
|
234 |
|
9febd9
|
235 |
/** Parameter key used to specify whether the activity being logged about was successful or not. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ |
e81c27
|
236 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameSuccess; |
13e53a
|
237 |
|
H |
238 |
/** |
|
239 |
@methodgroup Predefined event name parameters for common additional information to accompany events logged through the `logProductItem` method on `FBSDKAppEvents`. |
|
240 |
*/ |
|
241 |
|
e81c27
|
242 |
/// typedef for FBSDKAppEventParameterProduct |
H |
243 |
typedef NSString *const FBSDKAppEventParameterProduct NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(AppEvents.ParameterProduct); |
|
244 |
|
|
245 |
/** Parameter key used to specify the product item's category. */ |
|
246 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductCategory; |
|
247 |
|
13e53a
|
248 |
/** Parameter key used to specify the product item's custom label 0. */ |
e81c27
|
249 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductCustomLabel0; |
13e53a
|
250 |
|
H |
251 |
/** Parameter key used to specify the product item's custom label 1. */ |
e81c27
|
252 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductCustomLabel1; |
13e53a
|
253 |
|
H |
254 |
/** Parameter key used to specify the product item's custom label 2. */ |
e81c27
|
255 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductCustomLabel2; |
13e53a
|
256 |
|
H |
257 |
/** Parameter key used to specify the product item's custom label 3. */ |
e81c27
|
258 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductCustomLabel3; |
13e53a
|
259 |
|
H |
260 |
/** Parameter key used to specify the product item's custom label 4. */ |
e81c27
|
261 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductCustomLabel4; |
13e53a
|
262 |
|
H |
263 |
/** Parameter key used to specify the product item's AppLink app URL for iOS. */ |
e81c27
|
264 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIOSUrl; |
13e53a
|
265 |
|
H |
266 |
/** Parameter key used to specify the product item's AppLink app ID for iOS App Store. */ |
e81c27
|
267 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIOSAppStoreID; |
13e53a
|
268 |
|
H |
269 |
/** Parameter key used to specify the product item's AppLink app name for iOS. */ |
e81c27
|
270 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIOSAppName; |
13e53a
|
271 |
|
H |
272 |
/** Parameter key used to specify the product item's AppLink app URL for iPhone. */ |
e81c27
|
273 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIPhoneUrl; |
13e53a
|
274 |
|
H |
275 |
/** Parameter key used to specify the product item's AppLink app ID for iPhone App Store. */ |
e81c27
|
276 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIPhoneAppStoreID; |
13e53a
|
277 |
|
H |
278 |
/** Parameter key used to specify the product item's AppLink app name for iPhone. */ |
e81c27
|
279 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIPhoneAppName; |
13e53a
|
280 |
|
H |
281 |
/** Parameter key used to specify the product item's AppLink app URL for iPad. */ |
e81c27
|
282 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIPadUrl; |
13e53a
|
283 |
|
H |
284 |
/** Parameter key used to specify the product item's AppLink app ID for iPad App Store. */ |
e81c27
|
285 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIPadAppStoreID; |
13e53a
|
286 |
|
H |
287 |
/** Parameter key used to specify the product item's AppLink app name for iPad. */ |
e81c27
|
288 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkIPadAppName; |
13e53a
|
289 |
|
H |
290 |
/** Parameter key used to specify the product item's AppLink app URL for Android. */ |
e81c27
|
291 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkAndroidUrl; |
13e53a
|
292 |
|
H |
293 |
/** Parameter key used to specify the product item's AppLink fully-qualified package name for intent generation. */ |
e81c27
|
294 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkAndroidPackage; |
13e53a
|
295 |
|
H |
296 |
/** Parameter key used to specify the product item's AppLink app name for Android. */ |
e81c27
|
297 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkAndroidAppName; |
13e53a
|
298 |
|
H |
299 |
/** Parameter key used to specify the product item's AppLink app URL for Windows Phone. */ |
e81c27
|
300 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkWindowsPhoneUrl; |
13e53a
|
301 |
|
H |
302 |
/** Parameter key used to specify the product item's AppLink app ID, as a GUID, for App Store. */ |
e81c27
|
303 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkWindowsPhoneAppID; |
13e53a
|
304 |
|
H |
305 |
/** Parameter key used to specify the product item's AppLink app name for Windows Phone. */ |
e81c27
|
306 |
FOUNDATION_EXPORT FBSDKAppEventParameterProduct FBSDKAppEventParameterProductAppLinkWindowsPhoneAppName; |
bad748
|
307 |
|
W |
308 |
/* |
|
309 |
@methodgroup Predefined values to assign to event parameters that accompany events logged through the `logEvent` family |
|
310 |
of methods on `FBSDKAppEvents`. Common event parameters are provided in the `FBSDKAppEventParameterName*` constants. |
|
311 |
*/ |
|
312 |
|
e81c27
|
313 |
/// typedef for FBSDKAppEventParameterValue |
H |
314 |
typedef NSString *const FBSDKAppEventParameterValue NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(AppEvents.ParameterValue); |
|
315 |
|
9febd9
|
316 |
/** Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ |
e81c27
|
317 |
FOUNDATION_EXPORT FBSDKAppEventParameterValue FBSDKAppEventParameterValueYes; |
bad748
|
318 |
|
9febd9
|
319 |
/** No-valued parameter value to be used with parameter keys that need a Yes/No value */ |
e81c27
|
320 |
FOUNDATION_EXPORT FBSDKAppEventParameterValue FBSDKAppEventParameterValueNo; |
bad748
|
321 |
|
13e53a
|
322 |
/** Parameter key used to specify the type of ad in an FBSDKAppEventNameAdImpression |
H |
323 |
* or FBSDKAppEventNameAdClick event. |
|
324 |
* E.g. "banner", "interstitial", "rewarded_video", "native" */ |
e81c27
|
325 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameAdType; |
13e53a
|
326 |
|
H |
327 |
/** Parameter key used to specify the unique ID for all events within a subscription |
|
328 |
* in an FBSDKAppEventNameSubscribe or FBSDKAppEventNameStartTrial event. */ |
e81c27
|
329 |
FOUNDATION_EXPORT FBSDKAppEventParameterName FBSDKAppEventParameterNameOrderID; |
H |
330 |
|
|
331 |
/* |
|
332 |
@methodgroup Predefined values to assign to user data store |
|
333 |
*/ |
|
334 |
|
|
335 |
/// typedef for FBSDKAppEventUserDataType |
|
336 |
typedef NSString *const FBSDKAppEventUserDataType NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(AppEvents.UserDataType); |
|
337 |
|
|
338 |
/** Parameter key used to specify user's email. */ |
|
339 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventEmail; |
|
340 |
|
|
341 |
/** Parameter key used to specify user's first name. */ |
|
342 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventFirstName; |
|
343 |
|
|
344 |
/** Parameter key used to specify user's last name. */ |
|
345 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventLastName; |
|
346 |
|
|
347 |
/** Parameter key used to specify user's phone. */ |
|
348 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventPhone; |
|
349 |
|
|
350 |
/** Parameter key used to specify user's date of birth. */ |
|
351 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventDateOfBirth; |
|
352 |
|
|
353 |
/** Parameter key used to specify user's gender. */ |
|
354 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventGender; |
|
355 |
|
|
356 |
/** Parameter key used to specify user's city. */ |
|
357 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventCity; |
|
358 |
|
|
359 |
/** Parameter key used to specify user's state. */ |
|
360 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventState; |
|
361 |
|
|
362 |
/** Parameter key used to specify user's zip. */ |
|
363 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventZip; |
|
364 |
|
|
365 |
/** Parameter key used to specify user's country. */ |
|
366 |
FOUNDATION_EXPORT FBSDKAppEventUserDataType FBSDKAppEventCountry; |
bad748
|
367 |
|
9febd9
|
368 |
/** |
bad748
|
369 |
|
W |
370 |
|
9febd9
|
371 |
Client-side event logging for specialized application analytics available through Facebook App Insights |
bad748
|
372 |
and for use with Facebook Ads conversion tracking and optimization. |
W |
373 |
|
9febd9
|
374 |
|
W |
375 |
|
bad748
|
376 |
The `FBSDKAppEvents` static class has a few related roles: |
W |
377 |
|
|
378 |
+ Logging predefined and application-defined events to Facebook App Insights with a |
|
379 |
numeric value to sum across a large number of events, and an optional set of key/value |
|
380 |
parameters that define "segments" for this event (e.g., 'purchaserStatus' : 'frequent', or |
|
381 |
'gamerLevel' : 'intermediate') |
|
382 |
|
|
383 |
+ Logging events to later be used for ads optimization around lifetime value. |
|
384 |
|
|
385 |
+ Methods that control the way in which events are flushed out to the Facebook servers. |
|
386 |
|
|
387 |
Here are some important characteristics of the logging mechanism provided by `FBSDKAppEvents`: |
|
388 |
|
|
389 |
+ Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers |
|
390 |
in a number of situations: |
|
391 |
- when an event count threshold is passed (currently 100 logged events). |
|
392 |
- when a time threshold is passed (currently 15 seconds). |
|
393 |
- when an app has gone to background and is then brought back to the foreground. |
|
394 |
|
|
395 |
+ Events will be accumulated when the app is in a disconnected state, and sent when the connection is |
|
396 |
restored and one of the above 'flush' conditions are met. |
|
397 |
|
|
398 |
+ The `FBSDKAppEvents` class is thread-safe in that events may be logged from any of the app's threads. |
|
399 |
|
|
400 |
+ The developer can set the `flushBehavior` on `FBSDKAppEvents` to force the flushing of events to only |
|
401 |
occur on an explicit call to the `flush` method. |
|
402 |
|
|
403 |
+ The developer can turn on console debug output for event logging and flushing to the server by using |
|
404 |
the `FBSDKLoggingBehaviorAppEvents` value in `[FBSettings setLoggingBehavior:]`. |
|
405 |
|
|
406 |
Some things to note when logging events: |
|
407 |
|
|
408 |
+ There is a limit on the number of unique event names an app can use, on the order of 1000. |
|
409 |
+ There is a limit to the number of unique parameter names in the provided parameters that can |
|
410 |
be used per event, on the order of 25. This is not just for an individual call, but for all |
|
411 |
invocations for that eventName. |
|
412 |
+ Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and |
|
413 |
must consist of alphanumeric characters, _, -, or spaces. |
|
414 |
+ The length of each parameter value can be no more than on the order of 100 characters. |
|
415 |
|
|
416 |
*/ |
e81c27
|
417 |
|
H |
418 |
NS_SWIFT_NAME(AppEvents) |
bad748
|
419 |
@interface FBSDKAppEvents : NSObject |
e81c27
|
420 |
|
H |
421 |
- (instancetype)init NS_UNAVAILABLE; |
|
422 |
+ (instancetype)new NS_UNAVAILABLE; |
|
423 |
|
|
424 |
/* |
|
425 |
* Control over event batching/flushing |
|
426 |
*/ |
|
427 |
|
|
428 |
/** |
|
429 |
|
|
430 |
The current event flushing behavior specifying when events are sent back to Facebook servers. |
|
431 |
*/ |
|
432 |
@property (class, nonatomic, assign) FBSDKAppEventsFlushBehavior flushBehavior; |
|
433 |
|
|
434 |
/** |
|
435 |
Set the 'override' App ID for App Event logging. |
|
436 |
|
|
437 |
|
|
438 |
|
|
439 |
In some cases, apps want to use one Facebook App ID for login and social presence and another |
|
440 |
for App Event logging. (An example is if multiple apps from the same company share an app ID for login, but |
|
441 |
want distinct logging.) By default, this value is `nil`, and defers to the `FBSDKAppEventsOverrideAppIDBundleKey` |
|
442 |
plist value. If that's not set, it defaults to `[FBSDKSettings appID]`. |
|
443 |
|
|
444 |
This should be set before any other calls are made to `FBSDKAppEvents`. Thus, you should set it in your application |
|
445 |
delegate's `application:didFinishLaunchingWithOptions:` delegate. |
|
446 |
*/ |
|
447 |
@property (class, nonatomic, copy, nullable) NSString *loggingOverrideAppID; |
|
448 |
|
|
449 |
/* |
|
450 |
The custom user ID to associate with all app events. |
|
451 |
|
|
452 |
The userID is persisted until it is cleared by passing nil. |
|
453 |
*/ |
|
454 |
@property (class, nonatomic, copy, nullable) NSString *userID; |
49b883
|
455 |
|
L |
456 |
/* |
|
457 |
Returns generated anonymous id that persisted with current install of the app |
|
458 |
*/ |
|
459 |
@property (class, nonatomic, readonly) NSString *anonymousID; |
bad748
|
460 |
|
W |
461 |
/* |
|
462 |
* Basic event logging |
|
463 |
*/ |
|
464 |
|
9febd9
|
465 |
/** |
bad748
|
466 |
|
9febd9
|
467 |
Log an event with just an eventName. |
bad748
|
468 |
|
13e53a
|
469 |
@param eventName The name of the event to record. Limitations on number of events and name length |
bad748
|
470 |
are given in the `FBSDKAppEvents` documentation. |
W |
471 |
|
|
472 |
*/ |
e81c27
|
473 |
+ (void)logEvent:(FBSDKAppEventName)eventName; |
bad748
|
474 |
|
9febd9
|
475 |
/** |
bad748
|
476 |
|
9febd9
|
477 |
Log an event with an eventName and a numeric value to be aggregated with other events of this name. |
bad748
|
478 |
|
13e53a
|
479 |
@param eventName The name of the event to record. Limitations on number of events and name length |
bad748
|
480 |
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. |
W |
481 |
|
13e53a
|
482 |
@param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report |
bad748
|
483 |
the cumulative and average value of this amount. |
W |
484 |
*/ |
e81c27
|
485 |
+ (void)logEvent:(FBSDKAppEventName)eventName |
bad748
|
486 |
valueToSum:(double)valueToSum; |
W |
487 |
|
|
488 |
|
9febd9
|
489 |
/** |
bad748
|
490 |
|
9febd9
|
491 |
Log an event with an eventName and a set of key/value pairs in the parameters dictionary. |
bad748
|
492 |
Parameter limitations are described above. |
W |
493 |
|
13e53a
|
494 |
@param eventName The name of the event to record. Limitations on number of events and name construction |
bad748
|
495 |
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. |
W |
496 |
|
13e53a
|
497 |
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must |
bad748
|
498 |
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of |
W |
499 |
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names |
|
500 |
are provided in `FBSDKAppEventParameterName*` constants. |
|
501 |
*/ |
e81c27
|
502 |
+ (void)logEvent:(FBSDKAppEventName)eventName |
H |
503 |
parameters:(NSDictionary<FBSDKAppEventParameterName, id> *)parameters; |
bad748
|
504 |
|
9febd9
|
505 |
/** |
bad748
|
506 |
|
9febd9
|
507 |
Log an event with an eventName, a numeric value to be aggregated with other events of this name, |
bad748
|
508 |
and a set of key/value pairs in the parameters dictionary. |
W |
509 |
|
13e53a
|
510 |
@param eventName The name of the event to record. Limitations on number of events and name construction |
bad748
|
511 |
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. |
W |
512 |
|
13e53a
|
513 |
@param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report |
bad748
|
514 |
the cumulative and average value of this amount. |
W |
515 |
|
13e53a
|
516 |
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must |
bad748
|
517 |
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of |
W |
518 |
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names |
|
519 |
are provided in `FBSDKAppEventParameterName*` constants. |
|
520 |
|
|
521 |
*/ |
e81c27
|
522 |
+ (void)logEvent:(FBSDKAppEventName)eventName |
bad748
|
523 |
valueToSum:(double)valueToSum |
e81c27
|
524 |
parameters:(NSDictionary<FBSDKAppEventParameterName, id> *)parameters; |
bad748
|
525 |
|
W |
526 |
|
9febd9
|
527 |
/** |
bad748
|
528 |
|
9febd9
|
529 |
Log an event with an eventName, a numeric value to be aggregated with other events of this name, |
bad748
|
530 |
and a set of key/value pairs in the parameters dictionary. Providing session lets the developer |
W |
531 |
target a particular <FBSession>. If nil is provided, then `[FBSession activeSession]` will be used. |
|
532 |
|
13e53a
|
533 |
@param eventName The name of the event to record. Limitations on number of events and name construction |
bad748
|
534 |
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. |
W |
535 |
|
13e53a
|
536 |
@param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report |
bad748
|
537 |
the cumulative and average value of this amount. Note that this is an NSNumber, and a value of `nil` denotes |
W |
538 |
that this event doesn't have a value associated with it for summation. |
|
539 |
|
13e53a
|
540 |
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must |
bad748
|
541 |
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of |
W |
542 |
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names |
|
543 |
are provided in `FBSDKAppEventParameterName*` constants. |
|
544 |
|
13e53a
|
545 |
@param accessToken The optional access token to log the event as. |
bad748
|
546 |
*/ |
e81c27
|
547 |
+ (void)logEvent:(FBSDKAppEventName)eventName |
H |
548 |
valueToSum:(nullable NSNumber *)valueToSum |
|
549 |
parameters:(NSDictionary<FBSDKAppEventParameterName, id> *)parameters |
|
550 |
accessToken:(nullable FBSDKAccessToken *)accessToken; |
bad748
|
551 |
|
W |
552 |
/* |
|
553 |
* Purchase logging |
|
554 |
*/ |
|
555 |
|
9febd9
|
556 |
/** |
bad748
|
557 |
|
9febd9
|
558 |
Log a purchase of the specified amount, in the specified currency. |
bad748
|
559 |
|
13e53a
|
560 |
@param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value |
bad748
|
561 |
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). |
W |
562 |
|
13e53a
|
563 |
@param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for |
bad748
|
564 |
specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>. |
W |
565 |
|
9febd9
|
566 |
|
W |
567 |
This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set |
bad748
|
568 |
to `FBSDKAppEventsFlushBehaviorExplicitOnly`. |
W |
569 |
|
|
570 |
*/ |
|
571 |
+ (void)logPurchase:(double)purchaseAmount |
|
572 |
currency:(NSString *)currency; |
|
573 |
|
9febd9
|
574 |
/** |
bad748
|
575 |
|
9febd9
|
576 |
Log a purchase of the specified amount, in the specified currency, also providing a set of |
bad748
|
577 |
additional characteristics describing the purchase. |
W |
578 |
|
13e53a
|
579 |
@param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value |
bad748
|
580 |
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). |
W |
581 |
|
13e53a
|
582 |
@param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for |
bad748
|
583 |
specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>. |
W |
584 |
|
13e53a
|
585 |
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must |
bad748
|
586 |
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of |
W |
587 |
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names |
|
588 |
are provided in `FBSDKAppEventParameterName*` constants. |
|
589 |
|
9febd9
|
590 |
|
W |
591 |
This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set |
bad748
|
592 |
to `FBSDKAppEventsFlushBehaviorExplicitOnly`. |
W |
593 |
|
|
594 |
*/ |
|
595 |
+ (void)logPurchase:(double)purchaseAmount |
|
596 |
currency:(NSString *)currency |
e81c27
|
597 |
parameters:(NSDictionary<NSString *, id> *)parameters; |
bad748
|
598 |
|
9febd9
|
599 |
/** |
bad748
|
600 |
|
9febd9
|
601 |
Log a purchase of the specified amount, in the specified currency, also providing a set of |
bad748
|
602 |
additional characteristics describing the purchase, as well as an <FBSession> to log to. |
W |
603 |
|
13e53a
|
604 |
@param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value |
bad748
|
605 |
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). |
W |
606 |
|
13e53a
|
607 |
@param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for |
bad748
|
608 |
specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>. |
W |
609 |
|
13e53a
|
610 |
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must |
bad748
|
611 |
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of |
W |
612 |
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names |
|
613 |
are provided in `FBSDKAppEventParameterName*` constants. |
|
614 |
|
13e53a
|
615 |
@param accessToken The optional access token to log the event as. |
bad748
|
616 |
|
9febd9
|
617 |
|
W |
618 |
This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set |
bad748
|
619 |
to `FBSDKAppEventsFlushBehaviorExplicitOnly`. |
W |
620 |
|
|
621 |
*/ |
|
622 |
+ (void)logPurchase:(double)purchaseAmount |
|
623 |
currency:(NSString *)currency |
e81c27
|
624 |
parameters:(NSDictionary<NSString *, id> *)parameters |
H |
625 |
accessToken:(nullable FBSDKAccessToken *)accessToken; |
bad748
|
626 |
|
W |
627 |
|
|
628 |
/* |
|
629 |
* Push Notifications Logging |
|
630 |
*/ |
|
631 |
|
9febd9
|
632 |
/** |
W |
633 |
Log an app event that tracks that the application was open via Push Notification. |
bad748
|
634 |
|
13e53a
|
635 |
@param payload Notification payload received via `UIApplicationDelegate`. |
bad748
|
636 |
*/ |
W |
637 |
+ (void)logPushNotificationOpen:(NSDictionary *)payload; |
|
638 |
|
9febd9
|
639 |
/** |
W |
640 |
Log an app event that tracks that a custom action was taken from a push notification. |
bad748
|
641 |
|
13e53a
|
642 |
@param payload Notification payload received via `UIApplicationDelegate`. |
H |
643 |
@param action Name of the action that was taken. |
bad748
|
644 |
*/ |
W |
645 |
+ (void)logPushNotificationOpen:(NSDictionary *)payload action:(NSString *)action; |
13e53a
|
646 |
|
H |
647 |
/** |
|
648 |
Uploads product catalog product item as an app event |
|
649 |
@param itemID Unique ID for the item. Can be a variant for a product. |
|
650 |
Max size is 100. |
|
651 |
@param availability If item is in stock. Accepted values are: |
|
652 |
in stock - Item ships immediately |
|
653 |
out of stock - No plan to restock |
|
654 |
preorder - Available in future |
|
655 |
available for order - Ships in 1-2 weeks |
|
656 |
discontinued - Discontinued |
|
657 |
@param condition Product condition: new, refurbished or used. |
|
658 |
@param description Short text describing product. Max size is 5000. |
|
659 |
@param imageLink Link to item image used in ad. |
|
660 |
@param link Link to merchant's site where someone can buy the item. |
|
661 |
@param title Title of item. |
|
662 |
@param priceAmount Amount of purchase, in the currency specified by the 'currency' |
|
663 |
parameter. This value will be rounded to the thousandths place |
|
664 |
(e.g., 12.34567 becomes 12.346). |
|
665 |
@param currency Currency used to specify the amount. |
|
666 |
E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217> |
|
667 |
@param gtin Global Trade Item Number including UPC, EAN, JAN and ISBN |
|
668 |
@param mpn Unique manufacture ID for product |
|
669 |
@param brand Name of the brand |
|
670 |
Note: Either gtin, mpn or brand is required. |
|
671 |
@param parameters Optional fields for deep link specification. |
|
672 |
*/ |
|
673 |
+ (void)logProductItem:(NSString *)itemID |
|
674 |
availability:(FBSDKProductAvailability)availability |
|
675 |
condition:(FBSDKProductCondition)condition |
|
676 |
description:(NSString *)description |
|
677 |
imageLink:(NSString *)imageLink |
|
678 |
link:(NSString *)link |
|
679 |
title:(NSString *)title |
|
680 |
priceAmount:(double)priceAmount |
|
681 |
currency:(NSString *)currency |
e81c27
|
682 |
gtin:(nullable NSString *)gtin |
H |
683 |
mpn:(nullable NSString *)mpn |
|
684 |
brand:(nullable NSString *)brand |
|
685 |
parameters:(nullable NSDictionary<NSString *, id> *)parameters; |
bad748
|
686 |
|
9febd9
|
687 |
/** |
bad748
|
688 |
|
37c026
|
689 |
Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. |
H |
690 |
This function is called automatically from FBSDKApplicationDelegate applicationDidBecomeActive, unless |
|
691 |
one overrides 'FacebookAutoLogAppEventsEnabled' key to false in the project info plist file. |
|
692 |
In case 'FacebookAutoLogAppEventsEnabled' is set to false, then it should typically be placed in the |
bad748
|
693 |
app delegates' `applicationDidBecomeActive:` method. |
W |
694 |
|
|
695 |
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 |
|
696 |
track user acquisition and app install ads conversions. |
|
697 |
|
9febd9
|
698 |
|
W |
699 |
|
bad748
|
700 |
`activateApp` will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded. |
W |
701 |
"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" |
|
702 |
event to be logged when sessions are "completed", and these events are logged with the session length, with an indication of how much |
|
703 |
time has elapsed between sessions, and with the number of background/foreground interruptions that session had. This data |
|
704 |
is all visible in your app's App Events Insights. |
|
705 |
*/ |
|
706 |
+ (void)activateApp; |
|
707 |
|
|
708 |
/* |
13e53a
|
709 |
* Push Notifications Registration and Uninstall Tracking |
bad748
|
710 |
*/ |
W |
711 |
|
9febd9
|
712 |
/** |
37c026
|
713 |
Sets and sends device token to register the current application for push notifications. |
bad748
|
714 |
|
9febd9
|
715 |
|
W |
716 |
|
37c026
|
717 |
Sets and sends a device token from `NSData` representation that you get from `UIApplicationDelegate.-application:didRegisterForRemoteNotificationsWithDeviceToken:`. |
bad748
|
718 |
|
13e53a
|
719 |
@param deviceToken Device token data. |
bad748
|
720 |
*/ |
W |
721 |
+ (void)setPushNotificationsDeviceToken:(NSData *)deviceToken; |
13e53a
|
722 |
|
H |
723 |
/** |
|
724 |
Sets and sends device token string to register the current application for push notifications. |
|
725 |
|
|
726 |
|
|
727 |
|
|
728 |
Sets and sends a device token string |
|
729 |
|
|
730 |
@param deviceTokenString Device token string. |
|
731 |
*/ |
e81c27
|
732 |
+ (void)setPushNotificationsDeviceTokenString:(NSString *)deviceTokenString |
H |
733 |
NS_SWIFT_NAME(setPushNotificationsDeviceToken(_:)); |
bad748
|
734 |
|
9febd9
|
735 |
/** |
W |
736 |
Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate |
bad748
|
737 |
kick off. Server failures will be reported through the NotificationCenter with notification ID `FBSDKAppEventsLoggingResultNotification`. |
W |
738 |
*/ |
|
739 |
+ (void)flush; |
|
740 |
|
9febd9
|
741 |
/** |
W |
742 |
Creates a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user. |
bad748
|
743 |
Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, |
W |
744 |
and then use the resultant Custom Audience to target ads. |
9febd9
|
745 |
|
bad748
|
746 |
The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. |
W |
747 |
This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. |
|
748 |
Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior |
|
749 |
across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. |
|
750 |
|
|
751 |
The ID retrieved represents the Facebook user identified in the following way: if the specified access token is valid, |
|
752 |
the ID will represent the user associated with that token; otherwise the ID will represent the user logged into the |
|
753 |
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 |
|
754 |
at the iOS level from ad tracking, then a `nil` ID will be returned. |
|
755 |
|
|
756 |
This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage |
|
757 |
via the `[FBSDKSettings limitEventAndDataUsage]` flag, or a specific Facebook user cannot be identified. |
9febd9
|
758 |
|
e81c27
|
759 |
@param accessToken The access token to use to establish the user's identity for users logged into Facebook through this app. |
H |
760 |
If `nil`, then the `[FBSDKAccessToken currentAccessToken]` is used. |
9febd9
|
761 |
*/ |
e81c27
|
762 |
+ (nullable FBSDKGraphRequest *)requestForCustomAudienceThirdPartyIDWithAccessToken:(nullable FBSDKAccessToken *)accessToken; |
9febd9
|
763 |
|
W |
764 |
/* |
9f077b
|
765 |
Clears the custom user ID to associate with all app events. |
H |
766 |
*/ |
|
767 |
+ (void)clearUserID; |
13e53a
|
768 |
|
H |
769 |
/* |
|
770 |
Sets custom user data to associate with all app events. All user data are hashed |
|
771 |
and used to match Facebook user from this instance of an application. |
|
772 |
|
|
773 |
The user data will be persisted between application instances. |
|
774 |
|
|
775 |
@param email user's email |
|
776 |
@param firstName user's first name |
|
777 |
@param lastName user's last name |
|
778 |
@param phone user's phone |
|
779 |
@param dateOfBirth user's date of birth |
|
780 |
@param gender user's gender |
|
781 |
@param city user's city |
|
782 |
@param state user's state |
|
783 |
@param zip user's zip |
|
784 |
@param country user's country |
|
785 |
*/ |
e81c27
|
786 |
+ (void)setUserEmail:(nullable NSString *)email |
H |
787 |
firstName:(nullable NSString *)firstName |
|
788 |
lastName:(nullable NSString *)lastName |
|
789 |
phone:(nullable NSString *)phone |
|
790 |
dateOfBirth:(nullable NSString *)dateOfBirth |
|
791 |
gender:(nullable NSString *)gender |
|
792 |
city:(nullable NSString *)city |
|
793 |
state:(nullable NSString *)state |
|
794 |
zip:(nullable NSString *)zip |
|
795 |
country:(nullable NSString *)country |
|
796 |
NS_SWIFT_NAME(setUser(email:firstName:lastName:phone:dateOfBirth:gender:city:state:zip:country:)); |
|
797 |
|
13e53a
|
798 |
/* |
H |
799 |
Returns the set user data else nil |
|
800 |
*/ |
e81c27
|
801 |
+ (nullable NSString *)getUserData; |
13e53a
|
802 |
|
H |
803 |
/* |
|
804 |
Clears the current user data |
|
805 |
*/ |
|
806 |
+ (void)clearUserData; |
e81c27
|
807 |
|
H |
808 |
/* |
|
809 |
Sets custom user data to associate with all app events. All user data are hashed |
|
810 |
and used to match Facebook user from this instance of an application. |
|
811 |
|
|
812 |
The user data will be persisted between application instances. |
|
813 |
|
|
814 |
@param data data |
|
815 |
@param type data type, e.g. FBSDKAppEventEmail, FBSDKAppEventPhone |
|
816 |
*/ |
|
817 |
+ (void)setUserData:(nullable NSString *)data |
|
818 |
forType:(FBSDKAppEventUserDataType)type; |
|
819 |
|
|
820 |
/* |
|
821 |
Clears the current user data of certain type |
|
822 |
*/ |
|
823 |
+ (void)clearUserDataForType:(FBSDKAppEventUserDataType)type; |
13e53a
|
824 |
|
H |
825 |
/* |
9febd9
|
826 |
Sends a request to update the properties for the current user, set by `setUserID:` |
W |
827 |
|
|
828 |
You must call `FBSDKAppEvents setUserID:` before making this call. |
13e53a
|
829 |
@param properties the custom user properties |
H |
830 |
@param handler the optional completion handler |
9febd9
|
831 |
*/ |
49b883
|
832 |
+ (void)updateUserProperties:(NSDictionary<NSString *, id> *)properties handler:(nullable FBSDKGraphRequestBlock)handler __attribute__((deprecated("updateUserProperties is deprecated"))); |
9febd9
|
833 |
|
9f077b
|
834 |
#if !TARGET_OS_TV |
H |
835 |
/* |
|
836 |
Intended to be used as part of a hybrid webapp. |
|
837 |
If you call this method, the FB SDK will inject a new JavaScript object into your webview. |
|
838 |
If the FB Pixel is used within the webview, and references the app ID of this app, |
|
839 |
then it will detect the presence of this injected JavaScript object |
|
840 |
and pass Pixel events back to the FB SDK for logging using the AppEvents framework. |
|
841 |
|
13e53a
|
842 |
@param webView The webview to augment with the additional JavaScript behaviour |
9f077b
|
843 |
*/ |
H |
844 |
+ (void)augmentHybridWKWebView:(WKWebView *)webView; |
|
845 |
#endif |
|
846 |
|
13e53a
|
847 |
/* |
H |
848 |
* Unity helper functions |
|
849 |
*/ |
|
850 |
|
|
851 |
/** |
|
852 |
|
|
853 |
Set if the Unity is already initialized |
|
854 |
|
|
855 |
@param isUnityInit whether Unity is initialized. |
|
856 |
|
|
857 |
*/ |
|
858 |
+ (void)setIsUnityInit:(BOOL)isUnityInit; |
|
859 |
|
|
860 |
/* |
|
861 |
Send event binding to Unity |
|
862 |
*/ |
|
863 |
+ (void)sendEventBindingsToUnity; |
|
864 |
|
bad748
|
865 |
@end |
e81c27
|
866 |
|
H |
867 |
NS_ASSUME_NONNULL_END |