@adshift/react-native-plugin 1.0.0 → 2.0.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 +122 -0
  3. package/README.md +506 -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 +1135 -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 +959 -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 +311 -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 +311 -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 +49 -10
  149. package/src/Adshift.ts +1273 -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,111 @@
1
+ /**
2
+ * Standard parameter names for the `values` passed to `Adshift.trackEvent()`.
3
+ *
4
+ * Reports aggregate these names. Any other key is kept with the event as a
5
+ * custom parameter, so a misspelled or invented name is stored but never
6
+ * counted — use the constants for anything a report has to add up, revenue
7
+ * above all.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * await Adshift.trackEvent(AdshiftEventType.Purchase, {
12
+ * [AdshiftEventParam.Revenue]: 9.99,
13
+ * [AdshiftEventParam.Currency]: 'USD',
14
+ * [AdshiftEventParam.ContentId]: 'SKU123',
15
+ * size: 'XL', // custom parameters are fine alongside them
16
+ * });
17
+ * ```
18
+ */
19
+ export declare const AdshiftEventParam: {
20
+ readonly Price: "as_price";
21
+ /** The number reports read as revenue. Always pair it with `Currency`. */
22
+ readonly Revenue: "as_revenue";
23
+ /** Revenue you expect rather than money already taken. */
24
+ readonly ProjectedRevenue: "as_projected_revenue";
25
+ /** ISO 4217 code, e.g. `USD`. */
26
+ readonly Currency: "as_currency";
27
+ readonly Quantity: "as_quantity";
28
+ readonly ReceiptId: "as_receipt_id";
29
+ /** Your own order identifier, for matching purchases with your records. */
30
+ readonly OrderId: "as_order_id";
31
+ readonly CouponCode: "as_coupon_code";
32
+ readonly PaymentInfoAvailable: "as_payment_info_available";
33
+ readonly Validated: "as_validated";
34
+ readonly ContentType: "as_content_type";
35
+ readonly ContentId: "as_content_id";
36
+ readonly ContentList: "as_content_list";
37
+ readonly Content: "as_content";
38
+ readonly Class: "as_class";
39
+ readonly Description: "as_description";
40
+ readonly SearchString: "as_search_string";
41
+ readonly RatingValue: "as_rating_value";
42
+ readonly MaxRatingValue: "as_max_rating_value";
43
+ readonly ReviewText: "as_review_text";
44
+ readonly CustomerUserId: "as_customer_user_id";
45
+ readonly RegistrationMethod: "as_registration_method";
46
+ readonly Level: "as_level";
47
+ readonly Score: "as_score";
48
+ readonly Success: "as_success";
49
+ readonly TutorialId: "as_tutorial_id";
50
+ readonly AchievementId: "as_achievement_id";
51
+ readonly VirtualCurrencyName: "as_virtual_currency_name";
52
+ readonly DeepLink: "as_deep_link";
53
+ readonly OldVersion: "as_old_version";
54
+ readonly NewVersion: "as_new_version";
55
+ readonly Channel: "as_channel";
56
+ readonly TouchObj: "as_touch_obj";
57
+ readonly DateA: "as_date_a";
58
+ readonly DateB: "as_date_b";
59
+ readonly EventStart: "as_event_start";
60
+ readonly EventEnd: "as_event_end";
61
+ readonly Latitude: "as_lat";
62
+ readonly Longitude: "as_long";
63
+ readonly City: "as_city";
64
+ readonly Region: "as_region";
65
+ readonly Country: "as_country";
66
+ readonly DestinationA: "as_destination_a";
67
+ readonly DestinationB: "as_destination_b";
68
+ readonly DestinationList: "as_destination_list";
69
+ readonly DepartingDepartureDate: "as_departing_departure_date";
70
+ readonly ReturningDepartureDate: "as_returning_departure_date";
71
+ readonly DepartingArrivalDate: "as_departing_arrival_date";
72
+ readonly ReturningArrivalDate: "as_returning_arrival_date";
73
+ readonly TravelStart: "as_travel_start";
74
+ readonly TravelEnd: "as_travel_end";
75
+ readonly SuggestedDestinations: "as_suggested_destinations";
76
+ readonly SuggestedHotels: "as_suggested_hotels";
77
+ readonly NumAdults: "as_num_adults";
78
+ readonly NumChildren: "as_num_children";
79
+ readonly NumInfants: "as_num_infants";
80
+ readonly UserScore: "as_user_score";
81
+ readonly HotelScore: "as_hotel_score";
82
+ readonly PurchaseCurrency: "as_purchase_currency";
83
+ readonly PreferredStarRatings: "as_preferred_star_ratings";
84
+ readonly PreferredPriceRange: "as_preferred_price_range";
85
+ readonly PreferredNeighborhoods: "as_preferred_neighborhoods";
86
+ readonly PreferredNumStops: "as_preferred_num_stops";
87
+ readonly Param1: "as_param_1";
88
+ readonly Param2: "as_param_2";
89
+ readonly Param3: "as_param_3";
90
+ readonly Param4: "as_param_4";
91
+ readonly Param5: "as_param_5";
92
+ readonly Param6: "as_param_6";
93
+ readonly Param7: "as_param_7";
94
+ readonly Param8: "as_param_8";
95
+ readonly Param9: "as_param_9";
96
+ readonly Param10: "as_param_10";
97
+ readonly AdRevenueSource: "as_adrev_source";
98
+ readonly AdRevenueNetworkName: "as_adrev_network_name";
99
+ readonly AdRevenueMediatedNetworkName: "as_adrev_mediated_network_name";
100
+ readonly AdRevenueAdType: "as_adrev_ad_type";
101
+ readonly AdRevenueAdSize: "as_adrev_ad_size";
102
+ readonly AdRevenuePlacementId: "as_adrev_placement_id";
103
+ readonly AdRevenueAdUnitId: "as_adrev_ad_unit_id";
104
+ readonly AdRevenuePrecision: "as_adrev_precision";
105
+ };
106
+ export type AdshiftEventParamValue = (typeof AdshiftEventParam)[keyof typeof AdshiftEventParam];
107
+ /**
108
+ * Returns all standard parameter names as an array.
109
+ */
110
+ export declare function getAllEventParams(): AdshiftEventParamValue[];
111
+ //# sourceMappingURL=AdshiftEventParam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftEventParam.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftEventParam.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB;;IAK5B,0EAA0E;;IAG1E,0DAA0D;;IAG1D,iCAAiC;;;;IAOjC,2EAA2E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyKnE,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,sBAAsB,EAAE,CAE5D"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Predefined event types for AdShift SDK.
3
+ *
4
+ * Use these constants for consistent event naming across your app.
5
+ *
6
+ * Pair them with `AdshiftEventParam` for the values.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * await Adshift.trackEvent(AdshiftEventType.AddToCart, {
11
+ * [AdshiftEventParam.ContentId]: 'SKU123',
12
+ * [AdshiftEventParam.Price]: 29.99,
13
+ * });
14
+ * ```
15
+ *
16
+ * You can also use custom event names as strings:
17
+ * ```typescript
18
+ * await Adshift.trackEvent('custom_event_name');
19
+ * ```
20
+ */
21
+ export declare const AdshiftEventType: {
22
+ readonly AddToCart: "as_add_to_cart";
23
+ readonly AddToWishList: "as_add_to_wishlist";
24
+ readonly AddPaymentInfo: "as_add_payment_info";
25
+ readonly InitiatedCheckout: "as_initiated_checkout";
26
+ readonly Purchase: "as_purchase";
27
+ readonly ContentView: "as_content_view";
28
+ readonly ListView: "as_list_view";
29
+ readonly Search: "as_search";
30
+ readonly CompleteRegistration: "as_complete_registration";
31
+ readonly Login: "as_login";
32
+ readonly TutorialCompletion: "as_tutorial_completion";
33
+ readonly Subscribe: "as_subscribe";
34
+ readonly StartTrial: "as_start_trial";
35
+ readonly LevelAchieved: "as_level_achieved";
36
+ readonly AchievementUnlocked: "as_achievement_unlocked";
37
+ /** Note the plural in the value; the key is singular for compatibility. */
38
+ readonly SpentCredit: "as_spent_credits";
39
+ readonly Rate: "as_rate";
40
+ readonly Share: "as_share";
41
+ readonly Invite: "as_invite";
42
+ readonly ReEngage: "as_re_engage";
43
+ readonly Update: "as_update";
44
+ readonly OpenedFromPushNotification: "as_opened_from_push_notification";
45
+ readonly TravelBooking: "as_travel_booking";
46
+ readonly AdClick: "as_ad_click";
47
+ readonly AdView: "as_ad_view";
48
+ /** Ad revenue impression. Prefer `Adshift.logAdRevenue()`. */
49
+ readonly AdRevenue: "as_ad_revenue";
50
+ /** Region or place the user moved to, as your own values. */
51
+ readonly LocationChanged: "as_location_changed";
52
+ /** Latitude and longitude. Send only what your privacy notice covers. */
53
+ readonly LocationCoordinates: "as_location_coordinates";
54
+ /** Your order identifier, for matching purchases with your own records. */
55
+ readonly OrderId: "as_order_id";
56
+ /** Segment the user belongs to, for audience reporting. */
57
+ readonly CustomerSegment: "as_customer_segment";
58
+ };
59
+ export type AdshiftEventTypeValue = (typeof AdshiftEventType)[keyof typeof AdshiftEventType];
60
+ /**
61
+ * Returns all predefined event types as an array.
62
+ */
63
+ export declare function getAllEventTypes(): AdshiftEventTypeValue[];
64
+ //# sourceMappingURL=AdshiftEventType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftEventType.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftEventType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;IAqC3B,2EAA2E;;;;;;;;;;;IA2B3E,8DAA8D;;IAK9D,6DAA6D;;IAG7D,yEAAyE;;IAKzE,2EAA2E;;IAG3E,2DAA2D;;CAEnD,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,EAAE,CAE1D"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * What the app says about passing this user's data on to someone else.
3
+ *
4
+ * A separate question from {@link AdshiftConsent}, and one with the opposite
5
+ * default. Consent under GDPR must be affirmative, so a flag nobody set counts
6
+ * as no consent. Here nothing said means sharing is allowed — which is why this
7
+ * is not a fourth flag on the consent object: folding the two together would
8
+ * make one of them wrong.
9
+ *
10
+ * The three states live in the calls rather than in a nullable field. Never
11
+ * calling `Adshift.setThirdPartySharing()` leaves the question unanswered,
12
+ * `Adshift.clearThirdPartySharing()` returns to unanswered, and the value here
13
+ * is the answer itself.
14
+ *
15
+ * An object rather than a bare `boolean` so a field can be added later without
16
+ * breaking callers.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // The user asked not to have their data passed on
21
+ * Adshift.setThirdPartySharing(AdshiftThirdPartySharing.optedOut());
22
+ *
23
+ * // The user was asked and did not opt out
24
+ * Adshift.setThirdPartySharing(AdshiftThirdPartySharing.allowed());
25
+ * ```
26
+ */
27
+ export interface AdshiftThirdPartySharing {
28
+ /** `true` withholds this user's data from advertising partners. */
29
+ optOut: boolean;
30
+ }
31
+ /**
32
+ * Helper functions for creating `AdshiftThirdPartySharing` objects.
33
+ */
34
+ export declare const AdshiftThirdPartySharing: {
35
+ /** The user asked not to have their data passed on. */
36
+ optedOut(): AdshiftThirdPartySharing;
37
+ /**
38
+ * The user did not ask to be excluded.
39
+ *
40
+ * Only worth sending when the app has actually asked. Setting this at startup
41
+ * as a default is the one mistake to avoid here: a CMP answer arriving later
42
+ * cannot be undone for events already sent, and the declaration is recorded
43
+ * as the app's own rather than as the absence of one.
44
+ */
45
+ allowed(): AdshiftThirdPartySharing;
46
+ };
47
+ /**
48
+ * Converts `AdshiftThirdPartySharing` to a plain object for the native bridge.
49
+ *
50
+ * @internal
51
+ */
52
+ export declare function thirdPartySharingToMap(sharing: AdshiftThirdPartySharing): Record<string, boolean>;
53
+ //# sourceMappingURL=AdshiftThirdPartySharing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftThirdPartySharing.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftThirdPartySharing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,wBAAwB;IACvC,mEAAmE;IACnE,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB;IACnC,uDAAuD;gBAC3C,wBAAwB;IAIpC;;;;;;;OAOG;eACQ,wBAAwB;CAGpC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB"}
@@ -0,0 +1,17 @@
1
+ export type { AdshiftConfig } from './AdshiftConfig';
2
+ export { configToMap } from './AdshiftConfig';
3
+ export type { ConsentFlag } from './AdshiftConsent';
4
+ export { AdshiftConsent, consentToMap } from './AdshiftConsent';
5
+ export type { ConsentSnapshot, ConsentSource } from './AdshiftConsentSnapshot';
6
+ export { consentSnapshotFromMap } from './AdshiftConsentSnapshot';
7
+ export { AdshiftThirdPartySharing, thirdPartySharingToMap, } from './AdshiftThirdPartySharing';
8
+ export { AdshiftDeepLinkStatus, AdshiftDeepLink, deepLinkToMap, } from './AdshiftDeepLink';
9
+ export { AdshiftEventType, getAllEventTypes } from './AdshiftEventType';
10
+ export type { AdshiftEventTypeValue } from './AdshiftEventType';
11
+ export { AdshiftEventParam, getAllEventParams } from './AdshiftEventParam';
12
+ export type { AdshiftEventParamValue } from './AdshiftEventParam';
13
+ export { AdshiftMediationNetwork } from './AdshiftAdRevenue';
14
+ export type { AdshiftMediationNetworkValue, AdRevenueParams, } from './AdshiftAdRevenue';
15
+ export { AdshiftErrorCode, isAdshiftError, createAdshiftError, toAdshiftError, } from './AdshiftError';
16
+ export type { AdshiftError, AdshiftErrorInfo } from './AdshiftError';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,YAAY,EACV,4BAA4B,EAC5B,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const PLUGIN_VERSION = "2.0.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,31 @@
1
1
  {
2
2
  "name": "@adshift/react-native-plugin",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "AdShift SDK for React Native - Mobile Attribution, Event Tracking, SKAdNetwork 4.0+, Deep Linking and GDPR/TCF 2.2 Compliance",
5
- "main": "./lib/module/index.js",
6
- "types": "./lib/typescript/src/index.d.ts",
5
+ "main": "./lib/commonjs/index.js",
6
+ "types": "./lib/typescript/commonjs/src/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
9
  "source": "./src/index.tsx",
10
- "types": "./lib/typescript/src/index.d.ts",
11
- "default": "./lib/module/index.js"
10
+ "import": {
11
+ "types": "./lib/typescript/module/src/index.d.ts",
12
+ "default": "./lib/module/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./lib/typescript/commonjs/src/index.d.ts",
16
+ "default": "./lib/commonjs/index.js"
17
+ }
18
+ },
19
+ "./jest": {
20
+ "source": "./src/jest/index.ts",
21
+ "import": {
22
+ "types": "./lib/typescript/module/src/jest/index.d.ts",
23
+ "default": "./lib/module/jest/index.js"
24
+ },
25
+ "require": {
26
+ "types": "./lib/typescript/commonjs/src/jest/index.d.ts",
27
+ "default": "./lib/commonjs/jest/index.js"
28
+ }
12
29
  },
