affise-attribution-lib 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/README.md +705 -668
  2. package/affise-attribution-native.podspec +38 -38
  3. package/android/build.gradle +1 -1
  4. package/ios/AffiseAttributionNative.m +102 -102
  5. package/ios/AffiseAttributionNative.swift +238 -238
  6. package/lib/commonjs/AffiseFlag.js.map +1 -1
  7. package/lib/commonjs/AffiseInitProperties.js.map +1 -1
  8. package/lib/commonjs/Export.js.map +1 -1
  9. package/lib/commonjs/events/AutoCatchingType.js.map +1 -1
  10. package/lib/commonjs/events/PredefinedParameters.js.map +1 -1
  11. package/lib/commonjs/events/TouchType.js.map +1 -1
  12. package/lib/commonjs/events/base/AffiseEvent.js.map +1 -1
  13. package/lib/commonjs/events/base/NativeEvent.js.map +1 -1
  14. package/lib/commonjs/events/custom/CustomId01Event.js.map +1 -1
  15. package/lib/commonjs/events/custom/CustomId02Event.js.map +1 -1
  16. package/lib/commonjs/events/custom/CustomId03Event.js.map +1 -1
  17. package/lib/commonjs/events/custom/CustomId04Event.js.map +1 -1
  18. package/lib/commonjs/events/custom/CustomId05Event.js.map +1 -1
  19. package/lib/commonjs/events/custom/CustomId06Event.js.map +1 -1
  20. package/lib/commonjs/events/custom/CustomId07Event.js.map +1 -1
  21. package/lib/commonjs/events/custom/CustomId08Event.js.map +1 -1
  22. package/lib/commonjs/events/custom/CustomId09Event.js.map +1 -1
  23. package/lib/commonjs/events/custom/CustomId10Event.js.map +1 -1
  24. package/lib/commonjs/events/predefined/AchieveLevelEvent.js.map +1 -1
  25. package/lib/commonjs/events/predefined/AddPaymentInfoEvent.js.map +1 -1
  26. package/lib/commonjs/events/predefined/AddToCartEvent.js.map +1 -1
  27. package/lib/commonjs/events/predefined/AddToWishlistEvent.js.map +1 -1
  28. package/lib/commonjs/events/predefined/ClickAdvEvent.js.map +1 -1
  29. package/lib/commonjs/events/predefined/CompleteRegistrationEvent.js.map +1 -1
  30. package/lib/commonjs/events/predefined/CompleteStreamEvent.js.map +1 -1
  31. package/lib/commonjs/events/predefined/CompleteTrialEvent.js.map +1 -1
  32. package/lib/commonjs/events/predefined/CompleteTutorialEvent.js.map +1 -1
  33. package/lib/commonjs/events/predefined/ContentItemsViewEvent.js.map +1 -1
  34. package/lib/commonjs/events/predefined/DeepLinkedEvent.js.map +1 -1
  35. package/lib/commonjs/events/predefined/InitiatePurchaseEvent.js.map +1 -1
  36. package/lib/commonjs/events/predefined/InitiateStreamEvent.js.map +1 -1
  37. package/lib/commonjs/events/predefined/InviteEvent.js.map +1 -1
  38. package/lib/commonjs/events/predefined/LastAttributedTouchEvent.js.map +1 -1
  39. package/lib/commonjs/events/predefined/ListViewEvent.js.map +1 -1
  40. package/lib/commonjs/events/predefined/LoginEvent.js.map +1 -1
  41. package/lib/commonjs/events/predefined/OpenedFromPushNotificationEvent.js.map +1 -1
  42. package/lib/commonjs/events/predefined/PurchaseEvent.js.map +1 -1
  43. package/lib/commonjs/events/predefined/RateEvent.js.map +1 -1
  44. package/lib/commonjs/events/predefined/ReEngageEvent.js.map +1 -1
  45. package/lib/commonjs/events/predefined/ReserveEvent.js.map +1 -1
  46. package/lib/commonjs/events/predefined/SalesEvent.js.map +1 -1
  47. package/lib/commonjs/events/predefined/SearchEvent.js.map +1 -1
  48. package/lib/commonjs/events/predefined/ShareEvent.js.map +1 -1
  49. package/lib/commonjs/events/predefined/SpendCreditsEvent.js.map +1 -1
  50. package/lib/commonjs/events/predefined/StartRegistrationEvent.js.map +1 -1
  51. package/lib/commonjs/events/predefined/StartTrialEvent.js.map +1 -1
  52. package/lib/commonjs/events/predefined/StartTutorialEvent.js.map +1 -1
  53. package/lib/commonjs/events/predefined/SubscribeEvent.js.map +1 -1
  54. package/lib/commonjs/events/predefined/TravelBookingEvent.js.map +1 -1
  55. package/lib/commonjs/events/predefined/UnlockAchievementEvent.js.map +1 -1
  56. package/lib/commonjs/events/predefined/UnsubscribeEvent.js.map +1 -1
  57. package/lib/commonjs/events/predefined/UpdateEvent.js.map +1 -1
  58. package/lib/commonjs/events/predefined/ViewAdvEvent.js.map +1 -1
  59. package/lib/commonjs/events/predefined/ViewCartEvent.js.map +1 -1
  60. package/lib/commonjs/events/predefined/ViewItemEvent.js.map +1 -1
  61. package/lib/commonjs/events/predefined/ViewItemsEvent.js.map +1 -1
  62. package/lib/commonjs/events/subscription/BaseSubscriptionEvent.js.map +1 -1
  63. package/lib/commonjs/events/subscription/ConvertedOfferEvent.js.map +1 -1
  64. package/lib/commonjs/events/subscription/ConvertedOfferFromRetryEvent.js.map +1 -1
  65. package/lib/commonjs/events/subscription/ConvertedTrialEvent.js.map +1 -1
  66. package/lib/commonjs/events/subscription/ConvertedTrialFromRetryEvent.js.map +1 -1
  67. package/lib/commonjs/events/subscription/FailedOfferFromRetryEvent.js.map +1 -1
  68. package/lib/commonjs/events/subscription/FailedOfferiseEvent.js.map +1 -1
  69. package/lib/commonjs/events/subscription/FailedSubscriptionEvent.js.map +1 -1
  70. package/lib/commonjs/events/subscription/FailedSubscriptionFromRetryEvent.js.map +1 -1
  71. package/lib/commonjs/events/subscription/FailedTrialEvent.js.map +1 -1
  72. package/lib/commonjs/events/subscription/FailedTrialFromRetryEvent.js.map +1 -1
  73. package/lib/commonjs/events/subscription/InitialOfferEvent.js.map +1 -1
  74. package/lib/commonjs/events/subscription/InitialSubscriptionEvent.js.map +1 -1
  75. package/lib/commonjs/events/subscription/InitialTrialEvent.js.map +1 -1
  76. package/lib/commonjs/events/subscription/OfferInRetryEvent.js.map +1 -1
  77. package/lib/commonjs/events/subscription/ReactivatedSubscriptionEvent.js.map +1 -1
  78. package/lib/commonjs/events/subscription/RenewedSubscriptionEvent.js.map +1 -1
  79. package/lib/commonjs/events/subscription/RenewedSubscriptionFromRetryEvent.js.map +1 -1
  80. package/lib/commonjs/events/subscription/SubscriptionInRetryEvent.js.map +1 -1
  81. package/lib/commonjs/events/subscription/SubscriptionParameters.js.map +1 -1
  82. package/lib/commonjs/events/subscription/TrialInRetryEvent.js.map +1 -1
  83. package/lib/commonjs/events/subscription/UnsubscriptionEvent.js.map +1 -1
  84. package/lib/commonjs/index.d.js.map +1 -1
  85. package/lib/commonjs/index.js +51 -51
  86. package/lib/commonjs/index.js.map +1 -1
  87. package/lib/commonjs/referrer/ReferrerKey.js.map +1 -1
  88. package/lib/module/AffiseFlag.js.map +1 -1
  89. package/lib/module/AffiseInitProperties.js.map +1 -1
  90. package/lib/module/Export.js.map +1 -1
  91. package/lib/module/events/AutoCatchingType.js.map +1 -1
  92. package/lib/module/events/PredefinedParameters.js.map +1 -1
  93. package/lib/module/events/TouchType.js.map +1 -1
  94. package/lib/module/events/base/AffiseEvent.js.map +1 -1
  95. package/lib/module/events/base/NativeEvent.js.map +1 -1
  96. package/lib/module/events/custom/CustomId01Event.js.map +1 -1
  97. package/lib/module/events/custom/CustomId02Event.js.map +1 -1
  98. package/lib/module/events/custom/CustomId03Event.js.map +1 -1
  99. package/lib/module/events/custom/CustomId04Event.js.map +1 -1
  100. package/lib/module/events/custom/CustomId05Event.js.map +1 -1
  101. package/lib/module/events/custom/CustomId06Event.js.map +1 -1
  102. package/lib/module/events/custom/CustomId07Event.js.map +1 -1
  103. package/lib/module/events/custom/CustomId08Event.js.map +1 -1
  104. package/lib/module/events/custom/CustomId09Event.js.map +1 -1
  105. package/lib/module/events/custom/CustomId10Event.js.map +1 -1
  106. package/lib/module/events/predefined/AchieveLevelEvent.js.map +1 -1
  107. package/lib/module/events/predefined/AddPaymentInfoEvent.js.map +1 -1
  108. package/lib/module/events/predefined/AddToCartEvent.js.map +1 -1
  109. package/lib/module/events/predefined/AddToWishlistEvent.js.map +1 -1
  110. package/lib/module/events/predefined/ClickAdvEvent.js.map +1 -1
  111. package/lib/module/events/predefined/CompleteRegistrationEvent.js.map +1 -1
  112. package/lib/module/events/predefined/CompleteStreamEvent.js.map +1 -1
  113. package/lib/module/events/predefined/CompleteTrialEvent.js.map +1 -1
  114. package/lib/module/events/predefined/CompleteTutorialEvent.js.map +1 -1
  115. package/lib/module/events/predefined/ContentItemsViewEvent.js.map +1 -1
  116. package/lib/module/events/predefined/DeepLinkedEvent.js.map +1 -1
  117. package/lib/module/events/predefined/InitiatePurchaseEvent.js.map +1 -1
  118. package/lib/module/events/predefined/InitiateStreamEvent.js.map +1 -1
  119. package/lib/module/events/predefined/InviteEvent.js.map +1 -1
  120. package/lib/module/events/predefined/LastAttributedTouchEvent.js.map +1 -1
  121. package/lib/module/events/predefined/ListViewEvent.js.map +1 -1
  122. package/lib/module/events/predefined/LoginEvent.js.map +1 -1
  123. package/lib/module/events/predefined/OpenedFromPushNotificationEvent.js.map +1 -1
  124. package/lib/module/events/predefined/PurchaseEvent.js.map +1 -1
  125. package/lib/module/events/predefined/RateEvent.js.map +1 -1
  126. package/lib/module/events/predefined/ReEngageEvent.js.map +1 -1
  127. package/lib/module/events/predefined/ReserveEvent.js.map +1 -1
  128. package/lib/module/events/predefined/SalesEvent.js.map +1 -1
  129. package/lib/module/events/predefined/SearchEvent.js.map +1 -1
  130. package/lib/module/events/predefined/ShareEvent.js.map +1 -1
  131. package/lib/module/events/predefined/SpendCreditsEvent.js.map +1 -1
  132. package/lib/module/events/predefined/StartRegistrationEvent.js.map +1 -1
  133. package/lib/module/events/predefined/StartTrialEvent.js.map +1 -1
  134. package/lib/module/events/predefined/StartTutorialEvent.js.map +1 -1
  135. package/lib/module/events/predefined/SubscribeEvent.js.map +1 -1
  136. package/lib/module/events/predefined/TravelBookingEvent.js.map +1 -1
  137. package/lib/module/events/predefined/UnlockAchievementEvent.js.map +1 -1
  138. package/lib/module/events/predefined/UnsubscribeEvent.js.map +1 -1
  139. package/lib/module/events/predefined/UpdateEvent.js.map +1 -1
  140. package/lib/module/events/predefined/ViewAdvEvent.js.map +1 -1
  141. package/lib/module/events/predefined/ViewCartEvent.js.map +1 -1
  142. package/lib/module/events/predefined/ViewItemEvent.js.map +1 -1
  143. package/lib/module/events/predefined/ViewItemsEvent.js.map +1 -1
  144. package/lib/module/events/subscription/BaseSubscriptionEvent.js.map +1 -1
  145. package/lib/module/events/subscription/ConvertedOfferEvent.js.map +1 -1
  146. package/lib/module/events/subscription/ConvertedOfferFromRetryEvent.js.map +1 -1
  147. package/lib/module/events/subscription/ConvertedTrialEvent.js.map +1 -1
  148. package/lib/module/events/subscription/ConvertedTrialFromRetryEvent.js.map +1 -1
  149. package/lib/module/events/subscription/FailedOfferFromRetryEvent.js.map +1 -1
  150. package/lib/module/events/subscription/FailedOfferiseEvent.js.map +1 -1
  151. package/lib/module/events/subscription/FailedSubscriptionEvent.js.map +1 -1
  152. package/lib/module/events/subscription/FailedSubscriptionFromRetryEvent.js.map +1 -1
  153. package/lib/module/events/subscription/FailedTrialEvent.js.map +1 -1
  154. package/lib/module/events/subscription/FailedTrialFromRetryEvent.js.map +1 -1
  155. package/lib/module/events/subscription/InitialOfferEvent.js.map +1 -1
  156. package/lib/module/events/subscription/InitialSubscriptionEvent.js.map +1 -1
  157. package/lib/module/events/subscription/InitialTrialEvent.js.map +1 -1
  158. package/lib/module/events/subscription/OfferInRetryEvent.js.map +1 -1
  159. package/lib/module/events/subscription/ReactivatedSubscriptionEvent.js.map +1 -1
  160. package/lib/module/events/subscription/RenewedSubscriptionEvent.js.map +1 -1
  161. package/lib/module/events/subscription/RenewedSubscriptionFromRetryEvent.js.map +1 -1
  162. package/lib/module/events/subscription/SubscriptionInRetryEvent.js.map +1 -1
  163. package/lib/module/events/subscription/SubscriptionParameters.js.map +1 -1
  164. package/lib/module/events/subscription/TrialInRetryEvent.js.map +1 -1
  165. package/lib/module/events/subscription/UnsubscriptionEvent.js.map +1 -1
  166. package/lib/module/index.d.js.map +1 -1
  167. package/lib/module/index.js +51 -51
  168. package/lib/module/index.js.map +1 -1
  169. package/lib/module/referrer/ReferrerKey.js.map +1 -1
  170. package/lib/typescript/AffiseFlag.d.ts +3 -3
  171. package/lib/typescript/AffiseInitProperties.d.ts +12 -12
  172. package/lib/typescript/Export.d.ts +74 -74
  173. package/lib/typescript/events/AutoCatchingType.d.ts +7 -7
  174. package/lib/typescript/events/PredefinedParameters.d.ts +75 -75
  175. package/lib/typescript/events/TouchType.d.ts +5 -5
  176. package/lib/typescript/events/base/AffiseEvent.d.ts +39 -39
  177. package/lib/typescript/events/base/NativeEvent.d.ts +4 -4
  178. package/lib/typescript/events/custom/CustomId01Event.d.ts +11 -11
  179. package/lib/typescript/events/custom/CustomId02Event.d.ts +11 -11
  180. package/lib/typescript/events/custom/CustomId03Event.d.ts +11 -11
  181. package/lib/typescript/events/custom/CustomId04Event.d.ts +11 -11
  182. package/lib/typescript/events/custom/CustomId05Event.d.ts +11 -11
  183. package/lib/typescript/events/custom/CustomId06Event.d.ts +11 -11
  184. package/lib/typescript/events/custom/CustomId07Event.d.ts +11 -11
  185. package/lib/typescript/events/custom/CustomId08Event.d.ts +11 -11
  186. package/lib/typescript/events/custom/CustomId09Event.d.ts +11 -11
  187. package/lib/typescript/events/custom/CustomId10Event.d.ts +11 -11
  188. package/lib/typescript/events/predefined/AchieveLevelEvent.d.ts +4 -4
  189. package/lib/typescript/events/predefined/AddPaymentInfoEvent.d.ts +4 -4
  190. package/lib/typescript/events/predefined/AddToCartEvent.d.ts +4 -4
  191. package/lib/typescript/events/predefined/AddToWishlistEvent.d.ts +4 -4
  192. package/lib/typescript/events/predefined/ClickAdvEvent.d.ts +4 -4
  193. package/lib/typescript/events/predefined/CompleteRegistrationEvent.d.ts +4 -4
  194. package/lib/typescript/events/predefined/CompleteStreamEvent.d.ts +4 -4
  195. package/lib/typescript/events/predefined/CompleteTrialEvent.d.ts +4 -4
  196. package/lib/typescript/events/predefined/CompleteTutorialEvent.d.ts +4 -4
  197. package/lib/typescript/events/predefined/ContentItemsViewEvent.d.ts +4 -4
  198. package/lib/typescript/events/predefined/DeepLinkedEvent.d.ts +4 -4
  199. package/lib/typescript/events/predefined/InitiatePurchaseEvent.d.ts +4 -4
  200. package/lib/typescript/events/predefined/InitiateStreamEvent.d.ts +4 -4
  201. package/lib/typescript/events/predefined/InviteEvent.d.ts +4 -4
  202. package/lib/typescript/events/predefined/LastAttributedTouchEvent.d.ts +4 -4
  203. package/lib/typescript/events/predefined/ListViewEvent.d.ts +4 -4
  204. package/lib/typescript/events/predefined/LoginEvent.d.ts +4 -4
  205. package/lib/typescript/events/predefined/OpenedFromPushNotificationEvent.d.ts +4 -4
  206. package/lib/typescript/events/predefined/PurchaseEvent.d.ts +4 -4
  207. package/lib/typescript/events/predefined/RateEvent.d.ts +4 -4
  208. package/lib/typescript/events/predefined/ReEngageEvent.d.ts +4 -4
  209. package/lib/typescript/events/predefined/ReserveEvent.d.ts +4 -4
  210. package/lib/typescript/events/predefined/SalesEvent.d.ts +4 -4
  211. package/lib/typescript/events/predefined/SearchEvent.d.ts +4 -4
  212. package/lib/typescript/events/predefined/ShareEvent.d.ts +4 -4
  213. package/lib/typescript/events/predefined/SpendCreditsEvent.d.ts +4 -4
  214. package/lib/typescript/events/predefined/StartRegistrationEvent.d.ts +4 -4
  215. package/lib/typescript/events/predefined/StartTrialEvent.d.ts +4 -4
  216. package/lib/typescript/events/predefined/StartTutorialEvent.d.ts +4 -4
  217. package/lib/typescript/events/predefined/SubscribeEvent.d.ts +4 -4
  218. package/lib/typescript/events/predefined/TravelBookingEvent.d.ts +4 -4
  219. package/lib/typescript/events/predefined/UnlockAchievementEvent.d.ts +4 -4
  220. package/lib/typescript/events/predefined/UnsubscribeEvent.d.ts +4 -4
  221. package/lib/typescript/events/predefined/UpdateEvent.d.ts +4 -4
  222. package/lib/typescript/events/predefined/ViewAdvEvent.d.ts +4 -4
  223. package/lib/typescript/events/predefined/ViewCartEvent.d.ts +4 -4
  224. package/lib/typescript/events/predefined/ViewItemEvent.d.ts +4 -4
  225. package/lib/typescript/events/predefined/ViewItemsEvent.d.ts +4 -4
  226. package/lib/typescript/events/subscription/BaseSubscriptionEvent.d.ts +13 -13
  227. package/lib/typescript/events/subscription/ConvertedOfferEvent.d.ts +4 -4
  228. package/lib/typescript/events/subscription/ConvertedOfferFromRetryEvent.d.ts +4 -4
  229. package/lib/typescript/events/subscription/ConvertedTrialEvent.d.ts +4 -4
  230. package/lib/typescript/events/subscription/ConvertedTrialFromRetryEvent.d.ts +4 -4
  231. package/lib/typescript/events/subscription/FailedOfferFromRetryEvent.d.ts +4 -4
  232. package/lib/typescript/events/subscription/FailedOfferiseEvent.d.ts +4 -4
  233. package/lib/typescript/events/subscription/FailedSubscriptionEvent.d.ts +4 -4
  234. package/lib/typescript/events/subscription/FailedSubscriptionFromRetryEvent.d.ts +4 -4
  235. package/lib/typescript/events/subscription/FailedTrialEvent.d.ts +4 -4
  236. package/lib/typescript/events/subscription/FailedTrialFromRetryEvent.d.ts +4 -4
  237. package/lib/typescript/events/subscription/InitialOfferEvent.d.ts +4 -4
  238. package/lib/typescript/events/subscription/InitialSubscriptionEvent.d.ts +4 -4
  239. package/lib/typescript/events/subscription/InitialTrialEvent.d.ts +4 -4
  240. package/lib/typescript/events/subscription/OfferInRetryEvent.d.ts +4 -4
  241. package/lib/typescript/events/subscription/ReactivatedSubscriptionEvent.d.ts +4 -4
  242. package/lib/typescript/events/subscription/RenewedSubscriptionEvent.d.ts +4 -4
  243. package/lib/typescript/events/subscription/RenewedSubscriptionFromRetryEvent.d.ts +4 -4
  244. package/lib/typescript/events/subscription/SubscriptionInRetryEvent.d.ts +4 -4
  245. package/lib/typescript/events/subscription/SubscriptionParameters.d.ts +31 -31
  246. package/lib/typescript/events/subscription/TrialInRetryEvent.d.ts +4 -4
  247. package/lib/typescript/events/subscription/UnsubscriptionEvent.d.ts +4 -4
  248. package/lib/typescript/index.d.ts +107 -107
  249. package/lib/typescript/index.d.ts.map +1 -1
  250. package/lib/typescript/referrer/ReferrerKey.d.ts +32 -32
  251. package/package.json +163 -163
  252. package/src/index.tsx +237 -237
