Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  AppsFlyerTracker.h
  3. //  AppsFlyerLib
  4. //
  5. //  AppsFlyer iOS SDK 4.7.11
  6. //  Copyright (c) 2013 AppsFlyer Ltd. All rights reserved.
  7. //
  8.  
  9. #import <Foundation/Foundation.h>
  10.  
  11. // In app event names constants
  12. #define AFEventLevelAchieved            @"af_level_achieved"
  13. #define AFEventAddPaymentInfo           @"af_add_payment_info"
  14. #define AFEventAddToCart                @"af_add_to_cart"
  15. #define AFEventAddToWishlist            @"af_add_to_wishlist"
  16. #define AFEventCompleteRegistration     @"af_complete_registration"
  17. #define AFEventTutorial_completion      @"af_tutorial_completion"
  18. #define AFEventInitiatedCheckout        @"af_initiated_checkout"
  19. #define AFEventPurchase                 @"af_purchase"
  20. #define AFEventRate                     @"af_rate"
  21. #define AFEventSearch                   @"af_search"
  22. #define AFEventSpentCredits             @"af_spent_credits"
  23. #define AFEventAchievementUnlocked      @"af_achievement_unlocked"
  24. #define AFEventContentView              @"af_content_view"
  25. #define AFEventListView                 @"af_list_view"
  26. #define AFEventTravelBooking            @"af_travel_booking"
  27. #define AFEventShare                    @"af_share"
  28. #define AFEventInvite                   @"af_invite"
  29. #define AFEventLogin                    @"af_login"
  30. #define AFEventReEngage                 @"af_re_engage"
  31. #define AFEventUpdate                   @"af_update"
  32. #define AFEventOpenedFromPushNotification @"af_opened_from_push_notification"
  33. #define AFEventLocation                 @"af_location_coordinates"
  34. #define AFEventOrderId                  @"af_order_id"
  35. #define AFEventCustomerSegment          @"af_customer_segment"
  36.  
  37.  
  38.  
  39. // In app event parameter names
  40. #define AFEventParamAchievenmentId         @"af_achievement_id"
  41. #define AFEventParamLevel                  @"af_level"
  42. #define AFEventParamScore                  @"af_score"
  43. #define AFEventParamSuccess                @"af_success"
  44. #define AFEventParamPrice                  @"af_price"
  45. #define AFEventParamContentType            @"af_content_type"
  46. #define AFEventParamContentId              @"af_content_id"
  47. #define AFEventParamContentList            @"ad_content_list"
  48. #define AFEventParamCurrency               @"af_currency"
  49. #define AFEventParamQuantity               @"af_quantity"
  50. #define AFEventParamRegistrationMethod     @"af_registration_method"
  51. #define AFEventParamPaymentInfoAvailable   @"af_payment_info_available"
  52. #define AFEventParamMaxRatingValue         @"af_max_rating_value"
  53. #define AFEventParamRatingValue            @"af_rating_value"
  54. #define AFEventParamSearchString           @"af_search_string"
  55. #define AFEventParamDateA                  @"af_date_a"
  56. #define AFEventParamDateB                  @"af_date_b"
  57. #define AFEventParamDestinationA           @"af_destination_a"
  58. #define AFEventParamDestinationB           @"af_destination_b"
  59. #define AFEventParamDescription            @"af_description"
  60. #define AFEventParamClass                  @"af_class"
  61. #define AFEventParamEventStart             @"af_event_start"
  62. #define AFEventParamEventEnd               @"af_event_end"
  63. #define AFEventParamLat                    @"af_lat"
  64. #define AFEventParamLong                   @"af_long"
  65. #define AFEventParamCustomerUserId         @"af_customer_user_id"
  66. #define AFEventParamValidated              @"af_validated"
  67. #define AFEventParamRevenue                @"af_revenue"
  68. #define AFEventParamReceiptId              @"af_receipt_id"
  69. #define AFEventParamTutorialId             @"af_tutorial_id"
  70. #define AFEventParamAchievenmentId         @"af_achievement_id"
  71. #define AFEventParamVirtualCurrencyName    @"af_virtual_currency_name"
  72. #define AFEventParamDeepLink               @"af_deep_link"
  73. #define AFEventParamOldVersion             @"af_old_version"
  74. #define AFEventParamNewVersion             @"af_new_version"
  75. #define AFEventParamReviewText             @"af_review_text"
  76. #define AFEventParamCouponCode             @"af_coupon_code"
  77. #define AFEventParam1                      @"af_param_1"
  78. #define AFEventParam2                      @"af_param_2"
  79. #define AFEventParam3                      @"af_param_3"
  80. #define AFEventParam4                      @"af_param_4"
  81. #define AFEventParam5                      @"af_param_5"
  82. #define AFEventParam6                      @"af_param_6"
  83. #define AFEventParam7                      @"af_param_7"
  84. #define AFEventParam8                      @"af_param_8"
  85. #define AFEventParam9                      @"af_param_9"
  86. #define AFEventParam10                     @"af_param_10"
  87.  
  88. #define AFEventParamDepartingDepartureDate  @"af_departing_departure_date"
  89. #define AFEventParamReturningDepartureDate  @"af_returning_departure_date"
  90. #define AFEventParamDestinationList         @"af_destination_list"  //array of string
  91. #define AFEventParamCity                    @"af_city"
  92. #define AFEventParamRegion                  @"af_region"
  93. #define AFEventParamCountry                 @"af_country"
  94.  
  95.  
  96. #define AFEventParamDepartingArrivalDate    @"af_departing_arrival_date"
  97. #define AFEventParamReturningArrivalDate    @"af_returning_arrival_date"
  98. #define AFEventParamSuggestedDestinations   @"af_suggested_destinations" //array of string
  99. #define AFEventParamTravelStart             @"af_travel_start"
  100. #define AFEventParamTravelEnd               @"af_travel_end"
  101. #define AFEventParamNumAdults               @"af_num_adults"
  102. #define AFEventParamNumChildren             @"af_num_children"
  103. #define AFEventParamNumInfants              @"af_num_infants"
  104. #define AFEventParamSuggestedHotels         @"af_suggested_hotels" //array of string
  105.  
  106. #define AFEventParamUserScore               @"af_user_score"
  107. #define AFEventParamHotelScore              @"af_hotel_score"
  108. #define AFEventParamPurchaseCurrency        @"af_purchase_currency"
  109.  
  110. #define AFEventParamPreferredStarRatings    @"af_preferred_star_ratings"    //array of int (basically a tupple (min,max) but we'll use array of int and instruct the developer to use two values)
  111.  
  112. #define AFEventParamPreferredPriceRange     @"af_preferred_price_range" //array of int (basically a tupple (min,max) but we'll use array of int and instruct the developer to use two values)
  113. #define AFEventParamPreferredNeighborhoods  @"af_preferred_neighborhoods" //array of string
  114. #define AFEventParamPreferredNumStops       @"af_preferred_num_stops"
  115.  
  116.  
  117.  
  118.  
  119. typedef enum  {
  120.     EmailCryptTypeNone = 0,
  121.     EmailCryptTypeSHA1 = 1,
  122.     EmailCryptTypeMD5 = 2,
  123.     EmailCryptTypeSHA256 = 3
  124. } EmailCryptType;
  125.  
  126. /*
  127.  * This delegate should be use if you want to use AppsFlyer conversion data. See AppsFlyer iOS
  128.  */
  129. @protocol AppsFlyerTrackerDelegate <NSObject>
  130.  
  131. @optional
  132. - (void) onConversionDataReceived:(NSDictionary*) installData;
  133. - (void) onConversionDataRequestFailure:(NSError *)error;
  134. - (void) onAppOpenAttribution:(NSDictionary*) attributionData;
  135. - (void) onAppOpenAttributionFailure:(NSError *)error;
  136.  
  137. @end
  138.  
  139. @interface AppsFlyerTracker : NSObject {
  140.  
  141.     BOOL _isDebug;
  142.     BOOL didCollectIAdData;
  143.     BOOL _useReceiptValidationSandbox;
  144.     BOOL _useUninstallSandbox;
  145.     EmailCryptType emailCryptType;
  146.     NSArray *userEmails;
  147. }
  148.  
  149. +(AppsFlyerTracker*) sharedTracker;
  150.  
  151. /* In case you use your own user ID in your app, you can set this property to that ID. */
  152. @property (nonatomic, strong, setter=setCustomerUserID:) NSString *customerUserID;
  153.  
  154.  
  155. /* In case you use Custom data and you want to receive it in the raw reports.*/
  156. @property (nonatomic, strong, setter=setAdditionalData:) NSDictionary *customData;
  157.  
  158. /* Use this property to set your AppsFlyer's dev key. */
  159. @property (nonatomic, strong, setter=setAppsFlyerDevKey:) NSString *appsFlyerDevKey;
  160.  
  161. /* Use this property to set your app's Apple ID (taken from the app's page on iTunes Connect) */
  162. @property (nonatomic, strong, setter=setAppleAppID:) NSString *appleAppID;
  163.  
  164. /*
  165.  * In case of in app purchase events, you can set the currency code your user has purchased with.
  166.  * The currency code is a 3 letter code according to ISO standards. Example: "USD"
  167.  */
  168. @property (nonatomic, strong) NSString *currencyCode;
  169.  
  170.  
  171. /* AppsFlyer's SDK send the data to AppsFlyer's servers over HTTPS. You can set the isHTTPS property to NO in order to use regular HTTP. */
  172. //@property BOOL isHTTPS;
  173.  
  174. /*
  175.  * AppsFLyer SDK collect Apple's advertisingIdentifier if the AdSupport framework included in the SDK.
  176.  * You can disable this behavior by setting the following property to YES.
  177.  */
  178. @property BOOL disableAppleAdSupportTracking;
  179.  
  180. /*
  181.  * Prints our messages to the log. This property should only be used in DEBUG mode. The default value
  182.  * is NO.
  183.  */
  184. @property (nonatomic, setter = setIsDebug:) BOOL isDebug;
  185.  
  186.  
  187. /*
  188.  * Set this flag to NO, to not collect the device name.
  189.  */
  190. @property (nonatomic, setter = setShouldCollectDeviceName:) BOOL shouldCollectDeviceName;
  191.  
  192.  
  193. /*
  194.  * Opt-out tracking for specific user
  195.  */
  196. @property BOOL deviceTrackingDisabled;
  197.  
  198. /*
  199.  * Opt-out tracking for iAd attributions
  200.  */
  201. @property BOOL disableIAdTracking;
  202.  
  203. /*
  204.  * AppsFlyer delegate. See AppsFlyerTrackerDelegate abvoe
  205.  */
  206. //@property (unsafe_unretained, nonatomic) id<AppsFlyerTrackerDelegate> delegate; //RD-5419
  207. @property (weak, nonatomic) id<AppsFlyerTrackerDelegate> delegate;
  208.  
  209. /*
  210.  * In app purchase receipt validation Apple environment (production or sandbox). The default value
  211.  * is NO.
  212.  */
  213. @property (nonatomic, setter = setUseReceiptValidationSandbox:) BOOL useReceiptValidationSandbox;
  214.  
  215.  
  216. /*
  217.  * Set this flag to test uninstall on Apple environment (production or sandbox). The default value
  218.  * is NO.
  219.  */
  220. @property (nonatomic, setter = setUseUninstallSandbox:) BOOL useUninstallSandbox;
  221.  
  222. /*
  223.  * Advertising Id (exposed for RemoteDebug)
  224.  */
  225. @property (nonatomic, strong) NSString *advertiserId;
  226.  
  227. /*
  228.  * Use this to send the User's emails
  229.  */
  230. -(void) setUserEmails:(NSArray *) userEmails withCryptType:(EmailCryptType) type;
  231.  
  232.  
  233. /* Track application launch*/
  234. - (void) trackAppLaunch;
  235.  
  236. /*
  237.  * Use this method to track events in your app like purchases or user actions.
  238.  * Example :
  239.  *      [[AppsFlyer sharedTracker] trackEvent:@"hotel-booked" withValue:"200"];
  240.  */
  241. - (void) trackEvent:(NSString*)eventName withValue:(NSString*)value __attribute__((deprecated));
  242.  
  243. /*
  244.  * Use this method to track an events with mulitple values. See AppsFlyer's documentation for details.
  245.  *
  246.  */
  247. - (void) trackEvent:(NSString *)eventName withValues:(NSDictionary*)values;
  248.  
  249. /*
  250.  * To track in app purchases you can call this method from the completeTransaction: method on
  251.  * your SKPaymentTransactionObserver.
  252.  */
  253. - (void) validateAndTrackInAppPurchase:(NSString *)productIdentifier
  254.                                  price:(NSString *)price
  255.                               currency:(NSString *)currency
  256.                          transactionId:(NSString *) tranactionId
  257.                   additionalParameters:(NSDictionary *)params
  258.                                success:(void (^)(NSDictionary *response))successBlock
  259.                                failure:(void (^)(NSError *error, id reponse)) failedBlock NS_AVAILABLE(10_7, 7_0);
  260.  
  261.  
  262.  
  263. /*
  264. * To Track location for geo-fencing.
  265. */
  266. - (void) trackLocation:(double) longitude latitude:(double) latitude;
  267.  
  268. /*
  269.  * This method returns AppsFLyer's internal user ID (unique for your app)
  270.  */
  271. - (NSString *) getAppsFlyerUID;
  272.  
  273. /*
  274.  * In case you want to use AppsFlyer tracking data in your app you can use the following method set a
  275.  * delegate with callback buttons for the tracking data. See AppsFlyerTrackerDelegate above.
  276.  */
  277. - (void) loadConversionDataWithDelegate:(id<AppsFlyerTrackerDelegate>) delegate __attribute__((deprecated));
  278.  
  279. /*
  280.  * In case you want to track deep linking, call this method from your delegate's openURL method.
  281.  */
  282. - (void) handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication __attribute__((deprecated));
  283.  
  284. /*
  285.  * In case you want to track deep linking, call this method from your delegate's openURL method with refferer.
  286.  */
  287. - (void) handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication withAnnotation:(id) annotation __attribute__((deprecated));
  288.  
  289.  
  290. - (void) handleOpenUrl:(NSURL *) url options:(NSDictionary *)options;
  291. /*
  292.  * For Universal links iOS 9
  293.  */
  294.  
  295. - (BOOL) continueUserActivity:(NSUserActivity *) userActivity restorationHandler:(void (^)(NSArray *))restorationHandler NS_AVAILABLE_IOS(9_0);
  296. - (void) didUpdateUserActivity:(NSUserActivity *)userActivity NS_AVAILABLE_IOS(9_0);
  297. - (void) handlePushNotification:(NSDictionary *) pushPayload;
  298.  
  299.  
  300. /*
  301.   Register uninstall - you should register for remote notification and provide Appsflyer the push device token.
  302. */
  303. - (void) registerUninstall:(NSData *) deviceToken;
  304.  
  305. /*
  306.  Get SDK version.
  307. */
  308. - (NSString *) getSDKVersion;
  309.  
  310.  
  311.  
  312. - (void) remoteDebuggingCallWithData:(NSString *) data;
  313.  
  314. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement