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