@adshift/react-native-plugin 1.0.0 → 2.1.0

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 (180) hide show
  1. package/AdShiftReactNativePlugin.podspec +11 -7
  2. package/CHANGELOG.md +138 -0
  3. package/README.md +513 -542
  4. package/android/build.gradle +17 -3
  5. package/android/consumer-rules.pro +21 -0
  6. package/android/src/main/java/com/adshift/reactnativeplugin/AdShiftReactNativePluginModule.kt +786 -229
  7. package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +180 -0
  8. package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +146 -0
  9. package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +111 -0
  10. package/android/src/test/java/com/adshift/reactnativeplugin/IntentLinkDedupTest.kt +168 -0
  11. package/android/src/test/java/com/adshift/reactnativeplugin/LaunchIntentForwardingTest.kt +106 -0
  12. package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +167 -0
  13. package/android/src/test/java/com/adshift/reactnativeplugin/StartVerdictTest.kt +164 -0
  14. package/ios/AdShiftReactNativePlugin.h +7 -7
  15. package/ios/AdShiftReactNativePlugin.mm +200 -181
  16. package/ios/AdShiftReactNativePluginHelper.swift +584 -286
  17. package/ios/Core/BridgeRules.swift +82 -0
  18. package/lib/commonjs/Adshift.js +1138 -0
  19. package/lib/commonjs/Adshift.js.map +1 -0
  20. package/lib/commonjs/NativeAdShiftReactNativePlugin.js +22 -0
  21. package/lib/commonjs/NativeAdShiftReactNativePlugin.js.map +1 -0
  22. package/lib/commonjs/index.js +94 -0
  23. package/lib/commonjs/index.js.map +1 -0
  24. package/lib/commonjs/jest/index.js +164 -0
  25. package/lib/commonjs/jest/index.js.map +1 -0
  26. package/lib/commonjs/nativeSdkVersions.js +17 -0
  27. package/lib/commonjs/nativeSdkVersions.js.map +1 -0
  28. package/lib/commonjs/package.json +1 -0
  29. package/lib/commonjs/types/AdshiftAdRevenue.js +47 -0
  30. package/lib/commonjs/types/AdshiftAdRevenue.js.map +1 -0
  31. package/lib/commonjs/types/AdshiftConfig.js +45 -0
  32. package/lib/commonjs/types/AdshiftConfig.js.map +1 -0
  33. package/lib/commonjs/types/AdshiftConsent.js +113 -0
  34. package/lib/commonjs/types/AdshiftConsent.js.map +1 -0
  35. package/lib/commonjs/types/AdshiftConsentSnapshot.js +69 -0
  36. package/lib/commonjs/types/AdshiftConsentSnapshot.js.map +1 -0
  37. package/lib/commonjs/types/AdshiftDeepLink.js +154 -0
  38. package/lib/commonjs/types/AdshiftDeepLink.js.map +1 -0
  39. package/lib/commonjs/types/AdshiftError.js +91 -0
  40. package/lib/commonjs/types/AdshiftError.js.map +1 -0
  41. package/lib/commonjs/types/AdshiftEventParam.js +140 -0
  42. package/lib/commonjs/types/AdshiftEventParam.js.map +1 -0
  43. package/lib/commonjs/types/AdshiftEventType.js +88 -0
  44. package/lib/commonjs/types/AdshiftEventType.js.map +1 -0
  45. package/lib/commonjs/types/AdshiftThirdPartySharing.js +70 -0
  46. package/lib/commonjs/types/AdshiftThirdPartySharing.js.map +1 -0
  47. package/lib/commonjs/types/index.js +123 -0
  48. package/lib/commonjs/types/index.js.map +1 -0
  49. package/lib/commonjs/version.js +9 -0
  50. package/lib/commonjs/version.js.map +1 -0
  51. package/lib/module/Adshift.js +962 -296
  52. package/lib/module/Adshift.js.map +1 -1
  53. package/lib/module/NativeAdShiftReactNativePlugin.js +10 -7
  54. package/lib/module/NativeAdShiftReactNativePlugin.js.map +1 -1
  55. package/lib/module/index.js +26 -25
  56. package/lib/module/index.js.map +1 -1
  57. package/lib/module/jest/index.js +144 -0
  58. package/lib/module/jest/index.js.map +1 -0
  59. package/lib/module/nativeSdkVersions.js +13 -0
  60. package/lib/module/nativeSdkVersions.js.map +1 -0
  61. package/lib/module/types/AdshiftAdRevenue.js +43 -0
  62. package/lib/module/types/AdshiftAdRevenue.js.map +1 -0
  63. package/lib/module/types/AdshiftConfig.js +23 -26
  64. package/lib/module/types/AdshiftConfig.js.map +1 -1
  65. package/lib/module/types/AdshiftConsent.js +57 -50
  66. package/lib/module/types/AdshiftConsent.js.map +1 -1
  67. package/lib/module/types/AdshiftConsentSnapshot.js +65 -0
  68. package/lib/module/types/AdshiftConsentSnapshot.js.map +1 -0
  69. package/lib/module/types/AdshiftDeepLink.js +97 -67
  70. package/lib/module/types/AdshiftDeepLink.js.map +1 -1
  71. package/lib/module/types/AdshiftError.js +87 -0
  72. package/lib/module/types/AdshiftError.js.map +1 -0
  73. package/lib/module/types/AdshiftEventParam.js +135 -0
  74. package/lib/module/types/AdshiftEventParam.js.map +1 -0
  75. package/lib/module/types/AdshiftEventType.js +11 -36
  76. package/lib/module/types/AdshiftEventType.js.map +1 -1
  77. package/lib/module/types/AdshiftThirdPartySharing.js +65 -0
  78. package/lib/module/types/AdshiftThirdPartySharing.js.map +1 -0
  79. package/lib/module/types/index.js +9 -7
  80. package/lib/module/types/index.js.map +1 -1
  81. package/lib/module/version.js +5 -0
  82. package/lib/module/version.js.map +1 -0
  83. package/lib/typescript/commonjs/package.json +1 -0
  84. package/lib/typescript/commonjs/src/Adshift.d.ts +314 -0
  85. package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
  87. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/src/index.d.ts +51 -0
  89. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/src/jest/index.d.ts +103 -0
  91. package/lib/typescript/commonjs/src/jest/index.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts +11 -0
  93. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts +56 -0
  95. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts +104 -0
  97. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts +76 -0
  99. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts +56 -0
  101. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts +89 -0
  103. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts +57 -0
  105. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts +111 -0
  107. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts.map +1 -0
  108. package/lib/typescript/{src → commonjs/src}/types/AdshiftEventType.d.ts +12 -35
  109. package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts.map +1 -0
  110. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts +53 -0
  111. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/src/types/index.d.ts +17 -0
  113. package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/src/version.d.ts +2 -0
  115. package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
  116. package/lib/typescript/module/src/Adshift.d.ts +314 -0
  117. package/lib/typescript/module/src/Adshift.d.ts.map +1 -0
  118. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
  119. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
  120. package/lib/typescript/module/src/index.d.ts +51 -0
  121. package/lib/typescript/module/src/index.d.ts.map +1 -0
  122. package/lib/typescript/module/src/jest/index.d.ts +103 -0
  123. package/lib/typescript/module/src/jest/index.d.ts.map +1 -0
  124. package/lib/typescript/module/src/nativeSdkVersions.d.ts +11 -0
  125. package/lib/typescript/module/src/nativeSdkVersions.d.ts.map +1 -0
  126. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts +56 -0
  127. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts.map +1 -0
  128. package/lib/typescript/module/src/types/AdshiftConfig.d.ts +104 -0
  129. package/lib/typescript/module/src/types/AdshiftConfig.d.ts.map +1 -0
  130. package/lib/typescript/module/src/types/AdshiftConsent.d.ts +76 -0
  131. package/lib/typescript/module/src/types/AdshiftConsent.d.ts.map +1 -0
  132. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts +56 -0
  133. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
  134. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts +89 -0
  135. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts.map +1 -0
  136. package/lib/typescript/module/src/types/AdshiftError.d.ts +57 -0
  137. package/lib/typescript/module/src/types/AdshiftError.d.ts.map +1 -0
  138. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts +111 -0
  139. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts.map +1 -0
  140. package/lib/typescript/module/src/types/AdshiftEventType.d.ts +64 -0
  141. package/lib/typescript/module/src/types/AdshiftEventType.d.ts.map +1 -0
  142. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts +53 -0
  143. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
  144. package/lib/typescript/module/src/types/index.d.ts +17 -0
  145. package/lib/typescript/module/src/types/index.d.ts.map +1 -0
  146. package/lib/typescript/module/src/version.d.ts +2 -0
  147. package/lib/typescript/module/src/version.d.ts.map +1 -0
  148. package/package.json +50 -11
  149. package/src/Adshift.ts +1276 -342
  150. package/src/NativeAdShiftReactNativePlugin.ts +81 -115
  151. package/src/index.tsx +40 -25
  152. package/src/jest/index.ts +224 -0
  153. package/src/nativeSdkVersions.ts +10 -0
  154. package/src/types/AdshiftAdRevenue.ts +58 -0
  155. package/src/types/AdshiftConfig.ts +101 -53
  156. package/src/types/AdshiftConsent.ts +75 -72
  157. package/src/types/AdshiftConsentSnapshot.ts +103 -0
  158. package/src/types/AdshiftDeepLink.ts +123 -102
  159. package/src/types/AdshiftError.ts +107 -0
  160. package/src/types/AdshiftEventParam.ts +216 -0
  161. package/src/types/AdshiftEventType.ts +13 -35
  162. package/src/types/AdshiftThirdPartySharing.ts +63 -0
  163. package/src/types/index.ts +38 -6
  164. package/src/version.ts +2 -0
  165. package/lib/typescript/src/Adshift.d.ts +0 -335
  166. package/lib/typescript/src/Adshift.d.ts.map +0 -1
  167. package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts +0 -143
  168. package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts.map +0 -1
  169. package/lib/typescript/src/index.d.ts +0 -47
  170. package/lib/typescript/src/index.d.ts.map +0 -1
  171. package/lib/typescript/src/types/AdshiftConfig.d.ts +0 -74
  172. package/lib/typescript/src/types/AdshiftConfig.d.ts.map +0 -1
  173. package/lib/typescript/src/types/AdshiftConsent.d.ts +0 -88
  174. package/lib/typescript/src/types/AdshiftConsent.d.ts.map +0 -1
  175. package/lib/typescript/src/types/AdshiftDeepLink.d.ts +0 -93
  176. package/lib/typescript/src/types/AdshiftDeepLink.d.ts.map +0 -1
  177. package/lib/typescript/src/types/AdshiftEventType.d.ts.map +0 -1
  178. package/lib/typescript/src/types/index.d.ts +0 -5
  179. package/lib/typescript/src/types/index.d.ts.map +0 -1
  180. /package/lib/typescript/{package.json → module/package.json} +0 -0
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Standard parameter names for the `values` passed to `Adshift.trackEvent()`.
5
+ *
6
+ * Reports aggregate these names. Any other key is kept with the event as a
7
+ * custom parameter, so a misspelled or invented name is stored but never
8
+ * counted — use the constants for anything a report has to add up, revenue
9
+ * above all.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * await Adshift.trackEvent(AdshiftEventType.Purchase, {
14
+ * [AdshiftEventParam.Revenue]: 9.99,
15
+ * [AdshiftEventParam.Currency]: 'USD',
16
+ * [AdshiftEventParam.ContentId]: 'SKU123',
17
+ * size: 'XL', // custom parameters are fine alongside them
18
+ * });
19
+ * ```
20
+ */
21
+ export const AdshiftEventParam = {
22
+ // ============ Commerce ============
23
+
24
+ Price: 'as_price',
25
+ /** The number reports read as revenue. Always pair it with `Currency`. */
26
+ Revenue: 'as_revenue',
27
+ /** Revenue you expect rather than money already taken. */
28
+ ProjectedRevenue: 'as_projected_revenue',
29
+ /** ISO 4217 code, e.g. `USD`. */
30
+ Currency: 'as_currency',
31
+ Quantity: 'as_quantity',
32
+ ReceiptId: 'as_receipt_id',
33
+ /** Your own order identifier, for matching purchases with your records. */
34
+ OrderId: 'as_order_id',
35
+ CouponCode: 'as_coupon_code',
36
+ PaymentInfoAvailable: 'as_payment_info_available',
37
+ Validated: 'as_validated',
38
+ // ============ Content ============
39
+
40
+ ContentType: 'as_content_type',
41
+ ContentId: 'as_content_id',
42
+ ContentList: 'as_content_list',
43
+ Content: 'as_content',
44
+ Class: 'as_class',
45
+ Description: 'as_description',
46
+ SearchString: 'as_search_string',
47
+ // ============ Ratings and reviews ============
48
+
49
+ RatingValue: 'as_rating_value',
50
+ MaxRatingValue: 'as_max_rating_value',
51
+ ReviewText: 'as_review_text',
52
+ // ============ User and progress ============
53
+
54
+ CustomerUserId: 'as_customer_user_id',
55
+ RegistrationMethod: 'as_registration_method',
56
+ Level: 'as_level',
57
+ Score: 'as_score',
58
+ Success: 'as_success',
59
+ TutorialId: 'as_tutorial_id',
60
+ AchievementId: 'as_achievement_id',
61
+ VirtualCurrencyName: 'as_virtual_currency_name',
62
+ // ============ App and links ============
63
+
64
+ DeepLink: 'as_deep_link',
65
+ OldVersion: 'as_old_version',
66
+ NewVersion: 'as_new_version',
67
+ Channel: 'as_channel',
68
+ TouchObj: 'as_touch_obj',
69
+ // ============ Dates and places ============
70
+
71
+ DateA: 'as_date_a',
72
+ DateB: 'as_date_b',
73
+ EventStart: 'as_event_start',
74
+ EventEnd: 'as_event_end',
75
+ Latitude: 'as_lat',
76
+ Longitude: 'as_long',
77
+ City: 'as_city',
78
+ Region: 'as_region',
79
+ Country: 'as_country',
80
+ DestinationA: 'as_destination_a',
81
+ DestinationB: 'as_destination_b',
82
+ DestinationList: 'as_destination_list',
83
+ // ============ Travel ============
84
+
85
+ DepartingDepartureDate: 'as_departing_departure_date',
86
+ ReturningDepartureDate: 'as_returning_departure_date',
87
+ DepartingArrivalDate: 'as_departing_arrival_date',
88
+ ReturningArrivalDate: 'as_returning_arrival_date',
89
+ TravelStart: 'as_travel_start',
90
+ TravelEnd: 'as_travel_end',
91
+ SuggestedDestinations: 'as_suggested_destinations',
92
+ SuggestedHotels: 'as_suggested_hotels',
93
+ NumAdults: 'as_num_adults',
94
+ NumChildren: 'as_num_children',
95
+ NumInfants: 'as_num_infants',
96
+ UserScore: 'as_user_score',
97
+ HotelScore: 'as_hotel_score',
98
+ PurchaseCurrency: 'as_purchase_currency',
99
+ PreferredStarRatings: 'as_preferred_star_ratings',
100
+ PreferredPriceRange: 'as_preferred_price_range',
101
+ PreferredNeighborhoods: 'as_preferred_neighborhoods',
102
+ PreferredNumStops: 'as_preferred_num_stops',
103
+ // ============ Free-form slots ============
104
+
105
+ Param1: 'as_param_1',
106
+ Param2: 'as_param_2',
107
+ Param3: 'as_param_3',
108
+ Param4: 'as_param_4',
109
+ Param5: 'as_param_5',
110
+ Param6: 'as_param_6',
111
+ Param7: 'as_param_7',
112
+ Param8: 'as_param_8',
113
+ Param9: 'as_param_9',
114
+ Param10: 'as_param_10',
115
+ // ============ Ad revenue ============
116
+ // `logAdRevenue()` fills Revenue, Currency, AdRevenueSource and
117
+ // AdRevenueNetworkName from its own arguments and drops them from
118
+ // `additionalParameters`. The rest below are yours to pass.
119
+
120
+ AdRevenueSource: 'as_adrev_source',
121
+ AdRevenueNetworkName: 'as_adrev_network_name',
122
+ AdRevenueMediatedNetworkName: 'as_adrev_mediated_network_name',
123
+ AdRevenueAdType: 'as_adrev_ad_type',
124
+ AdRevenueAdSize: 'as_adrev_ad_size',
125
+ AdRevenuePlacementId: 'as_adrev_placement_id',
126
+ AdRevenueAdUnitId: 'as_adrev_ad_unit_id',
127
+ AdRevenuePrecision: 'as_adrev_precision'
128
+ };
129
+ /**
130
+ * Returns all standard parameter names as an array.
131
+ */
132
+ export function getAllEventParams() {
133
+ return Object.values(AdshiftEventParam);
134
+ }
135
+ //# sourceMappingURL=AdshiftEventParam.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AdshiftEventParam","Price","Revenue","ProjectedRevenue","Currency","Quantity","ReceiptId","OrderId","CouponCode","PaymentInfoAvailable","Validated","ContentType","ContentId","ContentList","Content","Class","Description","SearchString","RatingValue","MaxRatingValue","ReviewText","CustomerUserId","RegistrationMethod","Level","Score","Success","TutorialId","AchievementId","VirtualCurrencyName","DeepLink","OldVersion","NewVersion","Channel","TouchObj","DateA","DateB","EventStart","EventEnd","Latitude","Longitude","City","Region","Country","DestinationA","DestinationB","DestinationList","DepartingDepartureDate","ReturningDepartureDate","DepartingArrivalDate","ReturningArrivalDate","TravelStart","TravelEnd","SuggestedDestinations","SuggestedHotels","NumAdults","NumChildren","NumInfants","UserScore","HotelScore","PurchaseCurrency","PreferredStarRatings","PreferredPriceRange","PreferredNeighborhoods","PreferredNumStops","Param1","Param2","Param3","Param4","Param5","Param6","Param7","Param8","Param9","Param10","AdRevenueSource","AdRevenueNetworkName","AdRevenueMediatedNetworkName","AdRevenueAdType","AdRevenueAdSize","AdRevenuePlacementId","AdRevenueAdUnitId","AdRevenuePrecision","getAllEventParams","Object","values"],"sourceRoot":"../../../src","sources":["types/Adshift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BAAiB,EAAE,qBAAqB;EAExCC,kBAAkB,EAAE;AACtB,CAAU;AAKV;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAA6B;EAC5D,OAAOC,MAAM,CAACC,MAAM,CAACpF,iBAAiB,CAAC;AACzC","ignoreList":[]}
@@ -5,11 +5,13 @@
5
5
  *
6
6
  * Use these constants for consistent event naming across your app.
7
7
  *
8
+ * Pair them with `AdshiftEventParam` for the values.
9
+ *
8
10
  * @example
9
11
  * ```typescript