13
30
  "./package.json": "./package.json"
14
31
  },
@@ -17,11 +34,12 @@
17
34
  "lib",
18
35
  "android",
19
36
  "ios",
20
- "cpp",
21
37
  "*.podspec",
22
- "react-native.config.js",
38
+ "CHANGELOG.md",
23
39
  "!ios/build",
24
40
  "!android/build",
41
+ "!android/generated",
42
+ "!ios/generated",
25
43
  "!android/gradle",
26
44
  "!android/gradlew",
27
45
  "!android/gradlew.bat",
@@ -29,7 +47,10 @@
29
47
  "!**/__tests__",
30
48
  "!**/__fixtures__",
31
49
  "!**/__mocks__",
32
- "!**/.*"
50
+ "!**/.*",
51
+ "!ios/Tests",
52
+ "!ios/Package.swift",
53
+ "!ios/.build"
33
54
  ],
34
55
  "scripts": {
35
56
  "example": "yarn workspace @adshift/react-native-plugin-example",
@@ -39,7 +60,10 @@
39
60
  "typecheck": "tsc",
40
61
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
41
62
  "test": "jest",
42
- "test:coverage": "jest --coverage"
63
+ "test:coverage": "jest --coverage",
64
+ "codegen:check": "node node_modules/react-native/scripts/generate-codegen-artifacts.js -p . -s library -t all -o /tmp/adshift-rn-codegen",
65
+ "write-version": "node scripts/write-version.js",
66
+ "version": "node scripts/write-version.js"
43
67
  },
44
68
  "keywords": [
45
69
  "react-native",
@@ -103,6 +127,12 @@
103
127
  "source": "src",
104
128
  "output": "lib",
105
129
  "targets": [
130
+ [
131
+ "commonjs",
132
+ {
133
+ "esm": true
134
+ }
135
+ ],
106
136
  [
107
137
  "module",
108
138
  {
@@ -123,6 +153,11 @@
123
153
  "jsSrcsDir": "src",
124
154
  "android": {
125
155
  "javaPackageName": "com.adshift.reactnativeplugin"
156
+ },
157
+ "ios": {
158
+ "modulesProvider": {
159
+ "AdShiftReactNativePlugin": "AdShiftReactNativePlugin"
160
+ }
126
161
  }
127
162
  },
128
163
  "prettier": {
@@ -139,5 +174,9 @@
139
174
  "eslint"
140
175
  ],
141
176
  "version": "0.56.0"
142
- }
177
+ },
178
+ "engines": {
179
+ "node": ">=20"
180
+ },
181
+ "module": "./lib/module/index.js"
143
182
  }