commit | author | age
|
93c16a
|
1 |
// |
L |
2 |
// AppsFlyerLib.h |
|
3 |
// AppsFlyerLib |
|
4 |
// |
|
5 |
// AppsFlyer iOS SDK 6.13.1.153 (153) |
|
6 |
// Copyright (c) 2012-2023 AppsFlyer Ltd. All rights reserved. |
|
7 |
// |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
#import <AppsFlyerLib/AppsFlyerCrossPromotionHelper.h> |
|
12 |
#import <AppsFlyerLib/AppsFlyerShareInviteHelper.h> |
|
13 |
#import <AppsFlyerLib/AppsFlyerDeepLinkResult.h> |
|
14 |
#import <AppsFlyerLib/AppsFlyerDeepLink.h> |
|
15 |
#import <AppsFlyerLib/AppsFlyerConsent.h> |
|
16 |
|
|
17 |
NS_ASSUME_NONNULL_BEGIN |
|
18 |
|
|
19 |
// In app event names constants |
|
20 |
#define AFEventLevelAchieved @"af_level_achieved" |
|
21 |
#define AFEventAddPaymentInfo @"af_add_payment_info" |
|
22 |
#define AFEventAddToCart @"af_add_to_cart" |
|
23 |
#define AFEventAddToWishlist @"af_add_to_wishlist" |
|
24 |
#define AFEventCompleteRegistration @"af_complete_registration" |
|
25 |
#define AFEventTutorial_completion @"af_tutorial_completion" |
|
26 |
#define AFEventInitiatedCheckout @"af_initiated_checkout" |
|
27 |
#define AFEventPurchase @"af_purchase" |
|
28 |
#define AFEventRate @"af_rate" |
|
29 |
#define AFEventSearch @"af_search" |
|
30 |
#define AFEventSpentCredits @"af_spent_credits" |
|
31 |
#define AFEventAchievementUnlocked @"af_achievement_unlocked" |
|
32 |
#define AFEventContentView @"af_content_view" |
|
33 |
#define AFEventListView @"af_list_view" |
|
34 |
#define AFEventTravelBooking @"af_travel_booking" |
|
35 |
#define AFEventShare @"af_share" |
|
36 |
#define AFEventInvite @"af_invite" |
|
37 |
#define AFEventLogin @"af_login" |
|
38 |
#define AFEventReEngage @"af_re_engage" |
|
39 |
#define AFEventUpdate @"af_update" |
|
40 |
#define AFEventOpenedFromPushNotification @"af_opened_from_push_notification" |
|
41 |
#define AFEventLocation @"af_location_coordinates" |
|
42 |
#define AFEventCustomerSegment @"af_customer_segment" |
|
43 |
|
|
44 |
#define AFEventSubscribe @"af_subscribe" |
|
45 |
#define AFEventStartTrial @"af_start_trial" |
|
46 |
#define AFEventAdClick @"af_ad_click" |
|
47 |
#define AFEventAdView @"af_ad_view" |
|
48 |
|
|
49 |
// In app event parameter names |
|
50 |
#define AFEventParamContent @"af_content" |
|
51 |
#define AFEventParamAchievementId @"af_achievement_id" |
|
52 |
#define AFEventParamLevel @"af_level" |
|
53 |
#define AFEventParamScore @"af_score" |
|
54 |
#define AFEventParamSuccess @"af_success" |
|
55 |
#define AFEventParamPrice @"af_price" |
|
56 |
#define AFEventParamContentType @"af_content_type" |
|
57 |
#define AFEventParamContentId @"af_content_id" |
|
58 |
#define AFEventParamContentList @"af_content_list" |
|
59 |
#define AFEventParamCurrency @"af_currency" |
|
60 |
#define AFEventParamQuantity @"af_quantity" |
|
61 |
#define AFEventParamRegistrationMethod @"af_registration_method" |
|
62 |
#define AFEventParamPaymentInfoAvailable @"af_payment_info_available" |
|
63 |
#define AFEventParamMaxRatingValue @"af_max_rating_value" |
|
64 |
#define AFEventParamRatingValue @"af_rating_value" |
|
65 |
#define AFEventParamSearchString @"af_search_string" |
|
66 |
#define AFEventParamDateA @"af_date_a" |
|
67 |
#define AFEventParamDateB @"af_date_b" |
|
68 |
#define AFEventParamDestinationA @"af_destination_a" |
|
69 |
#define AFEventParamDestinationB @"af_destination_b" |
|
70 |
#define AFEventParamDescription @"af_description" |
|
71 |
#define AFEventParamClass @"af_class" |
|
72 |
#define AFEventParamEventStart @"af_event_start" |
|
73 |
#define AFEventParamEventEnd @"af_event_end" |
|
74 |
#define AFEventParamLat @"af_lat" |
|
75 |
#define AFEventParamLong @"af_long" |
|
76 |
#define AFEventParamCustomerUserId @"af_customer_user_id" |
|
77 |
#define AFEventParamValidated @"af_validated" |
|
78 |
#define AFEventParamRevenue @"af_revenue" |
|
79 |
#define AFEventProjectedParamRevenue @"af_projected_revenue" |
|
80 |
#define AFEventParamReceiptId @"af_receipt_id" |
|
81 |
#define AFEventParamTutorialId @"af_tutorial_id" |
|
82 |
#define AFEventParamVirtualCurrencyName @"af_virtual_currency_name" |
|
83 |
#define AFEventParamDeepLink @"af_deep_link" |
|
84 |
#define AFEventParamOldVersion @"af_old_version" |
|
85 |
#define AFEventParamNewVersion @"af_new_version" |
|
86 |
#define AFEventParamReviewText @"af_review_text" |
|
87 |
#define AFEventParamCouponCode @"af_coupon_code" |
|
88 |
#define AFEventParamOrderId @"af_order_id" |
|
89 |
#define AFEventParam1 @"af_param_1" |
|
90 |
#define AFEventParam2 @"af_param_2" |
|
91 |
#define AFEventParam3 @"af_param_3" |
|
92 |
#define AFEventParam4 @"af_param_4" |
|
93 |
#define AFEventParam5 @"af_param_5" |
|
94 |
#define AFEventParam6 @"af_param_6" |
|
95 |
#define AFEventParam7 @"af_param_7" |
|
96 |
#define AFEventParam8 @"af_param_8" |
|
97 |
#define AFEventParam9 @"af_param_9" |
|
98 |
#define AFEventParam10 @"af_param_10" |
|
99 |
#define AFEventParamTouch @"af_touch_obj" |
|
100 |
|
|
101 |
#define AFEventParamDepartingDepartureDate @"af_departing_departure_date" |
|
102 |
#define AFEventParamReturningDepartureDate @"af_returning_departure_date" |
|
103 |
#define AFEventParamDestinationList @"af_destination_list" //array of string |
|
104 |
#define AFEventParamCity @"af_city" |
|
105 |
#define AFEventParamRegion @"af_region" |
|
106 |
#define AFEventParamCountry @"af_country" |
|
107 |
|
|
108 |
|
|
109 |
#define AFEventParamDepartingArrivalDate @"af_departing_arrival_date" |
|
110 |
#define AFEventParamReturningArrivalDate @"af_returning_arrival_date" |
|
111 |
#define AFEventParamSuggestedDestinations @"af_suggested_destinations" //array of string |
|
112 |
#define AFEventParamTravelStart @"af_travel_start" |
|
113 |
#define AFEventParamTravelEnd @"af_travel_end" |
|
114 |
#define AFEventParamNumAdults @"af_num_adults" |
|
115 |
#define AFEventParamNumChildren @"af_num_children" |
|
116 |
#define AFEventParamNumInfants @"af_num_infants" |
|
117 |
#define AFEventParamSuggestedHotels @"af_suggested_hotels" //array of string |
|
118 |
|
|
119 |
#define AFEventParamUserScore @"af_user_score" |
|
120 |
#define AFEventParamHotelScore @"af_hotel_score" |
|
121 |
#define AFEventParamPurchaseCurrency @"af_purchase_currency" |
|
122 |
|
|
123 |
#define AFEventParamPreferredStarRatings @"af_preferred_star_ratings" //array of int (basically a tuple (min,max) but we'll use array of int and instruct the developer to use two values) |
|
124 |
|
|
125 |
#define AFEventParamPreferredPriceRange @"af_preferred_price_range" //array of int (basically a tuple (min,max) but we'll use array of int and instruct the developer to use two values) |
|
126 |
#define AFEventParamPreferredNeighborhoods @"af_preferred_neighborhoods" //array of string |
|
127 |
#define AFEventParamPreferredNumStops @"af_preferred_num_stops" |
|
128 |
|
|
129 |
#define AFEventParamAdRevenueAdType @"af_adrev_ad_type" |
|
130 |
#define AFEventParamAdRevenueNetworkName @"af_adrev_network_name" |
|
131 |
#define AFEventParamAdRevenuePlacementId @"af_adrev_placement_id" |
|
132 |
#define AFEventParamAdRevenueAdSize @"af_adrev_ad_size" |
|
133 |
#define AFEventParamAdRevenueMediatedNetworkName @"af_adrev_mediated_network_name" |
|
134 |
|
|
135 |
|
|
136 |
/// Mail hashing type |
|
137 |
typedef enum { |
|
138 |
/// None |
|
139 |
EmailCryptTypeNone = 0, |
|
140 |
/// SHA256 |
|
141 |
EmailCryptTypeSHA256 = 3 |
|
142 |
} EmailCryptType; |
|
143 |
|
|
144 |
typedef NS_CLOSED_ENUM(NSInteger, AFSDKPlugin) { |
|
145 |
AFSDKPluginIOSNative, |
|
146 |
AFSDKPluginUnity, |
|
147 |
AFSDKPluginFlutter, |
|
148 |
AFSDKPluginReactNative, |
|
149 |
AFSDKPluginAdobeAir, |
|
150 |
AFSDKPluginAdobeMobile, |
|
151 |
AFSDKPluginCocos2dx, |
|
152 |
AFSDKPluginCordova, |
|
153 |
AFSDKPluginMparticle, |
|
154 |
AFSDKPluginNativeScript, |
|
155 |
AFSDKPluginExpo, |
|
156 |
AFSDKPluginUnreal, |
|
157 |
AFSDKPluginXamarin, |
|
158 |
AFSDKPluginCapacitor, |
|
159 |
AFSDKPluginSegment, |
|
160 |
AFSDKPluginAdobeSwiftAEP |
|
161 |
} NS_SWIFT_NAME(Plugin); |
|
162 |
|
|
163 |
|
|
164 |
NS_SWIFT_NAME(DeepLinkDelegate) |
|
165 |
@protocol AppsFlyerDeepLinkDelegate <NSObject> |
|
166 |
|
|
167 |
@optional |
|
168 |
- (void)didResolveDeepLink:(AppsFlyerDeepLinkResult *_Nonnull)result; |
|
169 |
|
|
170 |
@end |
|
171 |
|
|
172 |
/** |
|
173 |
Conform and subscribe to this protocol to allow getting data about conversion and |
|
174 |
install attribution |
|
175 |
*/ |
|
176 |
@protocol AppsFlyerLibDelegate <NSObject> |
|
177 |
|
|
178 |
/** |
|
179 |
`conversionInfo` contains information about install. |
|
180 |
Organic/non-organic, etc. |
|
181 |
@param conversionInfo May contain <code>null</code> values for some keys. Please handle this case. |
|
182 |
*/ |
|
183 |
- (void)onConversionDataSuccess:(NSDictionary *)conversionInfo; |
|
184 |
|
|
185 |
/** |
|
186 |
Any errors that occurred during the conversion request. |
|
187 |
*/ |
|
188 |
- (void)onConversionDataFail:(NSError *)error; |
|
189 |
|
|
190 |
@optional |
|
191 |
|
|
192 |
/** |
|
193 |
`attributionData` contains information about OneLink, deeplink. |
|
194 |
*/ |
|
195 |
- (void)onAppOpenAttribution:(NSDictionary *)attributionData; |
|
196 |
|
|
197 |
/** |
|
198 |
Any errors that occurred during the attribution request. |
|
199 |
*/ |
|
200 |
- (void)onAppOpenAttributionFailure:(NSError *)error; |
|
201 |
|
|
202 |
/** |
|
203 |
@abstract Sets the HTTP header fields of the ESP resolving to the given |
|
204 |
dictionary. |
|
205 |
@discussion This method replaces all header fields that may have |
|
206 |
existed before this method ESP resolving call. |
|
207 |
To keep default SDK behavior - return nil; |
|
208 |
*/ |
|
209 |
- (NSDictionary <NSString *, NSString *> * _Nullable)allHTTPHeaderFieldsForResolveDeepLinkURL:(NSURL *)URL; |
|
210 |
|
|
211 |
@end |
|
212 |
|
|
213 |
/** |
|
214 |
You can log installs, app updates, sessions and additional in-app events |
|
215 |
(including in-app purchases, game levels, etc.) |
|
216 |
to evaluate ROI and user engagement. |
|
217 |
The iOS SDK is compatible with all iOS/tvOS devices with iOS version 7 and above. |
|
218 |
|
|
219 |
@see [SDK Integration Validator](https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS) |
|
220 |
for more information. |
|
221 |
|
|
222 |
*/ |
|
223 |
@interface AppsFlyerLib : NSObject |
|
224 |
|
|
225 |
/** |
|
226 |
Gets the singleton instance of the AppsFlyerLib class, creating it if |
|
227 |
necessary. |
|
228 |
|
|
229 |
@return The singleton instance of AppsFlyerLib. |
|
230 |
*/ |
|
231 |
+ (AppsFlyerLib *)shared; |
|
232 |
|
|
233 |
|
|
234 |
- (void)setUpInteroperabilityObject:(id)object; |
|
235 |
|
|
236 |
/** |
|
237 |
In case you use your own user ID in your app, you can set this property to that ID. |
|
238 |
Enables you to cross-reference your own unique ID with AppsFlyer’s unique ID and the other devices’ IDs |
|
239 |
*/ |
|
240 |
@property(nonatomic, strong, nullable) NSString * customerUserID; |
|
241 |
|
|
242 |
/** |
|
243 |
In case you use custom data and you want to receive it in the raw reports. |
|
244 |
|
|
245 |
@see [Setting additional custom data](https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS#setting-additional-custom-data) for more information. |
|
246 |
*/ |
|
247 |
@property(nonatomic, strong, nullable, setter = setAdditionalData:) NSDictionary * customData; |
|
248 |
|
|
249 |
/** |
|
250 |
Use this property to set your AppsFlyer's dev key |
|
251 |
*/ |
|
252 |
@property(nonatomic, strong) NSString * appsFlyerDevKey; |
|
253 |
|
|
254 |
/** |
|
255 |
Use this property to set your app's Apple ID(taken from the app's page on iTunes Connect) |
|
256 |
*/ |
|
257 |
@property(nonatomic, strong) NSString * appleAppID; |
|
258 |
|
|
259 |
#ifndef AFSDK_NO_IDFA |
|
260 |
/** |
|
261 |
AppsFlyer SDK collect Apple's `advertisingIdentifier` if the `AdSupport.framework` included in the SDK. |
|
262 |
You can disable this behavior by setting the following property to YES |
|
263 |
*/ |
|
264 |
@property(nonatomic) BOOL disableAdvertisingIdentifier; |
|
265 |
|
|
266 |
@property(nonatomic, strong, readonly) NSString *advertisingIdentifier; |
|
267 |
|
|
268 |
/** |
|
269 |
Waits for request user authorization to access app-related data |
|
270 |
*/ |
|
271 |
- (void)waitForATTUserAuthorizationWithTimeoutInterval:(NSTimeInterval)timeoutInterval |
|
272 |
NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:)); |
|
273 |
|
|
274 |
#endif |
|
275 |
|
|
276 |
@property(nonatomic) BOOL disableSKAdNetwork; |
|
277 |
|
|
278 |
/** |
|
279 |
In case of in app purchase events, you can set the currency code your user has purchased with. |
|
280 |
The currency code is a 3 letter code according to ISO standards |
|
281 |
|
|
282 |
Objective-C: |
|
283 |
|
|
284 |
<pre> |
|
285 |
[[AppsFlyerLib shared] setCurrencyCode:@"USD"]; |
|
286 |
</pre> |
|
287 |
|
|
288 |
Swift: |
|
289 |
|
|
290 |
<pre> |
|
291 |
AppsFlyerLib.shared().currencyCode = "USD" |
|
292 |
</pre> |
|
293 |
*/ |
|
294 |
@property(nonatomic, strong, nullable) NSString *currencyCode; |
|
295 |
|
|
296 |
/** |
|
297 |
Prints SDK messages to the console log. This property should only be used in `DEBUG` mode. |
|
298 |
The default value is `NO` |
|
299 |
*/ |
|
300 |
@property(nonatomic) BOOL isDebug; |
|
301 |
|
|
302 |
/** |
|
303 |
Set this flag to `YES`, to collect the current device name(e.g. "My iPhone"). Default value is `NO` |
|
304 |
*/ |
|
305 |
@property(nonatomic) BOOL shouldCollectDeviceName; |
|
306 |
|
|
307 |
/** |
|
308 |
Set your `OneLink ID` from OneLink configuration. Used in User Invites to generate a OneLink. |
|
309 |
*/ |
|
310 |
@property(nonatomic, strong, nullable, setter = setAppInviteOneLink:) NSString * appInviteOneLinkID; |
|
311 |
|
|
312 |
/** |
|
313 |
Opt-out logging for specific user |
|
314 |
*/ |
|
315 |
@property(atomic) BOOL anonymizeUser; |
|
316 |
|
|
317 |
/** |
|
318 |
Opt-out for Apple Search Ads attributions |
|
319 |
*/ |
|
320 |
@property(atomic) BOOL disableCollectASA; |
|
321 |
|
|
322 |
/** |
|
323 |
Disable Apple Ads Attribution API +[AAAtribution attributionTokenWithError:] |
|
324 |
*/ |
|
325 |
@property(nonatomic) BOOL disableAppleAdsAttribution; |
|
326 |
|
|
327 |
/** |
|
328 |
AppsFlyer delegate. See `AppsFlyerLibDelegate` |
|
329 |
*/ |
|
330 |
@property(weak, nonatomic) id<AppsFlyerLibDelegate> delegate; |
|
331 |
|
|
332 |
@property(weak, nonatomic) id<AppsFlyerDeepLinkDelegate> deepLinkDelegate; |
|
333 |
|
|
334 |
/** |
|
335 |
In app purchase receipt validation Apple environment(production or sandbox). The default value is NO |
|
336 |
*/ |
|
337 |
@property(nonatomic) BOOL useReceiptValidationSandbox; |
|
338 |
|
|
339 |
/** |
|
340 |
Set this flag to test uninstall on Apple environment(production or sandbox). The default value is NO |
|
341 |
*/ |
|
342 |
@property(nonatomic) BOOL useUninstallSandbox; |
|
343 |
|
|
344 |
/** |
|
345 |
For advertisers who wrap OneLink within another Universal Link. |
|
346 |
An advertiser will be able to deeplink from a OneLink wrapped within another Universal Link and also log this retargeting conversion. |
|
347 |
|
|
348 |
Objective-C: |
|
349 |
|
|
350 |
<pre> |
|
351 |
[[AppsFlyerLib shared] setResolveDeepLinkURLs:@[@"domain.com", @"subdomain.domain.com"]]; |
|
352 |
</pre> |
|
353 |
*/ |
|
354 |
@property(nonatomic, nullable, copy) NSArray<NSString *> *resolveDeepLinkURLs; |
|
355 |
|
|
356 |
/** |
|
357 |
For advertisers who use vanity OneLinks. |
|
358 |
|
|
359 |
Objective-C: |
|
360 |
|
|
361 |
<pre> |
|
362 |
[[AppsFlyerLib shared] oneLinkCustomDomains:@[@"domain.com", @"subdomain.domain.com"]]; |
|
363 |
</pre> |
|
364 |
*/ |
|
365 |
@property(nonatomic, nullable, copy) NSArray<NSString *> *oneLinkCustomDomains; |
|
366 |
|
|
367 |
/* |
|
368 |
* Set phone number for each `start` event. `phoneNumber` will be sent as SHA256 string |
|
369 |
*/ |
|
370 |
@property(nonatomic, nullable, copy) NSString *phoneNumber; |
|
371 |
|
|
372 |
- (NSString *)phoneNumber UNAVAILABLE_ATTRIBUTE; |
|
373 |
|
|
374 |
/** |
|
375 |
To disable app's vendor identifier(IDFV), set disableIDFVCollection to true |
|
376 |
*/ |
|
377 |
@property(nonatomic) BOOL disableIDFVCollection; |
|
378 |
|
|
379 |
/** |
|
380 |
Set the language of the device. The data will be displayed in Raw Data Reports |
|
381 |
Objective-C: |
|
382 |
|
|
383 |
<pre> |
|
384 |
[[AppsFlyerLib shared] setCurrentDeviceLanguage:@"EN"] |
|
385 |
</pre> |
|
386 |
|
|
387 |
Swift: |
|
388 |
|
|
389 |
<pre> |
|
390 |
AppsFlyerLib.shared().currentDeviceLanguage("EN") |
|
391 |
</pre> |
|
392 |
*/ |
|
393 |
@property(nonatomic, nullable, copy) NSString *currentDeviceLanguage; |
|
394 |
|
|
395 |
/** |
|
396 |
Internal API. Please don't use. |
|
397 |
*/ |
|
398 |
- (void)setPluginInfoWith:(AFSDKPlugin)plugin |
|
399 |
pluginVersion:(NSString *)version |
|
400 |
additionalParams:(NSDictionary * _Nullable)additionalParams |
|
401 |
NS_SWIFT_NAME(setPluginInfo(plugin:version:additionalParams:)); |
|
402 |
|
|
403 |
/** |
|
404 |
Enable the collection of Facebook Deferred AppLinks |
|
405 |
Requires Facebook SDK and Facebook app on target/client device. |
|
406 |
This API must be invoked prior to initializing the AppsFlyer SDK in order to function properly. |
|
407 |
|
|
408 |
Objective-C: |
|
409 |
|
|
410 |
<pre> |
|
411 |
[[AppsFlyerLib shared] enableFacebookDeferredApplinksWithClass:[FBSDKAppLinkUtility class]] |
|
412 |
</pre> |
|
413 |
|
|
414 |
Swift: |
|
415 |
|
|
416 |
<pre> |
|
417 |
AppsFlyerLib.shared().enableFacebookDeferredApplinks(with: FBSDKAppLinkUtility.self) |
|
418 |
</pre> |
|
419 |
|
|
420 |
@param facebookAppLinkUtilityClass requeries method call `[FBSDKAppLinkUtility class]` as param. |
|
421 |
*/ |
|
422 |
- (void)enableFacebookDeferredApplinksWithClass:(Class _Nullable)facebookAppLinkUtilityClass; |
|
423 |
|
|
424 |
/** |
|
425 |
Use this to send the user's emails |
|
426 |
|
|
427 |
@param userEmails The list of strings that hold mails |
|
428 |
@param type Hash algoritm |
|
429 |
*/ |
|
430 |
- (void)setUserEmails:(NSArray<NSString *> * _Nullable)userEmails withCryptType:(EmailCryptType)type; |
|
431 |
|
|
432 |
/** |
|
433 |
Start SDK session |
|
434 |
Add the following method at the `applicationDidBecomeActive` in AppDelegate class |
|
435 |
*/ |
|
436 |
- (void)start; |
|
437 |
|
|
438 |
- (void)startWithCompletionHandler:(void (^ _Nullable)(NSDictionary<NSString *, id> * _Nullable dictionary, NSError * _Nullable error))completionHandler; |
|
439 |
|
|
440 |
/** |
|
441 |
Use this method to log an events with multiple values. See AppsFlyer's documentation for details. |
|
442 |
|
|
443 |
Objective-C: |
|
444 |
|
|
445 |
<pre> |
|
446 |
[[AppsFlyerLib shared] logEvent:AFEventPurchase |
|
447 |
withValues: @{AFEventParamRevenue : @200, |
|
448 |
AFEventParamCurrency : @"USD", |
|
449 |
AFEventParamQuantity : @2, |
|
450 |
AFEventParamContentId: @"092", |
|
451 |
AFEventParamReceiptId: @"9277"}]; |
|
452 |
</pre> |
|
453 |
|
|
454 |
Swift: |
|
455 |
|
|
456 |
<pre> |
|
457 |
AppsFlyerLib.shared().logEvent(AFEventPurchase, |
|
458 |
withValues: [AFEventParamRevenue : "1200", |
|
459 |
AFEventParamContent : "shoes", |
|
460 |
AFEventParamContentId: "123"]) |
|
461 |
</pre> |
|
462 |
|
|
463 |
@param eventName Contains name of event that could be provided from predefined constants in `AppsFlyerLib.h` |
|
464 |
@param values Contains dictionary of values for handling by backend |
|
465 |
*/ |
|
466 |
- (void)logEvent:(NSString *)eventName withValues:(NSDictionary * _Nullable)values; |
|
467 |
|
|
468 |
- (void)logEventWithEventName:(NSString *)eventName |
|
469 |
eventValues:(NSDictionary<NSString * , id> * _Nullable)eventValues |
|
470 |
completionHandler:(void (^ _Nullable)(NSDictionary<NSString *, id> * _Nullable dictionary, NSError * _Nullable error))completionHandler |
|
471 |
NS_SWIFT_NAME(logEvent(name:values:completionHandler:)); |
|
472 |
|
|
473 |
/** |
|
474 |
To log and validate in app purchases you can call this method from the completeTransaction: method on |
|
475 |
your `SKPaymentTransactionObserver`. |
|
476 |
|
|
477 |
@param productIdentifier The product identifier |
|
478 |
@param price The product price |
|
479 |
@param currency The product currency |
|
480 |
@param transactionId The purchase transaction Id |
|
481 |
@param params The additional param, which you want to receive it in the raw reports |
|
482 |
@param successBlock The success callback |
|
483 |
@param failedBlock The failure callback |
|
484 |
*/ |
|
485 |
- (void)validateAndLogInAppPurchase:(NSString * _Nullable)productIdentifier |
|
486 |
price:(NSString * _Nullable)price |
|
487 |
currency:(NSString * _Nullable)currency |
|
488 |
transactionId:(NSString * _Nullable)transactionId |
|
489 |
additionalParameters:(NSDictionary * _Nullable)params |
|
490 |
success:(void (^ _Nullable)(NSDictionary * response))successBlock |
|
491 |
failure:(void (^ _Nullable)(NSError * _Nullable error, id _Nullable reponse))failedBlock NS_AVAILABLE(10_7, 7_0); |
|
492 |
|
|
493 |
/** |
|
494 |
To log location for geo-fencing. Does the same as code below. |
|
495 |
|
|
496 |
<pre> |
|
497 |
AppsFlyerLib.shared().logEvent(AFEventLocation, withValues: [AFEventParamLong:longitude, AFEventParamLat:latitude]) |
|
498 |
</pre> |
|
499 |
|
|
500 |
@param longitude The location longitude |
|
501 |
@param latitude The location latitude |
|
502 |
*/ |
|
503 |
- (void)logLocation:(double)longitude latitude:(double)latitude NS_SWIFT_NAME(logLocation(longitude:latitude:)); |
|
504 |
|
|
505 |
/** |
|
506 |
This method returns AppsFlyer's internal id(unique for your app) |
|
507 |
|
|
508 |
@return Internal AppsFlyer Id |
|
509 |
*/ |
|
510 |
- (NSString *)getAppsFlyerUID; |
|
511 |
|
|
512 |
/** |
|
513 |
In case you want to log deep linking. Does the same as `-handleOpenURL:sourceApplication:withAnnotation`. |
|
514 |
|
|
515 |
@warning Preferred to use `-handleOpenURL:sourceApplication:withAnnotation`. |
|
516 |
|
|
517 |
@param url The URL that was passed to your AppDelegate. |
|
518 |
@param sourceApplication The sourceApplication that passed to your AppDelegate. |
|
519 |
*/ |
|
520 |
- (void)handleOpenURL:(NSURL * _Nullable)url sourceApplication:(NSString * _Nullable)sourceApplication API_UNAVAILABLE(macos); |
|
521 |
|
|
522 |
/** |
|
523 |
In case you want to log deep linking. |
|
524 |
Call this method from inside your AppDelegate `-application:openURL:sourceApplication:annotation:` |
|
525 |
|
|
526 |
@param url The URL that was passed to your AppDelegate. |
|
527 |
@param sourceApplication The sourceApplication that passed to your AppDelegate. |
|
528 |
@param annotation The annotation that passed to your app delegate. |
|
529 |
*/ |
|
530 |
- (void)handleOpenURL:(NSURL * _Nullable)url |
|
531 |
sourceApplication:(NSString * _Nullable)sourceApplication |
|
532 |
withAnnotation:(id _Nullable)annotation API_UNAVAILABLE(macos); |
|
533 |
|
|
534 |
/** |
|
535 |
Call this method from inside of your AppDelegate `-application:openURL:options:` method. |
|
536 |
This method is functionally the same as calling the AppsFlyer method |
|
537 |
`-handleOpenURL:sourceApplication:withAnnotation`. |
|
538 |
|
|
539 |
@param url The URL that was passed to your app delegate |
|
540 |
@param options The options dictionary that was passed to your AppDelegate. |
|
541 |
*/ |
|
542 |
- (void)handleOpenUrl:(NSURL * _Nullable)url options:(NSDictionary * _Nullable)options API_UNAVAILABLE(macos); |
|
543 |
|
|
544 |
/** |
|
545 |
Allow AppsFlyer to handle restoration from an NSUserActivity. |
|
546 |
Use this method to log deep links with OneLink. |
|
547 |
|
|
548 |
@param userActivity The NSUserActivity that caused the app to be opened. |
|
549 |
*/ |
|
550 |
- (BOOL)continueUserActivity:(NSUserActivity * _Nullable)userActivity |
|
551 |
restorationHandler:(void (^ _Nullable)(NSArray * _Nullable))restorationHandler NS_AVAILABLE_IOS(9_0) API_UNAVAILABLE(macos); |
|
552 |
|
|
553 |
/** |
|
554 |
Enable AppsFlyer to handle a push notification. |
|
555 |
|
|
556 |
@see [Learn more here](https://support.appsflyer.com/hc/en-us/articles/207364076-Measuring-Push-Notification-Re-Engagement-Campaigns) |
|
557 |
|
|
558 |
@warning To make it work - set data, related to AppsFlyer under key @"af". |
|
559 |
|
|
560 |
@param pushPayload The `userInfo` from received remote notification. One of root keys should be @"af". |
|
561 |
*/ |
|
562 |
- (void)handlePushNotification:(NSDictionary * _Nullable)pushPayload; |
|
563 |
|
|
564 |
|
|
565 |
/** |
|
566 |
Register uninstall - you should register for remote notification and provide AppsFlyer the push device token. |
|
567 |
|
|
568 |
@param deviceToken The `deviceToken` from `-application:didRegisterForRemoteNotificationsWithDeviceToken:` |
|
569 |
*/ |
|
570 |
- (void)registerUninstall:(NSData * _Nullable)deviceToken; |
|
571 |
|
|
572 |
/** |
|
573 |
Get SDK version. |
|
574 |
|
|
575 |
@return The AppsFlyer SDK version info. |
|
576 |
*/ |
|
577 |
- (NSString *)getSDKVersion; |
|
578 |
|
|
579 |
/** |
|
580 |
This is for internal use. |
|
581 |
*/ |
|
582 |
- (void)remoteDebuggingCallWithData:(NSString *)data; |
|
583 |
|
|
584 |
/** |
|
585 |
This is for internal use. |
|
586 |
*/ |
|
587 |
- (void)remoteDebuggingCallV2WithData:(NSString *)dataAsString; |
|
588 |
|
|
589 |
/** |
|
590 |
Used to force the trigger `onAppOpenAttribution` delegate. |
|
591 |
Notice, re-engagement, session and launch won't be counted. |
|
592 |
Only for OneLink/UniversalLink/Deeplink resolving. |
|
593 |
|
|
594 |
@param URL The param to resolve into -[AppsFlyerLibDelegate onAppOpenAttribution:] |
|
595 |
*/ |
|
596 |
- (void)performOnAppAttributionWithURL:(NSURL * _Nullable)URL; |
|
597 |
|
|
598 |
/** |
|
599 |
@brief This property accepts a string value representing the host name for all endpoints. |
|
600 |
Can be used to Zero rate your application’s data usage. Contact your CSM for more information. |
|
601 |
|
|
602 |
@warning To use `default` SDK endpoint – set value to `nil`. |
|
603 |
|
|
604 |
Objective-C: |
|
605 |
|
|
606 |
<pre> |
|
607 |
[[AppsFlyerLib shared] setHost:@"example.com"]; |
|
608 |
</pre> |
|
609 |
|
|
610 |
Swift: |
|
611 |
|
|
612 |
<pre> |
|
613 |
AppsFlyerLib.shared().host = "example.com" |
|
614 |
</pre> |
|
615 |
*/ |
|
616 |
@property(nonatomic, strong, readonly) NSString *host; |
|
617 |
|
|
618 |
/** |
|
619 |
* This function set the host name and prefix host name for all the endpoints |
|
620 |
**/ |
|
621 |
- (void)setHost:(NSString *)host withHostPrefix:(NSString *)hostPrefix; |
|
622 |
|
|
623 |
/** |
|
624 |
* This property accepts a string value representing the prefix host name for all endpoints. |
|
625 |
* for example "test" prefix with default host name will have the address "host.appsflyer.com" |
|
626 |
*/ |
|
627 |
@property(nonatomic, strong, readonly) NSString *hostPrefix; |
|
628 |
|
|
629 |
/** |
|
630 |
This property is responsible for timeout between sessions in seconds. |
|
631 |
Default value is 5 seconds. |
|
632 |
*/ |
|
633 |
@property(atomic) NSUInteger minTimeBetweenSessions; |
|
634 |
|
|
635 |
/** |
|
636 |
API to shut down all SDK activities. |
|
637 |
|
|
638 |
@warning This will disable all requests from AppsFlyer SDK. |
|
639 |
*/ |
|
640 |
@property(atomic) BOOL isStopped; |
|
641 |
|
|
642 |
/** |
|
643 |
API to set manually Facebook deferred app link |
|
644 |
*/ |
|
645 |
@property(nonatomic, nullable, copy) NSURL *facebookDeferredAppLink; |
|
646 |
|
|
647 |
/** |
|
648 |
Block an events from being shared with ad networks and other 3rd party integrations |
|
649 |
Must only include letters/digits or underscore, maximum length: 45 |
|
650 |
*/ |
|
651 |
@property(nonatomic, nullable, copy) NSArray<NSString *> *sharingFilter DEPRECATED_MSG_ATTRIBUTE("starting SDK version 6.4.0, please use `setSharingFilterForPartners:`"); |
|
652 |
|
|
653 |
@property(nonatomic) NSUInteger deepLinkTimeout; |
|
654 |
|
|
655 |
/** |
|
656 |
Block an events from being shared with any partner |
|
657 |
This method overwrite -[AppsFlyerLib setSharingFilter:] |
|
658 |
*/ |
|
659 |
- (void)setSharingFilterForAllPartners DEPRECATED_MSG_ATTRIBUTE("starting SDK version 6.4.0, please use `setSharingFilterForPartners:`"); |
|
660 |
|
|
661 |
/** |
|
662 |
Block an events from being shared with ad networks and other 3rd party integrations |
|
663 |
Must only include letters/digits or underscore, maximum length: 45 |
|
664 |
|
|
665 |
The sharing filter is cleared in case if `nil` or empty array passed as a parameter. |
|
666 |
"all" keyword sets sharing filter for ALL partners, it is case insencitive and has highest priority |
|
667 |
if passed along with another values. For example, if ["all", "examplePartner1_int", "examplePartner2_int" ] passed, |
|
668 |
the sharing filter will be set for ALL partners. |
|
669 |
*/ |
|
670 |
- (void)setSharingFilterForPartners:(NSArray<NSString *> * _Nullable)sharingFilter; |
|
671 |
|
|
672 |
|
|
673 |
/** |
|
674 |
Sets or updates the user consent data related to GDPR and DMA regulations for advertising and data usage |
|
675 |
purposes within the application. This method must be invoked with the user's current consent status each |
|
676 |
time the app starts or whenever there is a change in the user's consent preferences. |
|
677 |
|
|
678 |
Note that this method does not persist the consent data across app sessions; it only applies for the |
|
679 |
duration of the current app session. If you wish to stop providing the consent data, you should |
|
680 |
cease calling this method. |
|
681 |
|
|
682 |
@param consent an instance of AppsFlyerConsent that encapsulates the user's consent information. |
|
683 |
*/ |
|
684 |
- (void)setConsentData:(AppsFlyerConsent *)consent; |
|
685 |
|
|
686 |
/** |
|
687 |
Enable the SDK to collect and send TCF data |
|
688 |
|
|
689 |
@param shouldCollectConsentData indicates if the TCF data collection is enabled. |
|
690 |
*/ |
|
691 |
- (void)enableTCFDataCollection:(BOOL)shouldCollectConsentData; |
|
692 |
|
|
693 |
/** |
|
694 |
Validate if URL contains certain string and append quiery |
|
695 |
parameters to deeplink URL. In case if URL does not contain user-defined string, |
|
696 |
parameters are not appended to the url. |
|
697 |
|
|
698 |
@param containsString string to check in URL. |
|
699 |
@param parameters NSDictionary, which containins parameters to append to the deeplink url after it passed validation. |
|
700 |
*/ |
|
701 |
- (void)appendParametersToDeepLinkingURLWithString:(NSString *)containsString |
|
702 |
parameters:(NSDictionary<NSString *, NSString*> *)parameters |
|
703 |
NS_SWIFT_NAME(appendParametersToDeeplinkURL(contains:parameters:)); |
|
704 |
|
|
705 |
/** |
|
706 |
Adds array of keys, which are used to compose key path |
|
707 |
to resolve deeplink from push notification payload `userInfo`. |
|
708 |
|
|
709 |
@param deepLinkPath an array of strings which contains keys to search for deeplink in payload. |
|
710 |
*/ |
|
711 |
- (void)addPushNotificationDeepLinkPath:(NSArray<NSString *> *)deepLinkPath; |
|
712 |
|
|
713 |
/** |
|
714 |
* Allows sending custom data for partner integration purposes. |
|
715 |
* |
|
716 |
* @param partnerId ID of the partner (usually has "_int" suffix) |
|
717 |
* @param partnerInfo customer data, depends on the integration nature with specific partner |
|
718 |
*/ |
|
719 |
|
|
720 |
- (void)setPartnerDataWithPartnerId:(NSString * _Nullable)partnerId partnerInfo:(NSDictionary<NSString *, id> * _Nullable)partnerInfo |
|
721 |
NS_SWIFT_NAME(setPartnerData(partnerId:partnerInfo:)); |
|
722 |
|
|
723 |
@end |
|
724 |
|
|
725 |
NS_ASSUME_NONNULL_END |