10
12
  * await Adshift.trackEvent(AdshiftEventType.AddToCart, {
11
- * product_id: 'SKU123',
12
- * price: 29.99,
13
+ * [AdshiftEventParam.ContentId]: 'SKU123',
14
+ * [AdshiftEventParam.Price]: 29.99,
13
15
  * });
14
16
  * ```
15
17
  *
@@ -21,84 +23,57 @@
21
23
  export const AdshiftEventType = {
22
24
  // ============ E-commerce Events ============
23
25
 
24
- /** User added item to cart. */
25
26
  AddToCart: 'as_add_to_cart',
26
- /** User added item to wishlist. */
27
27
  AddToWishList: 'as_add_to_wishlist',
28
- /** User added payment info. */
29
28
  AddPaymentInfo: 'as_add_payment_info',
30
- /** User initiated checkout. */
31
29
  InitiatedCheckout: 'as_initiated_checkout',
32
- /** User completed a purchase. */
33
30
  Purchase: 'as_purchase',
34
- /** User viewed content/product. */
35
31
  ContentView: 'as_content_view',
36
- /** User viewed a list of items. */
37
32
  ListView: 'as_list_view',
38
- /** User searched. */
39
33
  Search: 'as_search',
40
34
  // ============ User Lifecycle Events ============
41
35
 
42
- /** User completed registration. */
43
36
  CompleteRegistration: 'as_complete_registration',
44
- /** User logged in. */
45
37
  Login: 'as_login',
46
- /** User completed tutorial. */
47
38
  TutorialCompletion: 'as_tutorial_completion',
48
- /** User subscribed. */
49
39
  Subscribe: 'as_subscribe',
50
- /** User started a trial. */
51
40
  StartTrial: 'as_start_trial',
52
41
  // ============ Gaming Events ============
53
42
 
54
- /** User achieved a level. */
55
43
  LevelAchieved: 'as_level_achieved',
56
- /** User unlocked an achievement. */
57
44
  AchievementUnlocked: 'as_achievement_unlocked',
58
- /** User spent credits/currency. */
45
+ /** Note the plural in the value; the key is singular for compatibility. */
59
46
  SpentCredit: 'as_spent_credits',
60
47
  // ============ Engagement Events ============
61
48
 
62
- /** User rated the app/content. */
63
49
  Rate: 'as_rate',
64
- /** User shared content. */
65
50
  Share: 'as_share',
66
- /** User invited others. */
67
51
  Invite: 'as_invite',
68
- /** User re-engaged with the app. */
69
52
  ReEngage: 'as_re_engage',
70
- /** User updated the app. */
71
53
  Update: 'as_update',
72
- /** User opened from push notification. */
73
54
  OpenedFromPushNotification: 'as_opened_from_push_notification',
74
55
  // ============ Travel Events ============
75
56
 
76
- /** User made a travel booking. */
77
57
  TravelBooking: 'as_travel_booking',
78
58
  // ============ Ad Events ============
79
59
 
80
- /** User clicked an ad. */
81
60
  AdClick: 'as_ad_click',
82
- /** User viewed an ad. */
83
61
  AdView: 'as_ad_view',
62
+ /** Ad revenue impression. Prefer `Adshift.logAdRevenue()`. */
63
+ AdRevenue: 'as_ad_revenue',
84
64
  // ============ Location Events ============
85
65
 
86
- /** User location changed. */
66
+ /** Region or place the user moved to, as your own values. */
87
67
  LocationChanged: 'as_location_changed',
88
- /** User location coordinates updated. */
68
+ /** Latitude and longitude. Send only what your privacy notice covers. */
89
69
  LocationCoordinates: 'as_location_coordinates',
90
70
  // ============ Other Events ============
91
71
 
92
- /** Order ID event. */
72
+ /** Your order identifier, for matching purchases with your own records. */
93
73
  OrderId: 'as_order_id',
94
- /** Customer segment event. */
74
+ /** Segment the user belongs to, for audience reporting. */
95
75
  CustomerSegment: 'as_customer_segment'
96
76
  };
97
-
98
- /**
99
- * Type representing all predefined event type values.
100
- */
101
-
102
77
  /**
103
78
  * Returns all predefined event types as an array.
104
79
  */
@@ -1 +1 @@
1
- {"version":3,"names":["AdshiftEventType","AddToCart","AddToWishList","AddPaymentInfo","InitiatedCheckout","Purchase","ContentView","ListView","Search","CompleteRegistration","Login","TutorialCompletion","Subscribe","StartTrial","LevelAchieved","AchievementUnlocked","SpentCredit","Rate","Share","Invite","ReEngage","Update","OpenedFromPushNotification","TravelBooking","AdClick","AdView","LocationChanged","LocationCoordinates","OrderId","CustomerSegment","getAllEventTypes","Object","values"],"sourceRoot":"../../../src","sources":["types/AdshiftEventType.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG;EAC9B;;EAEA;EACAC,SAAS,EAAE,gBAAgB;EAE3B;EACAC,aAAa,EAAE,oBAAoB;EAEnC;EACAC,cAAc,EAAE,qBAAqB;EAErC;EACAC,iBAAiB,EAAE,uBAAuB;EAE1C;EACAC,QAAQ,EAAE,aAAa;EAEvB;EACAC,WAAW,EAAE,iBAAiB;EAE9B;EACAC,QAAQ,EAAE,cAAc;EAExB;EACAC,MAAM,EAAE,WAAW;EAEnB;;EAEA;EACAC,oBAAoB,EAAE,0BAA0B;EAEhD;EACAC,KAAK,EAAE,UAAU;EAEjB;EACAC,kBAAkB,EAAE,wBAAwB;EAE5C;EACAC,SAAS,EAAE,cAAc;EAEzB;EACAC,UAAU,EAAE,gBAAgB;EAE5B;;EAEA;EACAC,aAAa,EAAE,mBAAmB;EAElC;EACAC,mBAAmB,EAAE,yBAAyB;EAE9C;EACAC,WAAW,EAAE,kBAAkB;EAE/B;;EAEA;EACAC,IAAI,EAAE,SAAS;EAEf;EACAC,KAAK,EAAE,UAAU;EAEjB;EACAC,MAAM,EAAE,WAAW;EAEnB;EACAC,QAAQ,EAAE,cAAc;EAExB;EACAC,MAAM,EAAE,WAAW;EAEnB;EACAC,0BAA0B,EAAE,kCAAkC;EAE9D;;EAEA;EACAC,aAAa,EAAE,mBAAmB;EAElC;;EAEA;EACAC,OAAO,EAAE,aAAa;EAEtB;EACAC,MAAM,EAAE,YAAY;EAEpB;;EAEA;EACAC,eAAe,EAAE,qBAAqB;EAEtC;EACAC,mBAAmB,EAAE,yBAAyB;EAE9C;;EAEA;EACAC,OAAO,EAAE,aAAa;EAEtB;EACAC,eAAe,EAAE;AACnB,CAAU;;AAEV;AACA;AACA;;AAIA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAa;EAC3C,OAAOC,MAAM,CAACC,MAAM,CAAChC,gBAAgB,CAAC;AACxC","ignoreList":[]}
1
+ {"version":3,"names":["AdshiftEventType","AddToCart","AddToWishList","AddPaymentInfo","InitiatedCheckout","Purchase","ContentView","ListView","Search","CompleteRegistration","Login","TutorialCompletion","Subscribe","StartTrial","LevelAchieved","AchievementUnlocked","SpentCredit","Rate","Share","Invite","ReEngage","Update","OpenedFromPushNotification","TravelBooking","AdClick","AdView","AdRevenue","LocationChanged","LocationCoordinates","OrderId","CustomerSegment","getAllEventTypes","Object","values"],"sourceRoot":"../../../src","sources":["types/AdshiftEventType.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG;EAC9B;;EAEAC,SAAS,EAAE,gBAAgB;EAE3BC,aAAa,EAAE,oBAAoB;EAEnCC,cAAc,EAAE,qBAAqB;EAErCC,iBAAiB,EAAE,uBAAuB;EAE1CC,QAAQ,EAAE,aAAa;EAEvBC,WAAW,EAAE,iBAAiB;EAE9BC,QAAQ,EAAE,cAAc;EAExBC,MAAM,EAAE,WAAW;EAEnB;;EAEAC,oBAAoB,EAAE,0BAA0B;EAEhDC,KAAK,EAAE,UAAU;EAEjBC,kBAAkB,EAAE,wBAAwB;EAE5CC,SAAS,EAAE,cAAc;EAEzBC,UAAU,EAAE,gBAAgB;EAE5B;;EAEAC,aAAa,EAAE,mBAAmB;EAElCC,mBAAmB,EAAE,yBAAyB;EAE9C;EACAC,WAAW,EAAE,kBAAkB;EAE/B;;EAEAC,IAAI,EAAE,SAAS;EAEfC,KAAK,EAAE,UAAU;EAEjBC,MAAM,EAAE,WAAW;EAEnBC,QAAQ,EAAE,cAAc;EAExBC,MAAM,EAAE,WAAW;EAEnBC,0BAA0B,EAAE,kCAAkC;EAE9D;;EAEAC,aAAa,EAAE,mBAAmB;EAElC;;EAEAC,OAAO,EAAE,aAAa;EAEtBC,MAAM,EAAE,YAAY;EAEpB;EACAC,SAAS,EAAE,eAAe;EAE1B;;EAEA;EACAC,eAAe,EAAE,qBAAqB;EAEtC;EACAC,mBAAmB,EAAE,yBAAyB;EAE9C;;EAEA;EACAC,OAAO,EAAE,aAAa;EAEtB;EACAC,eAAe,EAAE;AACnB,CAAU;AAKV;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAA4B;EAC1D,OAAOC,MAAM,CAACC,MAAM,CAACjC,gBAAgB,CAAC;AACxC","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * What the app says about passing this user's data on to someone else.
5
+ *
6
+ * A separate question from {@link AdshiftConsent}, and one with the opposite
7
+ * default. Consent under GDPR must be affirmative, so a flag nobody set counts
8
+ * as no consent. Here nothing said means sharing is allowed — which is why this
9
+ * is not a fourth flag on the consent object: folding the two together would
10
+ * make one of them wrong.
11
+ *
12
+ * The three states live in the calls rather than in a nullable field. Never
13
+ * calling `Adshift.setThirdPartySharing()` leaves the question unanswered,
14
+ * `Adshift.clearThirdPartySharing()` returns to unanswered, and the value here
15
+ * is the answer itself.
16
+ *
17
+ * An object rather than a bare `boolean` so a field can be added later without
18
+ * breaking callers.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * // The user asked not to have their data passed on
23
+ * Adshift.setThirdPartySharing(AdshiftThirdPartySharing.optedOut());
24
+ *
25
+ * // The user was asked and did not opt out
26
+ * Adshift.setThirdPartySharing(AdshiftThirdPartySharing.allowed());
27
+ * ```
28
+ */
29
+
30
+ /**
31
+ * Helper functions for creating `AdshiftThirdPartySharing` objects.
32
+ */
33
+ export const AdshiftThirdPartySharing = {
34
+ /** The user asked not to have their data passed on. */
35
+ optedOut() {
36
+ return {
37
+ optOut: true
38
+ };
39
+ },
40
+ /**
41
+ * The user did not ask to be excluded.
42
+ *
43
+ * Only worth sending when the app has actually asked. Setting this at startup
44
+ * as a default is the one mistake to avoid here: a CMP answer arriving later
45
+ * cannot be undone for events already sent, and the declaration is recorded
46
+ * as the app's own rather than as the absence of one.
47
+ */
48
+ allowed() {
49
+ return {
50
+ optOut: false
51
+ };
52
+ }
53
+ };
54
+
55
+ /**
56
+ * Converts `AdshiftThirdPartySharing` to a plain object for the native bridge.
57
+ *
58
+ * @internal
59
+ */
60
+ export function thirdPartySharingToMap(sharing) {
61
+ return {
62
+ optOut: sharing.optOut === true
63
+ };
64
+ }
65
+ //# sourceMappingURL=AdshiftThirdPartySharing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AdshiftThirdPartySharing","optedOut","optOut","allowed","thirdPartySharingToMap","sharing"],"sourceRoot":"../../../src","sources":["types/AdshiftThirdPartySharing.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA,OAAO,MAAMA,wBAAwB,GAAG;EACtC;EACAC,QAAQA,CAAA,EAA6B;IACnC,OAAO;MAAEC,MAAM,EAAE;IAAK,CAAC;EACzB,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,OAAOA,CAAA,EAA6B;IAClC,OAAO;MAAED,MAAM,EAAE;IAAM,CAAC;EAC1B;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,sBAAsBA,CACpCC,OAAiC,EACR;EACzB,OAAO;IAAEH,MAAM,EAAEG,OAAO,CAACH,MAAM,KAAK;EAAK,CAAC;AAC5C","ignoreList":[]}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
- // AdShift React Native Plugin - Types
4
- // Export all types for external use
5
-
6
- export * from "./AdshiftConfig.js";
7
- export * from "./AdshiftConsent.js";
8
- export * from "./AdshiftDeepLink.js";
9
- export * from "./AdshiftEventType.js";
3
+ export { configToMap } from "./AdshiftConfig.js";
4
+ export { AdshiftConsent, consentToMap } from "./AdshiftConsent.js";
5
+ export { consentSnapshotFromMap } from "./AdshiftConsentSnapshot.js";
6
+ export { AdshiftThirdPartySharing, thirdPartySharingToMap } from "./AdshiftThirdPartySharing.js";
7
+ export { AdshiftDeepLinkStatus, AdshiftDeepLink, deepLinkToMap } from "./AdshiftDeepLink.js";
8
+ export { AdshiftEventType, getAllEventTypes } from "./AdshiftEventType.js";
9
+ export { AdshiftEventParam, getAllEventParams } from "./AdshiftEventParam.js";
10
+ export { AdshiftMediationNetwork } from "./AdshiftAdRevenue.js";
11
+ export { AdshiftErrorCode, isAdshiftError, createAdshiftError, toAdshiftError } from "./AdshiftError.js";
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA;AACA;;AAEA,cAAc,oBAAiB;AAC/B,cAAc,qBAAkB;AAChC,cAAc,sBAAmB;AACjC,cAAc,uBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["configToMap","AdshiftConsent","consentToMap","consentSnapshotFromMap","AdshiftThirdPartySharing","thirdPartySharingToMap","AdshiftDeepLinkStatus","AdshiftDeepLink","deepLinkToMap","AdshiftEventType","getAllEventTypes","AdshiftEventParam","getAllEventParams","AdshiftMediationNetwork","AdshiftErrorCode","isAdshiftError","createAdshiftError","toAdshiftError"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AACA,SAASA,WAAW,QAAQ,oBAAiB;AAG7C,SAASC,cAAc,EAAEC,YAAY,QAAQ,qBAAkB;AAG/D,SAASC,sBAAsB,QAAQ,6BAA0B;AAEjE,SACEC,wBAAwB,EACxBC,sBAAsB,QACjB,+BAA4B;AAEnC,SACEC,qBAAqB,EACrBC,eAAe,EACfC,aAAa,QACR,sBAAmB;AAE1B,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,uBAAoB;AAGvE,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,wBAAqB;AAG1E,SAASC,uBAAuB,QAAQ,uBAAoB;AAM5D,SACEC,gBAAgB,EAChBC,cAAc,EACdC,kBAAkB,EAClBC,cAAc,QACT,mBAAgB","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ // Generated by scripts/write-version.js from package.json. Do not edit.
4
+ export const PLUGIN_VERSION = '2.1.0';
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PLUGIN_VERSION"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,cAAc,GAAG,OAAO","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}