package/README.md CHANGED
@@ -1,668 +1,705 @@
1
- # Affise Attribution React Native library
2
-
3
- - [Affise Attribution React Native library](#affise-attribution-react-native-library)
4
- - [Description](#description)
5
- - [Quick start](#quick-start)
6
- - [Integration](#integration)
7
- - [Integrate npm package](#integrate-npm-package)
8
- - [Initialize](#initialize)
9
- - [Requirements](#requirements)
10
- - [Android](#android)
11
- - [Features](#features)
12
- - [Device identifiers collection](#device-identifiers-collection)
13
- - [Events tracking](#events-tracking)
14
- - [Custom events tracking](#custom-events-tracking)
15
- - [Predefined event parameters](#predefined-event-parameters)
16
- - [Events buffering](#events-buffering)
17
- - [Advertising Identifier (google) tracking](#advertising-identifier-google-tracking)
18
- - [Open Advertising Identifier (huawei) tracking](#open-advertising-identifier-huawei-tracking)
19
- - [Install referrer tracking](#install-referrer-tracking)
20
- - [Push token tracking](#push-token-tracking)
21
- - [Reinstall Uninstall tracking](#reinstall-uninstall-tracking)
22
- - [APK preinstall tracking](#apk-preinstall-tracking)
23
- - [Deeplinks](#deeplinks)
24
- - [Android](#android-1)
25
- - [iOS](#ios)
26
- - [Offline mode](#offline-mode)
27
- - [Disable tracking](#disable-tracking)
28
- - [Disable background tracking](#disable-background-tracking)
29
- - [GDPR right to be forgotten](#gdpr-right-to-be-forgotten)
30
- - [Platform specific](#platform-specific)
31
- - [Get referrer](#get-referrer)
32
- - [Get referrer value](#get-referrer-value)
33
- - [SKAd](#skad)
34
-
35
- # Description
36
-
37
- Affise SDK is a software you can use to collect app usage statistics, device identifiers, deeplink usage, track install
38
- referrer.
39
-
40
- ## Quick start
41
-
42
- ## Integration
43
-
44
- ### Integrate npm package
45
-
46
- This is a [Node.js](https://nodejs.org/en/) module available through the
47
- [npm registry](https://www.npmjs.com/).
48
-
49
- Installation using npm
50
-
51
- ```console
52
- npm install affise-attribution-lib
53
- ```
54
-
55
- Installation using yarn
56
-
57
- ```console
58
- yarn add affise-attribution-lib
59
- ```
60
-
61
- #### Add platform modules
62
-
63
- ##### Android
64
-
65
- Add modules to android project
66
-
67
- Example `example/android/app/build.gradle`
68
-
69
- ```gradle
70
- dependencies {
71
- // Affise modules
72
- implementation 'com.affise:module-advertising:1.5.4'
73
- implementation 'com.affise:module-network:1.5.4'
74
- implementation 'com.affise:module-phone:1.5.4'
75
- }
76
- ```
77
-
78
- ### Initialize
79
-
80
- After dependency is added, and project is sync with `npm install` and initialize.
81
-
82
- ```typescript
83
- import {
84
- Affise,
85
- AffiseInitProperties
86
- } from 'affise-attribution-lib';
87
-
88
-
89
- export default function App() {
90
-
91
- React.useEffect(() => {
92
- Affise.init(
93
- new AffiseInitProperties(
94
- 'Your appId', //Change to your app id
95
- true, //Add your custom rule to determine if this is a production build
96
- null, //Change to your partParamName
97
- null, //Change to your partParamNameToken
98
- null, //Change to your appToken
99
- 'Your secretId' //Change to your secretId
100
- )
101
- );
102
- });
103
-
104
- return (
105
- <SafeAreaView>
106
- </SafeAreaView>
107
- );
108
- }
109
- ```
110
-
111
-
112
- ### Requirements
113
-
114
- #### Android
115
-
116
- Minimal Android SDK version is 21
117
-
118
- For a minimal working functionality your app needs to declare internet permission:
119
-
120
- ```xml
121
- <manifest>
122
- <uses-permission android:name="android.permission.INTERNET"/>
123
- </manifest>
124
- ```
125
-
126
- OAID certificate in your project (Optional)
127
- `example/android/app/src/main/assets/oaid.cert.pem`
128
-
129
- # Features
130
-
131
- ### Device identifiers collection
132
-
133
- To match users with events and data library is sending, these identifiers are collected:
134
-
135
- - `AFFISE_APP_ID`
136
- - `AFFISE_PKG_APP_NAME`
137
- - `AFFISE_APP_NAME_DASHBOARD`
138
- - `APP_VERSION`
139
- - `APP_VERSION_RAW`
140
- - `STORE`
141
- - `TRACKER_TOKEN`
142
- - `TRACKER_NAME`
143
- - `FIRST_TRACKER_TOKEN`
144
- - `FIRST_TRACKER_NAME`
145
- - `LAST_TRACKER_TOKEN`
146
- - `LAST_TRACKER_NAME`
147
- - `OUTDATED_TRACKER_TOKEN`
148
- - `INSTALLED_TIME`
149
- - `FIRST_OPEN_TIME`
150
- - `INSTALLED_HOUR`
151
- - `FIRST_OPEN_HOUR`
152
- - `INSTALL_BEGIN_TIME`
153
- - `INSTALL_FINISH_TIME`
154
- - `REFERRAL_TIME`
155
- - `CREATED_TIME`
156
- - `CREATED_TIME_MILLI`
157
- - `CREATED_TIME_HOUR`
158
- - `UNINSTALL_TIME`
159
- - `REINSTALL_TIME`
160
- - `LAST_SESSION_TIME`
161
- - `CONNECTION_TYPE`
162
- - `CPU_TYPE`
163
- - `HARDWARE_NAME`
164
- - `NETWORK_TYPE`
165
- - `DEVICE_MANUFACTURER`
166
- - `PROXY_IP_ADDRESS`
167
- - `DEEPLINK_CLICK`
168
- - `DEVICE_ATLAS_ID`
169
- - `AFFISE_DEVICE_ID`
170
- - `AFFISE_ALT_DEVICE_ID`
171
- - `ADID`
172
- - `ANDROID_ID`
173
- - `ANDROID_ID_MD5`
174
- - `MAC_SHA1`
175
- - `MAC_MD5`
176
- - `GAID_ADID`
177
- - `GAID_ADID_MD5`
178
- - `OAID`
179
- - `OAID_MD5`
180
- - `REFTOKEN`
181
- - `REFTOKENS`
182
- - `REFERRER`
183
- - `USER_AGENT`
184
- - `MCCODE`
185
- - `MNCODE`
186
- - `ISP`
187
- - `REGION`
188
- - `COUNTRY`
189
- - `LANGUAGE`
190
- - `DEVICE_NAME`
191
- - `DEVICE_TYPE`
192
- - `OS_NAME`
193
- - `PLATFORM`
194
- - `API_LEVEL_OS`
195
- - `AFFISE_SDK_VERSION`
196
- - `OS_VERSION`
197
- - `RANDOM_USER_ID`
198
- - `AFFISE_SDK_POS`
199
- - `TIMEZONE_DEV`
200
- - `LAST_TIME_SESSION`
201
- - `TIME_SESSION`
202
- - `AFFISE_SESSION_COUNT`
203
- - `LIFETIME_SESSION_COUNT`
204
- - `AFFISE_DEEPLINK`
205
- - `AFFISE_PART_PARAM_NAME`
206
- - `AFFISE_PART_PARAM_NAME_TOKEN`
207
- - `AFFISE_APP_TOKEN`
208
- - `LABEL`
209
- - `AFFISE_SDK_SECRET_ID`
210
- - `UUID`
211
- - `AFFISE_APP_OPENED`
212
- - `PUSHTOKEN`
213
- - `EVENTS`
214
- - `AFFISE_EVENTS_COUNT`
215
-
216
- ### Events tracking
217
-
218
- For example, we want to track what items usually user adds to shopping cart. To send event first create it with
219
- following code
220
-
221
- ```typescript
222
- import { Affise, AddToCartEvent } from 'affise-attribution-lib';
223
-
224
- class Presenter {
225
- onUserAddsItemsToCart(item: string) {
226
- const items = {
227
- items: 'cookies, potato, milk',
228
- };
229
-
230
- Affise.sendEvent(new AddToCartEvent(items, Date.now(), 'groceries'));
231
- }
232
- }
233
- ```
234
-
235
- With above example you can implement other events:
236
-
237
- - `AchieveLevelEvent`
238
- - `AddPaymentInfoEvent`
239
- - `AddToCartEvent`
240
- - `AddToWishlistEvent`
241
- - `ClickAdvEvent`
242
- - `CompleteRegistrationEvent`
243
- - `CompleteStreamEvent`
244
- - `CompleteTrialEvent`
245
- - `CompleteTutorialEvent`
246
- - `ContentItemsViewEvent`
247
- - `DeepLinkedEvent`
248
- - `InitiatePurchaseEvent`
249
- - `InitiateStreamEvent`
250
- - `InviteEvent`
251
- - `LastAttributedTouchEvent`
252
- - `ListViewEvent`
253
- - `LoginEvent`
254
- - `OpenedFromPushNotificationEvent`
255
- - `PurchaseEvent`
256
- - `RateEvent`
257
- - `ReEngageEvent`
258
- - `ReserveEvent`
259
- - `SalesEvent`
260
- - `SearchEvent`
261
- - `ShareEvent`
262
- - `SpendCreditsEvent`
263
- - `StartRegistrationEvent`
264
- - `StartTrialEvent`
265
- - `StartTutorialEvent`
266
- - `SubscribeEvent`
267
- - `TravelBookingEvent`
268
- - `UnlockAchievementEvent`
269
- - `UnsubscribeEvent`
270
- - `UnsubscriptionEvent`
271
- - `UpdateEvent`
272
- - `ViewAdvEvent`
273
- - `ViewCartEvent`
274
- - `ViewItemEvent`
275
- - `ViewItemsEvent`
276
-
277
- ### Custom events tracking
278
-
279
- Use any of custom events if default doesn't fit your scenario:
280
-
281
- - `CustomId01Event`
282
- - `CustomId02Event`
283
- - `CustomId03Event`
284
- - `CustomId04Event`
285
- - `CustomId05Event`
286
- - `CustomId06Event`
287
- - `CustomId07Event`
288
- - `CustomId08Event`
289
- - `CustomId09Event`
290
- - `CustomId10Event`
291
-
292
- ### Predefined event parameters
293
-
294
- To enrich your event with another dimension, you can use predefined parameters for most common cases.
295
- Add it to any event:
296
-
297
- ```typescript
298
- import {
299
- Affise,
300
- AddToCartEvent,
301
- PredefinedParameters,
302
- } from 'affise-attribution-lib';
303
-
304
- class Presenter {
305
- onUserAddsItemsToCart(item: string) {
306
- const items = {
307
- items: 'cookies, potato, milk',
308
- };
309
-
310
- const event = new AddToCartEvent(items, Date.now());
311
-
312
- event.addPredefinedParameter(
313
- PredefinedParameters.DESCRIPTION,
314
- 'best before 2029'
315
- );
316
-
317
- Affise.sendEvent(event);
318
- }
319
- }
320
- ```
321
-
322
- In examples above `PredefinedParameters.DESCRIPTION` is used, but many others is available:
323
-
324
- - `ADREV_AD_TYPE`
325
- - `CITY`
326
- - `COUNTRY`
327
- - `REGION`
328
- - `CLASS`
329
- - `CONTENT`
330
- - `CONTENT_ID`
331
- - `CONTENT_LIST`
332
- - `CONTENT_TYPE`
333
- - `CURRENCY`
334
- - `CUSTOMER_USER_ID`
335
- - `DATE_A`
336
- - `DATE_B`
337
- - `DEPARTING_ARRIVAL_DATE`
338
- - `DEPARTING_DEPARTURE_DATE`
339
- - `DESCRIPTION`
340
- - `DESTINATION_A`
341
- - `DESTINATION_B`
342
- - `DESTINATION_LIST`
343
- - `HOTEL_SCORE`
344
- - `LEVEL`
345
- - `MAX_RATING_VALUE`
346
- - `NUM_ADULTS`
347
- - `NUM_CHILDREN`
348
- - `NUM_INFANTS`
349
- - `ORDER_ID`
350
- - `PAYMENT_INFO_AVAILABLE`
351
- - `PREFERRED_NEIGHBORHOODS`
352
- - `PREFERRED_NUM_STOPS`
353
- - `PREFERRED_PRICE_RANGE`
354
- - `PREFERRED_STAR_RATINGS`
355
- - `PRICE`
356
- - `PURCHASE_CURRENCY`
357
- - `QUANTITY`
358
- - `RATING_VALUE`
359
- - `RECEIPT_ID`
360
- - `REGISTRATION_METHOD`
361
- - `RETURNING_ARRIVAL_DATE`
362
- - `RETURNING_DEPARTURE_DATE`
363
- - `REVENUE`
364
- - `SCORE`
365
- - `SEARCH_STRING`
366
- - `SUBSCRIPTION_ID`
367
- - `SUCCESS`
368
- - `SUGGESTED_DESTINATIONS`
369
- - `SUGGESTED_HOTELS`
370
- - `TRAVEL_START`
371
- - `TRAVEL_END`
372
- - `USER_SCORE`
373
- - `VALIDATED`
374
- - `ACHIEVEMENT_ID`
375
- - `COUPON_CODE`
376
- - `CUSTOMER_SEGMENT`
377
- - `DEEP_LINK`
378
- - `EVENT_START`
379
- - `EVENT_END`
380
- - `LAT`
381
- - `LONG`
382
- - `NEW_VERSION`
383
- - `OLD_VERSION`
384
- - `REVIEW_TEXT`
385
- - `TUTORIAL_ID`
386
- - `VIRTUAL_CURRENCY_NAME`
387
- - `PARAM_01`
388
- - `PARAM_02`
389
- - `PARAM_03`
390
- - `PARAM_04`
391
- - `PARAM_05`
392
- - `PARAM_06`
393
- - `PARAM_07`
394
- - `PARAM_08`
395
- - `PARAM_09`
396
-
397
- ### Events buffering
398
-
399
- Affise library will send any pending events with first opportunity,
400
- but if there is no network connection or device is disabled, events are kept locally for 7 days before deletion.
401
-
402
- ### Advertising Identifier (google) tracking
403
-
404
- Advertising Identifier (google) tracking is supported automatically, no actions needed
405
-
406
- ### Open Advertising Identifier (huawei) tracking
407
-
408
- Open Advertising Identifier is supported automatically, no actions needed
409
-
410
- ### Install referrer tracking
411
-
412
- Install referrer tracking is supported automatically, no actions needed
413
-
414
- ### Push token tracking
415
-
416
- To let affise track push token you need to receive it from your push service provider, and pass to Affise library.
417
- First add firebase integration to your app completing theese steps: https://firebase.google.com/docs/cloud-messaging/android/client
418
-
419
- After you have done with firebase inegration, add to your cloud messaging service `onNewToken` method `Affise.addPushToken(token)`
420
-
421
- ```typescript
422
- import { Affise } from 'affise-attribution-lib';
423
- import messaging from '@react-native-firebase/messaging';
424
-
425
- const getToken = async () => {
426
- const token = await messaging().getToken();
427
- if (token) {
428
- Affise.addPushToken(token);
429
- }
430
- };
431
- ```
432
-
433
- ### Reinstall Uninstall tracking
434
-
435
- Affise automatically track reinstall events by using silent-push technology, to make this feature work, pass push token when it is recreated by user and on you application starts up
436
-
437
- ```typescript
438
- Affise.addPushToken(token);
439
- ```
440
-
441
- ### APK preinstall tracking
442
-
443
- SDK is also supports scenario when APK is installed not from one of application markets, such as google play, huawei appgallery or amazon appstore
444
- To use this feature, create file with name `partner_key` in your app assets directory, and write unique identifier inside, this key will be passed to our backend so you can track events by partner later in your Affise console.
445
-
446
- ### Deeplinks
447
-
448
- Register deeplink callback right after Affise.init(..)
449
-
450
- ```typescript
451
- Affise.init(..);
452
- Affise.registerDeeplinkCallback((uri) => {
453
-
454
- });
455
- ```
456
-
457
- #### Android
458
-
459
- To integrate deeplink support in android you need:
460
-
461
- Add intent filter to `AndroidManifest.xml` as in `example/android/app/src/main/AndroidManifest.xml`,
462
-
463
- ```xml
464
- <intent-filter android:autoVerify="true">
465
- <action android:name="android.intent.action.VIEW" />
466
-
467
- <category android:name="android.intent.category.DEFAULT" />
468
- <category android:name="android.intent.category.BROWSABLE" />
469
-
470
- <data
471
- android:host="YOUR_AFFISE_APP_ID.affattr.com"
472
- android:scheme="react" />
473
- </intent-filter>
474
- ```
475
-
476
- #### iOS
477
-
478
- To integrate deeplink support in iOS you need:
479
-
480
- Add deeplink handler to `AppDelegate.mm` as in `example/ios/AffiseAttributionLibExample/AppDelegate.mm`
481
- - [React Docs](https://reactnavigation.org/docs/deep-linking/#set-up-with-bare-react-native-projects)
482
-
483
- ```objective-c
484
- - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
485
- sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
486
- {
487
- return [RCTLinkingManager application:application openURL:url
488
- sourceApplication:sourceApplication annotation:annotation];
489
- }
490
- ```
491
-
492
- Add key `CFBundleURLTypes` to `Info.plist` as in `example/ios/AffiseAttributionLibExample/Info.plist`
493
-
494
- ```html
495
- <key>CFBundleURLTypes</key>
496
- <array>
497
- <dict>
498
- <key>CFBundleTypeRole</key>
499
- <string>Editor</string>
500
- <key>CFBundleURLName</key>
501
- <string>YOUR_AFFISE_APP_ID.affattr.com</string>
502
- <key>CFBundleURLSchemes</key>
503
- <array>
504
- <string>react</string>
505
- </array>
506
- </dict>
507
- </array>
508
- ```
509
-
510
- ### Offline mode
511
-
512
- In some scenarious you would want to limit Affise network usage, to pause that activity call anywhere in your application following code after Affise init:
513
-
514
- ```typescript
515
- Affise.init(..);
516
- Affise.setOfflineModeEnabled(true); // to enable offline mode
517
- Affise.setOfflineModeEnabled(false); // to disable offline mode
518
- ```
519
-
520
- While offline mode is enabled, your metrics and other events are kept locally, and will be delivered once offline mode is disabled.
521
- Offline mode is persistent as Application lifecycle, and will be disabled with process termination automaticly.
522
- To check current offline mode status call:
523
-
524
- ```typescript
525
- Affise.isOfflineModeEnabled(); // returns true or false describing current tracking state
526
- ```
527
-
528
- ### Disable tracking
529
-
530
- To disable any tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise init:
531
-
532
- ```typescript
533
- Affise.init(..);
534
- Affise.setTrackingEnabled(true); // to enable tracking
535
- Affise.setTrackingEnabled(false); // to disable tracking
536
- ```
537
-
538
- By default tracking is enabled.
539
-
540
- While tracking mode is disabled, metrics and other identifiers is not generated locally.
541
- Keep in mind that this flag is persistent until app reinstall, and don't forget to reactivate tracking when needed.
542
- To check current status of tracking call:
543
-
544
- ```typescript
545
- Affise.isTrackingEnabled().then((enabled) => {
546
- // returns true or false describing current tracking state
547
- });
548
- ```
549
-
550
- ### Disable background tracking
551
-
552
- To disable any background tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise init:
553
-
554
- ```typescript
555
- Affise.init(..);
556
- Affise.setBackgroundTrackingEnabled(true); // to enable background tracking
557
- Affise.setBackgroundTrackingEnabled(false); // to disable background tracking
558
- ```
559
-
560
- By default background tracking is enabled.
561
-
562
- While background tracking mode is disabled, metrics and other identifiers is not generated locally.
563
- Background tracking mode is persistent as Application lifecycle, and will be re-enabled with process termination automatically.
564
- To check current status of background tracking call:
565
-
566
- ```typescript
567
- Affise.isBackgroundTrackingEnabled().then((enabled) => {
568
- // returns true or false describing current background tracking state
569
- });
570
- ```
571
-
572
- ### GDPR right to be forgotten
573
-
574
- Under the EU's General Data Protection Regulation (GDPR): An individual has the right to have their personal data erased.
575
- To provide this functionality to user, as the app developer, you can call
576
-
577
- ```typescript
578
- Affise.init(..);
579
- Affise.forget(); // to forget users data
580
- ```
581
-
582
- After processing such request our backend servers will delete all users data.
583
- To prevent library from generating new events, disable tracking just before calling Affise.forget:
584
-
585
- ```typescript
586
- Affise.init(..);
587
- Affise.setTrackingEnabled(false);
588
- Affise.forget(); // to forget users data
589
- ```
590
-
591
-
592
- ### Platform specific
593
-
594
- ### Get referrer
595
- > `Android Only`
596
-
597
- Use the next public method of SDK
598
-
599
- ```typescript
600
- Affise.getReferrer().then((referrer) => {
601
- // returns referrer
602
- });
603
- ```
604
-
605
- #### Get referrer value
606
- > `Android Only`
607
-
608
- Use the next public method of SDK to get referrer value by
609
-
610
- ```typescript
611
- Affise.android.getReferrerValue(ReferrerKey.CLICK_ID, (value) => {
612
-
613
- })
614
- ```
615
-
616
- #### Referrer keys
617
-
618
- In examples above `ReferrerKey.CLICK_ID` is used, but many others is available:
619
-
620
- - `AD_ID`
621
- - `CAMPAIGN_ID`
622
- - `CLICK_ID`
623
- - `AFFISE_AD`
624
- - `AFFISE_AD_ID`
625
- - `AFFISE_AD_TYPE`
626
- - `AFFISE_ADSET`
627
- - `AFFISE_ADSET_ID`
628
- - `AFFISE_AFFC_ID`
629
- - `AFFISE_CHANNEL`
630
- - `AFFISE_CLICK_LOOK_BACK`
631
- - `AFFISE_COST_CURRENCY`
632
- - `AFFISE_COST_MODEL`
633
- - `AFFISE_COST_VALUE`
634
- - `AFFISE_DEEPLINK`
635
- - `AFFISE_KEYWORDS`
636
- - `AFFISE_MEDIA_TYPE`
637
- - `AFFISE_MODEL`
638
- - `AFFISE_OS`
639
- - `AFFISE_PARTNER`
640
- - `AFFISE_REF`
641
- - `AFFISE_SITE_ID`
642
- - `AFFISE_SUB_SITE_ID`
643
- - `AFFC`
644
- - `PID`
645
- - `SUB_1`
646
- - `SUB_2`
647
- - `SUB_3`
648
- - `SUB_4`
649
- - `SUB_5`
650
-
651
-
652
- #### SKAd
653
- > `iOS Only`
654
-
655
- For ios prior `16.1` first call
656
- ```typescript
657
- Affise.ios.registerAppForAdNetworkAttribution((error) => {
658
-
659
- });
660
- ```
661
-
662
- Updates the fine and coarse conversion values, and calls a completion handler if the update fails.
663
- Second argument coarseValue is available in iOS 16.1+
664
- ```typescript
665
- Affise.ios.updatePostbackConversionValue(1, "medium", (error) => {
666
-
667
- });
668
- ```
1
+ # Affise Attribution React Native library
2
+
3
+ <p align="left">
4
+ <a href="https://www.npmjs.com/package/affise-attribution-lib" alt="npm package">
5
+ <img src="https://img.shields.io/npm/v/affise-attribution-lib?label=affise-attribution-lib" />
6
+ </a>
7
+ </p>
8
+
9
+ - [Affise Attribution React Native library](#affise-attribution-react-native-library)
10
+ - [Description](#description)
11
+ - [Quick start](#quick-start)
12
+ - [Integration](#integration)
13
+ - [Integrate npm package](#integrate-npm-package)
14
+ - [Add platform modules](#add-platform-modules)
15
+ - [Android](#android)
16
+ - [Initialize](#initialize)
17
+ - [Requirements](#requirements)
18
+ - [Android](#android-1)
19
+ - [Features](#features)
20
+ - [Device identifiers collection](#device-identifiers-collection)
21
+ - [Events tracking](#events-tracking)
22
+ - [Custom events tracking](#custom-events-tracking)
23
+ - [Predefined event parameters](#predefined-event-parameters)
24
+ - [Events buffering](#events-buffering)
25
+ - [Advertising Identifier (google) tracking](#advertising-identifier-google-tracking)
26
+ - [Open Advertising Identifier (huawei) tracking](#open-advertising-identifier-huawei-tracking)
27
+ - [Install referrer tracking](#install-referrer-tracking)
28
+ - [Push token tracking](#push-token-tracking)
29
+ - [Reinstall Uninstall tracking](#reinstall-uninstall-tracking)
30
+ - [APK preinstall tracking](#apk-preinstall-tracking)
31
+ - [Deeplinks](#deeplinks)
32
+ - [Android](#android-2)
33
+ - [iOS](#ios)
34
+ - [Offline mode](#offline-mode)
35
+ - [Disable tracking](#disable-tracking)
36
+ - [Disable background tracking](#disable-background-tracking)
37
+ - [GDPR right to be forgotten](#gdpr-right-to-be-forgotten)
38
+ - [Platform specific](#platform-specific)
39
+ - [Get referrer](#get-referrer)
40
+ - [Get referrer value](#get-referrer-value)
41
+ - [Referrer keys](#referrer-keys)
42
+ - [StoreKit Ad Network](#storekit-ad-network)
43
+
44
+ # Description
45
+
46
+ Affise SDK is a software you can use to collect app usage statistics, device identifiers, deeplink usage, track install
47
+ referrer.
48
+
49
+ ## Quick start
50
+
51
+ ## Integration
52
+
53
+ ### Integrate npm package
54
+
55
+ This is a [Node.js](https://nodejs.org/en/) module available through the
56
+ [npm registry](https://www.npmjs.com/).
57
+
58
+ Installation using npm
59
+
60
+ ```console
61
+ npm install affise-attribution-lib
62
+ ```
63
+
64
+ Installation using yarn
65
+
66
+ ```console
67
+ yarn add affise-attribution-lib
68
+ ```
69
+
70
+ ### Add platform modules
71
+
72
+ #### Android
73
+
74
+ Add modules to android project
75
+
76
+ | Module | Version |
77
+ | ------ | ------- |
78
+ | module-advertising | <a href="https://mvnrepository.com/artifact/com.affise/module-advertising"><img src="https://img.shields.io/maven-central/v/com.affise/module-advertising?label=latest" alt="version" /></a> |
79
+ | module-network | <a href="https://mvnrepository.com/artifact/com.affise/module-network"><img src="https://img.shields.io/maven-central/v/com.affise/module-network?label=latest" alt="version" /></a> |
80
+ | module-phone | <a href="https://mvnrepository.com/artifact/com.affise/module-phone"><img src="https://img.shields.io/maven-central/v/com.affise/module-phone?label=latest" alt="version" /></a> |
81
+
82
+ Example `example/android/app/build.gradle`
83
+
84
+ ```gradle
85
+ dependencies {
86
+ // Affise modules
87
+ implementation 'com.affise:module-advertising:1.5.+'
88
+ implementation 'com.affise:module-network:1.5.+'
89
+ implementation 'com.affise:module-phone:1.5.+'
90
+ }
91
+ ```
92
+
93
+ ### Initialize
94
+
95
+ After dependency is added, and project is sync with `npm install` and initialize.
96
+
97
+ ```typescript
98
+ import {
99
+ Affise,
100
+ AffiseInitProperties
101
+ } from 'affise-attribution-lib';
102
+
103
+
104
+ export default function App() {
105
+
106
+ React.useEffect(() => {
107
+ Affise.init(
108
+ new AffiseInitProperties(
109
+ 'Your appId', //Change to your app id
110
+ true, //Add your custom rule to determine if this is a production build
111
+ null, //Change to your partParamName
112
+ null, //Change to your partParamNameToken
113
+ null, //Change to your appToken
114
+ 'Your secretId' //Change to your secretId
115
+ )
116
+ );
117
+ });
118
+
119
+ return (
120
+ <SafeAreaView>
121
+ </SafeAreaView>
122
+ );
123
+ }
124
+ ```
125
+
126
+ ### Requirements
127
+
128
+ #### Android
129
+
130
+ Minimal Android SDK version is 21
131
+
132
+ For a minimal working functionality your app needs to declare internet permission:
133
+
134
+ ```xml
135
+ <manifest>
136
+ <uses-permission android:name="android.permission.INTERNET"/>
137
+ </manifest>
138
+ ```
139
+
140
+ OAID certificate in your project (Optional)
141
+ `example/android/app/src/main/assets/oaid.cert.pem`
142
+
143
+ # Features
144
+
145
+ ## Device identifiers collection
146
+
147
+ To match users with events and data library is sending, these identifiers are collected:
148
+
149
+ - `AFFISE_APP_ID`
150
+ - `AFFISE_PKG_APP_NAME`
151
+ - `AFFISE_APP_NAME_DASHBOARD`
152
+ - `APP_VERSION`
153
+ - `APP_VERSION_RAW`
154
+ - `STORE`
155
+ - `TRACKER_TOKEN`
156
+ - `TRACKER_NAME`
157
+ - `FIRST_TRACKER_TOKEN`
158
+ - `FIRST_TRACKER_NAME`
159
+ - `LAST_TRACKER_TOKEN`
160
+ - `LAST_TRACKER_NAME`
161
+ - `OUTDATED_TRACKER_TOKEN`
162
+ - `INSTALLED_TIME`
163
+ - `FIRST_OPEN_TIME`
164
+ - `INSTALLED_HOUR`
165
+ - `FIRST_OPEN_HOUR`
166
+ - `INSTALL_BEGIN_TIME`
167
+ - `INSTALL_FINISH_TIME`
168
+ - `REFERRAL_TIME`
169
+ - `CREATED_TIME`
170
+ - `CREATED_TIME_MILLI`
171
+ - `CREATED_TIME_HOUR`
172
+ - `UNINSTALL_TIME`
173
+ - `REINSTALL_TIME`
174
+ - `LAST_SESSION_TIME`
175
+ - `CONNECTION_TYPE`
176
+ - `CPU_TYPE`
177
+ - `HARDWARE_NAME`
178
+ - `NETWORK_TYPE`
179
+ - `DEVICE_MANUFACTURER`
180
+ - `PROXY_IP_ADDRESS`
181
+ - `DEEPLINK_CLICK`
182
+ - `DEVICE_ATLAS_ID`
183
+ - `AFFISE_DEVICE_ID`
184
+ - `AFFISE_ALT_DEVICE_ID`
185
+ - `ADID`
186
+ - `ANDROID_ID`
187
+ - `ANDROID_ID_MD5`
188
+ - `MAC_SHA1`
189
+ - `MAC_MD5`
190
+ - `GAID_ADID`
191
+ - `GAID_ADID_MD5`
192
+ - `OAID`
193
+ - `OAID_MD5`
194
+ - `REFTOKEN`
195
+ - `REFTOKENS`
196
+ - `REFERRER`
197
+ - `USER_AGENT`
198
+ - `MCCODE`
199
+ - `MNCODE`
200
+ - `ISP`
201
+ - `REGION`
202
+ - `COUNTRY`
203
+ - `LANGUAGE`
204
+ - `DEVICE_NAME`
205
+ - `DEVICE_TYPE`
206
+ - `OS_NAME`
207
+ - `PLATFORM`
208
+ - `API_LEVEL_OS`
209
+ - `AFFISE_SDK_VERSION`
210
+ - `OS_VERSION`
211
+ - `RANDOM_USER_ID`
212
+ - `AFFISE_SDK_POS`
213
+ - `TIMEZONE_DEV`
214
+ - `LAST_TIME_SESSION`
215
+ - `TIME_SESSION`
216
+ - `AFFISE_SESSION_COUNT`
217
+ - `LIFETIME_SESSION_COUNT`
218
+ - `AFFISE_DEEPLINK`
219
+ - `AFFISE_PART_PARAM_NAME`
220
+ - `AFFISE_PART_PARAM_NAME_TOKEN`
221
+ - `AFFISE_APP_TOKEN`
222
+ - `LABEL`
223
+ - `AFFISE_SDK_SECRET_ID`
224
+ - `UUID`
225
+ - `AFFISE_APP_OPENED`
226
+ - `PUSHTOKEN`
227
+ - `EVENTS`
228
+ - `AFFISE_EVENTS_COUNT`
229
+
230
+ ## Events tracking
231
+
232
+ For example, we want to track what items usually user adds to shopping cart. To send event first create it with
233
+ following code
234
+
235
+ ```typescript
236
+ import { Affise, AddToCartEvent } from 'affise-attribution-lib';
237
+
238
+ class Presenter {
239
+ onUserAddsItemsToCart(item: string) {
240
+ const items = {
241
+ items: 'cookies, potato, milk',
242
+ };
243
+
244
+ Affise.sendEvent(new AddToCartEvent(items, Date.now(), 'groceries'));
245
+ }
246
+ }
247
+ ```
248
+
249
+ With above example you can implement other events:
250
+
251
+ - `AchieveLevelEvent`
252
+ - `AddPaymentInfoEvent`
253
+ - `AddToCartEvent`
254
+ - `AddToWishlistEvent`
255
+ - `ClickAdvEvent`
256
+ - `CompleteRegistrationEvent`
257
+ - `CompleteStreamEvent`
258
+ - `CompleteTrialEvent`
259
+ - `CompleteTutorialEvent`
260
+ - `ContentItemsViewEvent`
261
+ - `DeepLinkedEvent`
262
+ - `InitiatePurchaseEvent`
263
+ - `InitiateStreamEvent`
264
+ - `InviteEvent`
265
+ - `LastAttributedTouchEvent`
266
+ - `ListViewEvent`
267
+ - `LoginEvent`
268
+ - `OpenedFromPushNotificationEvent`
269
+ - `PurchaseEvent`
270
+ - `RateEvent`
271
+ - `ReEngageEvent`
272
+ - `ReserveEvent`
273
+ - `SalesEvent`
274
+ - `SearchEvent`
275
+ - `ShareEvent`
276
+ - `SpendCreditsEvent`
277
+ - `StartRegistrationEvent`
278
+ - `StartTrialEvent`
279
+ - `StartTutorialEvent`
280
+ - `SubscribeEvent`
281
+ - `TravelBookingEvent`
282
+ - `UnlockAchievementEvent`
283
+ - `UnsubscribeEvent`
284
+ - `UnsubscriptionEvent`
285
+ - `UpdateEvent`
286
+ - `ViewAdvEvent`
287
+ - `ViewCartEvent`
288
+ - `ViewItemEvent`
289
+ - `ViewItemsEvent`
290
+
291
+ ## Custom events tracking
292
+
293
+ Use any of custom events if default doesn't fit your scenario:
294
+
295
+ - `CustomId01Event`
296
+ - `CustomId02Event`
297
+ - `CustomId03Event`
298
+ - `CustomId04Event`
299
+ - `CustomId05Event`
300
+ - `CustomId06Event`
301
+ - `CustomId07Event`
302
+ - `CustomId08Event`
303
+ - `CustomId09Event`
304
+ - `CustomId10Event`
305
+
306
+ ## Predefined event parameters
307
+
308
+ To enrich your event with another dimension, you can use predefined parameters for most common cases.
309
+ Add it to any event:
310
+
311
+ ```typescript
312
+ import {
313
+ Affise,
314
+ AddToCartEvent,
315
+ PredefinedParameters,
316
+ } from 'affise-attribution-lib';
317
+
318
+ class Presenter {
319
+ onUserAddsItemsToCart(item: string) {
320
+ const items = {
321
+ items: 'cookies, potato, milk',
322
+ };
323
+
324
+ const event = new AddToCartEvent(items, Date.now());
325
+
326
+ event.addPredefinedParameter(
327
+ PredefinedParameters.DESCRIPTION,
328
+ 'best before 2029'
329
+ );
330
+
331
+ Affise.sendEvent(event);
332
+ }
333
+ }
334
+ ```
335
+
336
+ In examples above `PredefinedParameters.DESCRIPTION` is used, but many others is available:
337
+
338
+ - `ADREV_AD_TYPE`
339
+ - `CITY`
340
+ - `COUNTRY`
341
+ - `REGION`
342
+ - `CLASS`
343
+ - `CONTENT`
344
+ - `CONTENT_ID`
345
+ - `CONTENT_LIST`
346
+ - `CONTENT_TYPE`
347
+ - `CURRENCY`
348
+ - `CUSTOMER_USER_ID`
349
+ - `DATE_A`
350
+ - `DATE_B`
351
+ - `DEPARTING_ARRIVAL_DATE`
352
+ - `DEPARTING_DEPARTURE_DATE`
353
+ - `DESCRIPTION`
354
+ - `DESTINATION_A`
355
+ - `DESTINATION_B`
356
+ - `DESTINATION_LIST`
357
+ - `HOTEL_SCORE`
358
+ - `LEVEL`
359
+ - `MAX_RATING_VALUE`
360
+ - `NUM_ADULTS`
361
+ - `NUM_CHILDREN`
362
+ - `NUM_INFANTS`
363
+ - `ORDER_ID`
364
+ - `PAYMENT_INFO_AVAILABLE`
365
+ - `PREFERRED_NEIGHBORHOODS`
366
+ - `PREFERRED_NUM_STOPS`
367
+ - `PREFERRED_PRICE_RANGE`
368
+ - `PREFERRED_STAR_RATINGS`
369
+ - `PRICE`
370
+ - `PURCHASE_CURRENCY`
371
+ - `QUANTITY`
372
+ - `RATING_VALUE`
373
+ - `RECEIPT_ID`
374
+ - `REGISTRATION_METHOD`
375
+ - `RETURNING_ARRIVAL_DATE`
376
+ - `RETURNING_DEPARTURE_DATE`
377
+ - `REVENUE`
378
+ - `SCORE`
379
+ - `SEARCH_STRING`
380
+ - `SUBSCRIPTION_ID`
381
+ - `SUCCESS`
382
+ - `SUGGESTED_DESTINATIONS`
383
+ - `SUGGESTED_HOTELS`
384
+ - `TRAVEL_START`
385
+ - `TRAVEL_END`
386
+ - `USER_SCORE`
387
+ - `VALIDATED`
388
+ - `ACHIEVEMENT_ID`
389
+ - `COUPON_CODE`
390
+ - `CUSTOMER_SEGMENT`
391
+ - `DEEP_LINK`
392
+ - `EVENT_START`
393
+ - `EVENT_END`
394
+ - `LAT`
395
+ - `LONG`
396
+ - `NEW_VERSION`
397
+ - `OLD_VERSION`
398
+ - `REVIEW_TEXT`
399
+ - `TUTORIAL_ID`
400
+ - `VIRTUAL_CURRENCY_NAME`
401
+ - `PARAM_01`
402
+ - `PARAM_02`
403
+ - `PARAM_03`
404
+ - `PARAM_04`
405
+ - `PARAM_05`
406
+ - `PARAM_06`
407
+ - `PARAM_07`
408
+ - `PARAM_08`
409
+ - `PARAM_09`
410
+
411
+ ## Events buffering
412
+
413
+ Affise library will send any pending events with first opportunity,
414
+ but if there is no network connection or device is disabled, events are kept locally for 7 days before deletion.
415
+
416
+ ## Advertising Identifier (google) tracking
417
+
418
+ Advertising Identifier (google) tracking is supported automatically, no actions needed
419
+
420
+ ## Open Advertising Identifier (huawei) tracking
421
+
422
+ Open Advertising Identifier is supported automatically, no actions needed
423
+
424
+ ## Install referrer tracking
425
+
426
+ Install referrer tracking is supported automatically, no actions needed
427
+
428
+ ## Push token tracking
429
+
430
+ To let affise track push token you need to receive it from your push service provider, and pass to Affise library.
431
+ First add firebase integration to your app completing theese steps: [Firebase Docs](https://firebase.google.com/docs/cloud-messaging/android/client)
432
+
433
+ After you have done with firebase inegration, add to your cloud messaging service `onNewToken` method `Affise.addPushToken(token)`
434
+
435
+ ```typescript
436
+ import { Affise } from 'affise-attribution-lib';
437
+ import messaging from '@react-native-firebase/messaging';
438
+
439
+ const getToken = async () => {
440
+ const token = await messaging().getToken();
441
+ if (token) {
442
+ Affise.addPushToken(token);
443
+ }
444
+ };
445
+ ```
446
+
447
+ ## Reinstall Uninstall tracking
448
+
449
+ Affise automatically track reinstall events by using silent-push technology, to make this feature work, pass push token when it is recreated by user and on you application starts up
450
+
451
+ ```typescript
452
+ Affise.addPushToken(token);
453
+ ```
454
+
455
+ ## APK preinstall tracking
456
+
457
+ SDK is also supports scenario when APK is installed not from one of application markets, such as google play, huawei appgallery or amazon appstore
458
+ To use this feature, create file with name `partner_key` in your app assets directory, and write unique identifier inside, this key will be passed to our backend so you can track events by partner later in your Affise console.
459
+
460
+ ## Deeplinks
461
+
462
+ Register deeplink callback right after Affise.init(..)
463
+
464
+ ```typescript
465
+ Affise.init(..);
466
+ Affise.registerDeeplinkCallback((uri) => {
467
+
468
+ });
469
+ ```
470
+
471
+ ### Android
472
+
473
+ To integrate deeplink support in android you need:
474
+
475
+ Add intent filter to `AndroidManifest.xml` as in `example/android/app/src/main/AndroidManifest.xml`,
476
+
477
+ ```xml
478
+ <intent-filter android:autoVerify="true">
479
+ <action android:name="android.intent.action.VIEW" />
480
+
481
+ <category android:name="android.intent.category.DEFAULT" />
482
+ <category android:name="android.intent.category.BROWSABLE" />
483
+
484
+ <data
485
+ android:host="YOUR_AFFISE_APP_ID.affattr.com"
486
+ android:scheme="react" />
487
+ </intent-filter>
488
+ ```
489
+
490
+ ### iOS
491
+
492
+ To integrate deeplink support in iOS you need:
493
+
494
+ Add deeplink handler to `AppDelegate.mm` as in `example/ios/AffiseAttributionLibExample/AppDelegate.mm`
495
+
496
+ - [React Docs](https://reactnavigation.org/docs/deep-linking/#set-up-with-bare-react-native-projects)
497
+
498
+ ```objective-c
499
+ - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
500
+ sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
501
+ {
502
+ return [RCTLinkingManager application:application openURL:url
503
+ sourceApplication:sourceApplication annotation:annotation];
504
+ }
505
+ ```
506
+
507
+ Add key `CFBundleURLTypes` to `Info.plist`
508
+
509
+ Example: `example/ios/AffiseAttributionLibExample/Info.plist`
510
+
511
+ ```xml
512
+ <key>CFBundleURLTypes</key>
513
+ <array>
514
+ <dict>
515
+ <key>CFBundleTypeRole</key>
516
+ <string>Editor</string>
517
+ <key>CFBundleURLName</key>
518
+ <string>YOUR_AFFISE_APP_ID.affattr.com</string>
519
+ <key>CFBundleURLSchemes</key>
520
+ <array>
521
+ <string>react</string>
522
+ </array>
523
+ </dict>
524
+ </array>
525
+ ```
526
+
527
+ ## Offline mode
528
+
529
+ In some scenarious you would want to limit Affise network usage, to pause that activity call anywhere in your application following code after Affise init:
530
+
531
+ ```typescript
532
+ Affise.init(..);
533
+ Affise.setOfflineModeEnabled(true); // to enable offline mode
534
+ Affise.setOfflineModeEnabled(false); // to disable offline mode
535
+ ```
536
+
537
+ While offline mode is enabled, your metrics and other events are kept locally, and will be delivered once offline mode is disabled.
538
+ Offline mode is persistent as Application lifecycle, and will be disabled with process termination automaticly.
539
+ To check current offline mode status call:
540
+
541
+ ```typescript
542
+ Affise.isOfflineModeEnabled(); // returns true or false describing current tracking state
543
+ ```
544
+
545
+ ## Disable tracking
546
+
547
+ To disable any tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise init:
548
+
549
+ ```typescript
550
+ Affise.init(..);
551
+ Affise.setTrackingEnabled(true); // to enable tracking
552
+ Affise.setTrackingEnabled(false); // to disable tracking
553
+ ```
554
+
555
+ By default tracking is enabled.
556
+
557
+ While tracking mode is disabled, metrics and other identifiers is not generated locally.
558
+ Keep in mind that this flag is persistent until app reinstall, and don't forget to reactivate tracking when needed.
559
+ To check current status of tracking call:
560
+
561
+ ```typescript
562
+ Affise.isTrackingEnabled().then((enabled) => {
563
+ // returns true or false describing current tracking state
564
+ });
565
+ ```
566
+
567
+ ## Disable background tracking
568
+
569
+ To disable any background tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise init:
570
+
571
+ ```typescript
572
+ Affise.init(..);
573
+ Affise.setBackgroundTrackingEnabled(true); // to enable background tracking
574
+ Affise.setBackgroundTrackingEnabled(false); // to disable background tracking
575
+ ```
576
+
577
+ By default background tracking is enabled.
578
+
579
+ While background tracking mode is disabled, metrics and other identifiers is not generated locally.
580
+ Background tracking mode is persistent as Application lifecycle, and will be re-enabled with process termination automatically.
581
+ To check current status of background tracking call:
582
+
583
+ ```typescript
584
+ Affise.isBackgroundTrackingEnabled().then((enabled) => {
585
+ // returns true or false describing current background tracking state
586
+ });
587
+ ```
588
+
589
+ ## GDPR right to be forgotten
590
+
591
+ Under the EU's General Data Protection Regulation (GDPR): An individual has the right to have their personal data erased.
592
+ To provide this functionality to user, as the app developer, you can call
593
+
594
+ ```typescript
595
+ Affise.init(..);
596
+ Affise.forget(); // to forget users data
597
+ ```
598
+
599
+ After processing such request our backend servers will delete all users data.
600
+ To prevent library from generating new events, disable tracking just before calling Affise.forget:
601
+
602
+ ```typescript
603
+ Affise.init(..);
604
+ Affise.setTrackingEnabled(false);
605
+ Affise.forget(); // to forget users data
606
+ ```
607
+
608
+ ## Platform specific
609
+
610
+ ### Get referrer
611
+
612
+ > `Android Only`
613
+
614
+ Use the next public method of SDK
615
+
616
+ ```typescript
617
+ Affise.getReferrer().then((referrer) => {
618
+ // returns referrer
619
+ });
620
+ ```
621
+
622
+ ### Get referrer value
623
+
624
+ > `Android Only`
625
+
626
+ Use the next public method of SDK to get referrer value by
627
+
628
+ ```typescript
629
+ Affise.android.getReferrerValue(ReferrerKey.CLICK_ID, (value) => {
630
+
631
+ })
632
+ ```
633
+
634
+ #### Referrer keys
635
+
636
+ In examples above `ReferrerKey.CLICK_ID` is used, but many others is available:
637
+
638
+ - `AD_ID`
639
+ - `CAMPAIGN_ID`
640
+ - `CLICK_ID`
641
+ - `AFFISE_AD`
642
+ - `AFFISE_AD_ID`
643
+ - `AFFISE_AD_TYPE`
644
+ - `AFFISE_ADSET`
645
+ - `AFFISE_ADSET_ID`
646
+ - `AFFISE_AFFC_ID`
647
+ - `AFFISE_CHANNEL`
648
+ - `AFFISE_CLICK_LOOK_BACK`
649
+ - `AFFISE_COST_CURRENCY`
650
+ - `AFFISE_COST_MODEL`
651
+ - `AFFISE_COST_VALUE`
652
+ - `AFFISE_DEEPLINK`
653
+ - `AFFISE_KEYWORDS`
654
+ - `AFFISE_MEDIA_TYPE`
655
+ - `AFFISE_MODEL`
656
+ - `AFFISE_OS`
657
+ - `AFFISE_PARTNER`
658
+ - `AFFISE_REF`
659
+ - `AFFISE_SITE_ID`
660
+ - `AFFISE_SUB_SITE_ID`
661
+ - `AFFC`
662
+ - `PID`
663
+ - `SUB_1`
664
+ - `SUB_2`
665
+ - `SUB_3`
666
+ - `SUB_4`
667
+ - `SUB_5`
668
+
669
+ ### StoreKit Ad Network
670
+
671
+ > `iOS Only`
672
+
673
+ For ios prior `16.1` first call
674
+
675
+ ```typescript
676
+ Affise.ios.registerAppForAdNetworkAttribution((error) => {
677
+ // Handle error
678
+ });
679
+ ```
680
+
681
+ Updates the fine and coarse conversion values, and calls a completion handler if the update fails.
682
+ Second argument coarseValue is available in iOS 16.1+
683
+
684
+ ```typescript
685
+ Affise.ios.updatePostbackConversionValue(1, "medium", (error) => {
686
+ // Handle error
687
+ });
688
+ ```
689
+
690
+ Configure your app to send postback copies to Affise:
691
+
692
+ Add key `NSAdvertisingAttributionReportEndpoint` to `Info.plist`
693
+ Set key value to `https://affise-skadnetwork.com/`
694
+
695
+ Example: `example/ios/AffiseAttributionLibExample/Info.plist`
696
+
697
+ ```xml
698
+ <key>CFBundleURLTypes</key>
699
+ <array>
700
+ <dict>
701
+ <key>NSAdvertisingAttributionReportEndpoint</key>
702
+ <string>https://affise-skadnetwork.com/</string>
703
+ </dict>
704
+ </array>
705
+ ```