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