@thealteroffice/react-native-adgeist 0.0.27-beta → 0.0.28-beta

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 (33) hide show
  1. package/Adgeist.podspec +3 -4
  2. package/README.md +44 -0
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/com/adgeist/modules/AdgeistImpl.kt +6 -0
  5. package/android/src/newarch/java/com/Adgeist.kt +4 -0
  6. package/android/src/oldarch/java/com/Adgeist.kt +5 -0
  7. package/ios/Adgeist.mm +4 -0
  8. package/ios/AdgeistImpl.swift +7 -0
  9. package/ios/NativeHTML5AdManager.h +12 -1
  10. package/ios/NativeHTML5AdManager.mm +115 -5
  11. package/ios/NativeHTML5AdView.swift +62 -13
  12. package/ios/adgeist-Bridging-Header.h +1 -0
  13. package/lib/module/constants.js +1 -1
  14. package/lib/module/index.js +1 -0
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/module/specs/HTML5AdNativeComponent.ts +12 -4
  17. package/lib/module/specs/NativeAdgeist.js.map +1 -1
  18. package/lib/module/utmtracker/index.js +25 -0
  19. package/lib/module/utmtracker/index.js.map +1 -0
  20. package/lib/typescript/src/constants.d.ts +1 -1
  21. package/lib/typescript/src/index.d.ts +1 -0
  22. package/lib/typescript/src/index.d.ts.map +1 -1
  23. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts.map +1 -1
  24. package/lib/typescript/src/specs/NativeAdgeist.d.ts +1 -0
  25. package/lib/typescript/src/specs/NativeAdgeist.d.ts.map +1 -1
  26. package/lib/typescript/src/utmtracker/index.d.ts +6 -0
  27. package/lib/typescript/src/utmtracker/index.d.ts.map +1 -0
  28. package/package.json +2 -2
  29. package/src/constants.ts +1 -1
  30. package/src/index.tsx +3 -0
  31. package/src/specs/HTML5AdNativeComponent.ts +12 -4
  32. package/src/specs/NativeAdgeist.ts +2 -0
  33. package/src/utmtracker/index.ts +26 -0
package/Adgeist.podspec CHANGED
@@ -16,14 +16,13 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
17
  s.private_header_files = "ios/**/*.h"
18
18
 
19
- s.dependency "AdgeistKit", '= 1.0.7-beta'
19
+ s.dependency "AdgeistKit", '= 1.0.8-beta'
20
20
 
21
21
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
22
22
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
23
23
  if respond_to?(:install_modules_dependencies, true)
24
24
  install_modules_dependencies(s)
25
25
  else
26
- s.dependency "React-Core"
27
-
28
- end
26
+ s.dependency "React-Core"
27
+ end
29
28
  end
package/README.md CHANGED
@@ -112,3 +112,47 @@ import { HTML5AdView } from '@thealteroffice/react-native-adgeist';
112
112
  adType="display"
113
113
  />;
114
114
  ```
115
+
116
+
117
+ ### Campaign Conversion Analytics
118
+
119
+ #### Prerequisites
120
+
121
+ Before implementing campaign conversion analytics, ensure your app has deeplink support configured. Refer to these resources for setup guidance:
122
+
123
+ - [React Navigation - Deep Linking](https://reactnavigation.org/docs/deep-linking/)
124
+ - [React Native - Linking](https://reactnative.dev/docs/linking)
125
+ - [Expo - Linking into your app](https://docs.expo.dev/linking/into-your-app/)
126
+
127
+ #### Implementation
128
+
129
+ Tracks deeplink UTM parameters for attribution and analytics. This method should be called whenever your app is opened via a deeplink to capture campaign attribution data.
130
+
131
+ ```tsx
132
+ // Example usage with React Navigation
133
+ import { Linking } from 'react-native';
134
+ import { trackConversionsWithDeepLinks } from '@thealteroffice/react-native-adgeist';
135
+
136
+ useEffect(() => {
137
+ const handleUrl = (url: string) => {
138
+ trackConversionsWithDeepLinks(url);
139
+ // Continue with your normal deeplink handling
140
+ };
141
+
142
+ // Handle initial URL if app was opened from link
143
+ Linking.getInitialURL().then((url) => {
144
+ if (url) {
145
+ handleUrl(url);
146
+ }
147
+ });
148
+
149
+ // Handle URL changes while app is running
150
+ const subscription = Linking.addEventListener('url', (event) => {
151
+ handleUrl(event.url);
152
+ });
153
+
154
+ return () => subscription?.remove();
155
+ }, []);
156
+ ```
157
+
158
+ **Important**: This method should be called as early as possible when handling deeplinks to ensure accurate attribution tracking.
@@ -104,7 +104,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
104
104
 
105
105
  dependencies {
106
106
  implementation "com.facebook.react:react-android"
107
- implementation "ai.adgeist:adgeistkit:1.1.16-beta"
107
+ implementation "ai.adgeist:adgeistkit:1.1.17-beta"
108
108
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
109
109
  }
110
110
 
@@ -1,5 +1,6 @@
1
1
  package com.adgeist.modules
2
2
 
3
+ import android.net.Uri
3
4
  import android.util.Log
4
5
  import com.facebook.react.bridge.Promise
5
6
  import com.facebook.react.bridge.ReactApplicationContext
@@ -105,6 +106,11 @@ class AdgeistImpl internal constructor(private val context: ReactApplicationCont
105
106
  adgeistInstance?.updateConsentStatus(consent)
106
107
  }
107
108
 
109
+ fun trackDeeplinkUtm(url: String) {
110
+ val uri = Uri.parse(url)
111
+ adgeistInstance?.trackUtmFromDeeplink(uri)
112
+ }
113
+
108
114
  companion object {
109
115
  const val NAME = "Adgeist"
110
116
  }
@@ -115,4 +115,8 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
115
115
  override fun updateConsentStatus(consent: Boolean) {
116
116
  implementation.updateConsentStatus(consent)
117
117
  }
118
+
119
+ override fun trackDeeplinkUtm(url: String) {
120
+ implementation.trackDeeplinkUtm(url)
121
+ }
118
122
  }
@@ -129,4 +129,9 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
129
129
  fun updateConsentStatus(consent: Boolean) {
130
130
  implementation.updateConsentStatus(consent)
131
131
  }
132
+
133
+ @ReactMethod
134
+ fun trackDeeplinkUtm(url: String) {
135
+ implementation.trackDeeplinkUtm(url)
136
+ }
132
137
  }
package/ios/Adgeist.mm CHANGED
@@ -70,6 +70,10 @@ RCT_EXPORT_METHOD(updateConsentStatus:(BOOL)consent) {
70
70
  [adgeist updateConsentStatus:consent];
71
71
  }
72
72
 
73
+ RCT_EXPORT_METHOD(trackDeeplinkUtm:(NSString *)url) {
74
+ [adgeist trackDeeplinkUtmWithUrl:url];
75
+ }
76
+
73
77
  RCT_EXPORT_METHOD(logEvent:(NSDictionary *)eventDict) {
74
78
  [adgeist logEventWithEventDict:eventDict];
75
79
  }
@@ -100,6 +100,13 @@ import React
100
100
  adgeistInstance?.updateConsentStatus(consent)
101
101
  }
102
102
 
103
+ @objc public func trackDeeplinkUtm(url: String) {
104
+ guard let urlObj = URL(string: url) else {
105
+ print("Invalid URL provided for UTM tracking")
106
+ return
107
+ }
108
+ adgeistInstance?.trackDeeplink(url: urlObj)
109
+ }
103
110
 
104
111
  @objc public func logEvent(eventDict: [String: Any]) {
105
112
  let filtered = eventDict.compactMapValues { value -> Any? in
@@ -1,3 +1,4 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
1
2
  #import <React/RCTViewComponentView.h>
2
3
  #import <UIKit/UIKit.h>
3
4
 
@@ -6,4 +7,14 @@ NS_ASSUME_NONNULL_BEGIN
6
7
  @interface RCTNativeHTML5AdManager : RCTViewComponentView
7
8
  @end
8
9
 
9
- NS_ASSUME_NONNULL_END
10
+ NS_ASSUME_NONNULL_END
11
+ #else
12
+ #import <React/RCTViewManager.h>
13
+
14
+ NS_ASSUME_NONNULL_BEGIN
15
+
16
+ @interface RCTNativeHTML5AdManager : RCTViewManager
17
+ @end
18
+
19
+ NS_ASSUME_NONNULL_END
20
+ #endif
@@ -1,3 +1,4 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
1
2
  #import "NativeHTML5AdManager.h"
2
3
 
3
4
  #import <React/RCTFabricComponentsPlugins.h>
@@ -110,7 +111,7 @@ using namespace facebook::react;
110
111
  [super updateProps:props oldProps:oldProps];
111
112
  }
112
113
 
113
- - (void)onAdLoaded
114
+ - (void)onAdLoaded:(NativeHTML5AdView *)view
114
115
  {
115
116
  if (_eventEmitter) {
116
117
  std::static_pointer_cast<const HTML5AdNativeComponentEventEmitter>(_eventEmitter)
@@ -118,7 +119,7 @@ using namespace facebook::react;
118
119
  }
119
120
  }
120
121
 
121
- - (void)onAdFailedToLoad:(NSString *)error
122
+ - (void)onAdFailedToLoad:(NativeHTML5AdView *)view error:(NSString *)error
122
123
  {
123
124
  if (_eventEmitter) {
124
125
  HTML5AdNativeComponentEventEmitter::OnAdFailedToLoad event{};
@@ -128,7 +129,7 @@ using namespace facebook::react;
128
129
  }
129
130
  }
130
131
 
131
- - (void)onAdOpened
132
+ - (void)onAdOpened:(NativeHTML5AdView *)view
132
133
  {
133
134
  if (_eventEmitter) {
134
135
  std::static_pointer_cast<const HTML5AdNativeComponentEventEmitter>(_eventEmitter)
@@ -136,7 +137,7 @@ using namespace facebook::react;
136
137
  }
137
138
  }
138
139
 
139
- - (void)onAdClosed
140
+ - (void)onAdClosed:(NativeHTML5AdView *)view
140
141
  {
141
142
  if (_eventEmitter) {
142
143
  std::static_pointer_cast<const HTML5AdNativeComponentEventEmitter>(_eventEmitter)
@@ -144,7 +145,7 @@ using namespace facebook::react;
144
145
  }
145
146
  }
146
147
 
147
- - (void)onAdClicked
148
+ - (void)onAdClicked:(NativeHTML5AdView *)view
148
149
  {
149
150
  if (_eventEmitter) {
150
151
  std::static_pointer_cast<const HTML5AdNativeComponentEventEmitter>(_eventEmitter)
@@ -181,3 +182,112 @@ Class<RCTComponentViewProtocol> HTML5AdNativeComponentCls(void)
181
182
  {
182
183
  return RCTNativeHTML5AdManager.class;
183
184
  }
185
+
186
+ #else
187
+
188
+ #import "NativeHTML5AdManager.h"
189
+ #import <React/RCTViewManager.h>
190
+ #import <React/RCTUIManager.h>
191
+ #import <React/RCTBridge.h>
192
+ #import <objc/runtime.h>
193
+
194
+ // Swift → ObjC header
195
+ #if __has_include("Adgeist-Swift.h")
196
+ #import "Adgeist-Swift.h"
197
+ #elif __has_include(<adgeist/adgeist-Swift.h>)
198
+ #import <Adgeist/Adgeist-Swift.h>
199
+ #else
200
+ @import adgeist;
201
+ #endif
202
+
203
+ // Associated object keys for event blocks
204
+ static const char *kOnAdLoadedKey = "onAdLoaded";
205
+ static const char *kOnAdFailedToLoadKey = "onAdFailedToLoad";
206
+ static const char *kOnAdOpenedKey = "onAdOpened";
207
+ static const char *kOnAdClosedKey = "onAdClosed";
208
+ static const char *kOnAdClickedKey = "onAdClicked";
209
+
210
+ @interface RCTNativeHTML5AdManager () <NativeHTML5AdDelegate>
211
+ @end
212
+
213
+ @implementation RCTNativeHTML5AdManager
214
+
215
+ RCT_EXPORT_MODULE(HTML5AdNativeComponent)
216
+
217
+ - (UIView *)view
218
+ {
219
+ NativeHTML5AdView *swiftView = [[NativeHTML5AdView alloc] initWithFrame:CGRectZero];
220
+ swiftView.delegate = self;
221
+ return swiftView;
222
+ }
223
+
224
+ RCT_EXPORT_VIEW_PROPERTY(adUnitID, NSString)
225
+ RCT_EXPORT_VIEW_PROPERTY(adIsResponsive, BOOL)
226
+ RCT_EXPORT_VIEW_PROPERTY(adSize, NSDictionary)
227
+ RCT_EXPORT_VIEW_PROPERTY(adType, NSString)
228
+
229
+ RCT_EXPORT_VIEW_PROPERTY(onAdLoaded, RCTDirectEventBlock)
230
+ RCT_EXPORT_VIEW_PROPERTY(onAdFailedToLoad, RCTDirectEventBlock)
231
+ RCT_EXPORT_VIEW_PROPERTY(onAdOpened, RCTDirectEventBlock)
232
+ RCT_EXPORT_VIEW_PROPERTY(onAdClosed, RCTDirectEventBlock)
233
+ RCT_EXPORT_VIEW_PROPERTY(onAdClicked, RCTDirectEventBlock)
234
+
235
+ RCT_EXPORT_METHOD(loadAd:(nonnull NSNumber *)reactTag
236
+ isTestMode:(BOOL)isTestMode)
237
+ {
238
+ [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) {
239
+ NativeHTML5AdView *view = (NativeHTML5AdView *)viewRegistry[reactTag];
240
+ if ([view isKindOfClass:[NativeHTML5AdView class]]) {
241
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
242
+ dict[@"isTestMode"] = @(isTestMode);
243
+ [view loadAd:dict];
244
+ }
245
+ }];
246
+ }
247
+
248
+ RCT_EXPORT_METHOD(destroy:(nonnull NSNumber *)reactTag)
249
+ {
250
+ [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) {
251
+ NativeHTML5AdView *view = (NativeHTML5AdView *)viewRegistry[reactTag];
252
+ if ([view isKindOfClass:[NativeHTML5AdView class]]) {
253
+ [view destroy];
254
+ }
255
+ }];
256
+ }
257
+
258
+ - (NSArray<NSString *> *)customDirectEventTypes
259
+ {
260
+ return @[@"onAdLoaded", @"onAdFailedToLoad", @"onAdOpened", @"onAdClosed", @"onAdClicked"];
261
+ }
262
+
263
+ // NativeHTML5AdDelegate methods
264
+ // Note: In Old Architecture, events are handled directly by the NativeHTML5AdView via properties.
265
+ // The delegate methods are kept empty or for logging as the View now calls the block directly.
266
+ - (void)onAdLoaded:(NativeHTML5AdView *)view
267
+ {
268
+ // Handled by view property
269
+ }
270
+
271
+ - (void)onAdFailedToLoad:(NativeHTML5AdView *)view error:(NSString *)error
272
+ {
273
+ // Handled by view property
274
+ }
275
+
276
+ - (void)onAdOpened:(NativeHTML5AdView *)view
277
+ {
278
+ // Handled by view property
279
+ }
280
+
281
+ - (void)onAdClosed:(NativeHTML5AdView *)view
282
+ {
283
+ // Handled by view property
284
+ }
285
+
286
+ - (void)onAdClicked:(NativeHTML5AdView *)view
287
+ {
288
+ // Handled by view property
289
+ }
290
+
291
+ @end
292
+
293
+ #endif
@@ -4,11 +4,11 @@ import React
4
4
 
5
5
  // MARK: - Delegate Protocol (Objective-C compatible)
6
6
  @objc public protocol NativeHTML5AdDelegate: NSObjectProtocol {
7
- @objc func onAdLoaded()
8
- @objc(onAdFailedToLoad:) func onAdFailedToLoad(error: String)
9
- @objc func onAdOpened()
10
- @objc func onAdClosed()
11
- @objc func onAdClicked()
7
+ @objc func onAdLoaded(_ view: NativeHTML5AdView)
8
+ @objc(onAdFailedToLoad:error:) func onAdFailedToLoad(_ view: NativeHTML5AdView, error: String)
9
+ @objc func onAdOpened(_ view: NativeHTML5AdView)
10
+ @objc func onAdClosed(_ view: NativeHTML5AdView)
11
+ @objc func onAdClicked(_ view: NativeHTML5AdView)
12
12
  }
13
13
 
14
14
  // MARK: - Main Swift View (Exposed to Objective-C++)
@@ -21,8 +21,15 @@ public class NativeHTML5AdView: UIView {
21
21
  @objc public var adSize: NSDictionary?
22
22
  @objc public var adType: String?
23
23
  @objc public var adIsResponsive: Bool = false
24
-
25
- // MARK: Delegate (used to send events back to Fabric manager)
24
+
25
+ // MARK: Events (Old Architecture)
26
+ @objc public var onAdLoaded: ((_ body: [String: Any]) -> Void)?
27
+ @objc public var onAdFailedToLoad: ((_ body: [String: Any]) -> Void)?
28
+ @objc public var onAdOpened: ((_ body: [String: Any]) -> Void)?
29
+ @objc public var onAdClosed: ((_ body: [String: Any]) -> Void)?
30
+ @objc public var onAdClicked: ((_ body: [String: Any]) -> Void)?
31
+
32
+ // MARK: Delegate (used to send events back to manager)
26
33
  @objc public weak var delegate: NativeHTML5AdDelegate?
27
34
 
28
35
  // MARK: Private Ad View & Listener
@@ -74,7 +81,7 @@ public class NativeHTML5AdView: UIView {
74
81
 
75
82
  private func embedAdView() {
76
83
  guard let adUnitID = adUnitID else {
77
- delegate?.onAdFailedToLoad(error: "Ad unit ID is required")
84
+ delegate?.onAdFailedToLoad(self, error: "Ad unit ID is required")
78
85
  return
79
86
  }
80
87
 
@@ -115,22 +122,64 @@ private class NativeHTML5AdListener: AdListener {
115
122
  }
116
123
 
117
124
  override func onAdLoaded() {
118
- view?.delegate?.onAdLoaded()
125
+ if let view = view {
126
+ // Old Architecture
127
+ if let onAdLoaded = view.onAdLoaded {
128
+ onAdLoaded([:])
129
+ }
130
+ // New Architecture (or if delegate is used)
131
+ view.delegate?.onAdLoaded(view)
132
+ }
119
133
  }
120
134
 
121
135
  override func onAdFailedToLoad(_ errorMessage: String) {
122
- view?.delegate?.onAdFailedToLoad(error: errorMessage)
136
+ if let view = view {
137
+ // Old Architecture
138
+ if let onAdFailedToLoad = view.onAdFailedToLoad {
139
+ let errorDict = ["error": errorMessage]
140
+ if Thread.isMainThread {
141
+ onAdFailedToLoad(errorDict)
142
+ } else {
143
+ DispatchQueue.main.async {
144
+ onAdFailedToLoad(errorDict)
145
+ }
146
+ }
147
+ }
148
+ // New Architecture (or if delegate is used)
149
+ view.delegate?.onAdFailedToLoad(view, error: errorMessage)
150
+ }
123
151
  }
124
152
 
125
153
  override func onAdClicked() {
126
- view?.delegate?.onAdClicked()
154
+ if let view = view {
155
+ // Old Architecture
156
+ if let onAdClicked = view.onAdClicked {
157
+ onAdClicked([:])
158
+ }
159
+ // New Architecture (or if delegate is used)
160
+ view.delegate?.onAdClicked(view)
161
+ }
127
162
  }
128
163
 
129
164
  override func onAdImpression() {
130
- view?.delegate?.onAdOpened()
165
+ if let view = view {
166
+ // Old Architecture (mapped to onAdOpened)
167
+ if let onAdOpened = view.onAdOpened {
168
+ onAdOpened([:])
169
+ }
170
+ // New Architecture (or if delegate is used)
171
+ view.delegate?.onAdOpened(view)
172
+ }
131
173
  }
132
174
 
133
175
  override func onAdClosed() {
134
- view?.delegate?.onAdClosed()
176
+ if let view = view {
177
+ // Old Architecture
178
+ if let onAdClosed = view.onAdClosed {
179
+ onAdClosed([:])
180
+ }
181
+ // New Architecture (or if delegate is used)
182
+ view.delegate?.onAdClosed(view)
183
+ }
135
184
  }
136
185
  }
@@ -1,3 +1,4 @@
1
1
  #import "React/RCTBridgeModule.h"
2
2
  #import "React/RCTEventEmitter.h"
3
+ #import "React/RCTViewManager.h"
3
4
  #import "React-RCTAppDelegate/RCTDefaultReactNativeFactoryDelegate.h"
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  export const PACKAGE_VERSION_TAG = 'RN';
4
- export const PACKAGE_VERSION = '0.0.27-beta';
4
+ export const PACKAGE_VERSION = '0.0.28-beta';
5
5
  export const AdSizes = {
6
6
  custom: (width, height) => ({
7
7
  width,
@@ -4,4 +4,5 @@ export * from "./providers/AdgeistProvider.js";
4
4
  export * from "./components/HTML5AdView.js";
5
5
  export * from "./components/deprecated/BannerAdView.js";
6
6
  export * from "./cdpclient/index.js";
7
+ export * from "./utmtracker/index.js";
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,6BAA0B;AAExC,cAAc,yCAAsC;AAEpD,cAAc,sBAAmB","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,gCAA6B;AAE3C,cAAc,6BAA0B;AAExC,cAAc,yCAAsC;AAEpD,cAAc,sBAAmB;AAEjC,cAAc,uBAAoB","ignoreList":[]}
@@ -6,7 +6,7 @@ import type {
6
6
  import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
7
  import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
8
8
  import * as React from 'react';
9
- import { UIManager, findNodeHandle } from 'react-native';
9
+ import { Platform, UIManager, findNodeHandle } from 'react-native';
10
10
 
11
11
  export interface AdSize {
12
12
  width?: Double;
@@ -58,18 +58,26 @@ export const AdCommands = {
58
58
  } else {
59
59
  const reactTag = findNodeHandle(viewRef);
60
60
  if (reactTag != null) {
61
- UIManager.dispatchViewManagerCommand(reactTag, 1, [isTestMode]);
61
+ UIManager.dispatchViewManagerCommand(
62
+ reactTag,
63
+ Platform.OS === 'ios' ? 'loadAd' : 1,
64
+ [isTestMode]
65
+ );
62
66
  }
63
67
  }
64
68
  },
65
69
 
66
70
  destroy: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => {
67
- if (Commands?.destroy) {
71
+ if (isFabric) {
68
72
  Commands.destroy(viewRef);
69
73
  } else {
70
74
  const reactTag = findNodeHandle(viewRef);
71
75
  if (reactTag != null) {
72
- UIManager.dispatchViewManagerCommand(reactTag, 2, []);
76
+ UIManager.dispatchViewManagerCommand(
77
+ reactTag,
78
+ Platform.OS === 'ios' ? 'destroy' : 2,
79
+ []
80
+ );
73
81
  }
74
82
  }
75
83
  },
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeAdgeist.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAkGlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeAdgeist.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAoGlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ import Adgeist from "../specs/NativeAdgeist.js";
4
+ class AdgeistError extends Error {
5
+ constructor(message, code) {
6
+ super(message);
7
+ this.name = 'AdgeistError';
8
+ this.code = code;
9
+ Object.setPrototypeOf(this, AdgeistError.prototype);
10
+ }
11
+ }
12
+
13
+ /**
14
+ * @param uri - string
15
+ * @throws AdgeistError if the operation fails
16
+ */
17
+ export const trackConversionsWithDeepLinks = uri => {
18
+ try {
19
+ Adgeist.trackDeeplinkUtm(uri);
20
+ } catch (error) {
21
+ const err = error instanceof Error ? error : new Error('Failed to set user details');
22
+ throw new AdgeistError(err.message);
23
+ }
24
+ };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Adgeist","AdgeistError","Error","constructor","message","code","name","Object","setPrototypeOf","prototype","trackConversionsWithDeepLinks","uri","trackDeeplinkUtm","error","err"],"sourceRoot":"../../../src","sources":["utmtracker/index.ts"],"mappings":";;AAAA,OAAOA,OAAO,MAAM,2BAAwB;AAE5C,MAAMC,YAAY,SAASC,KAAK,CAAC;EAG/BC,WAAWA,CAACC,OAAe,EAAEC,IAAa,EAAE;IAC1C,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,cAAc;IAC1B,IAAI,CAACD,IAAI,GAAGA,IAAI;IAChBE,MAAM,CAACC,cAAc,CAAC,IAAI,EAAEP,YAAY,CAACQ,SAAS,CAAC;EACrD;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAIC,GAAW,IAAW;EAClE,IAAI;IACFX,OAAO,CAACY,gBAAgB,CAACD,GAAG,CAAC;EAC/B,CAAC,CAAC,OAAOE,KAAc,EAAE;IACvB,MAAMC,GAAG,GACPD,KAAK,YAAYX,KAAK,GAAGW,KAAK,GAAG,IAAIX,KAAK,CAAC,4BAA4B,CAAC;IAC1E,MAAM,IAAID,YAAY,CAACa,GAAG,CAACV,OAAO,CAAC;EACrC;AACF,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { AdSize } from './types/AdSize';
2
2
  export declare const PACKAGE_VERSION_TAG = "RN";
3
- export declare const PACKAGE_VERSION = "0.0.27-beta";
3
+ export declare const PACKAGE_VERSION = "0.0.28-beta";
4
4
  export declare const AdSizes: {
5
5
  custom: (width: number, height: number) => AdSize;
6
6
  Responsive: {
@@ -2,4 +2,5 @@ export * from './providers/AdgeistProvider';
2
2
  export * from './components/HTML5AdView';
3
3
  export * from './components/deprecated/BannerAdView';
4
4
  export * from './cdpclient/index';
5
+ export * from './utmtracker/index';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,sCAAsC,CAAC;AAErD,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAE5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,sCAAsC,CAAC;AAErD,cAAc,mBAAmB,CAAC;AAElC,cAAc,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"HTML5AdNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/HTML5AdNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,kBAAkB,EAClB,MAAM,EACP,MAAM,2CAA2C,CAAC;AAGnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IAEf,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAC3D,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,CACN,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC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,UAAU,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,CACN,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,EACrD,UAAU,EAAE,OAAO,KAChB,IAAI,CAAC;IACV,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;CAC1E;AAED,eAAO,MAAM,QAAQ,EAAE,cAErB,CAAC;wBAIE,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC;AAIhC,eAAO,MAAM,UAAU;+BAEV,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,cACzC,OAAO;gCAgBF,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;CAcvD,CAAC"}
@@ -22,6 +22,7 @@ export interface Spec extends TurboModule {
22
22
  trackTotalView(campaignId: string, adSpaceId: string, bidId: string, bidMeta: string, buyType: string, isTestEnvironment: boolean, totalViewTime: number): Promise<string>;
23
23
  trackClick(campaignId: string, adSpaceId: string, bidId: string, bidMeta: string, buyType: string, isTestEnvironment: boolean): Promise<string>;
24
24
  trackVideoPlayback(campaignId: string, adSpaceId: string, bidId: string, bidMeta: string, buyType: string, isTestEnvironment: boolean, totalPlaybackTime: number): Promise<string>;
25
+ trackDeeplinkUtm(url: string): void;
25
26
  }
26
27
  declare const _default: Spec;
27
28
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeAdgeist.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeAdgeist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,M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EAAE,OAAO,EAC1B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,UAAU,CACR,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,OAAO,GACzB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,kBAAkB,CAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,OAAO,EAC1B,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CASrC;;AAED,wBAAiE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @param uri - string
3
+ * @throws AdgeistError if the operation fails
4
+ */
5
+ export declare const trackConversionsWithDeepLinks: (uri: string) => void;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utmtracker/index.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,KAAK,MAAM,KAAG,IAQ3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thealteroffice/react-native-adgeist",
3
- "version": "0.0.27-beta",
3
+ "version": "0.0.28-beta",
4
4
  "description": "Publishers can integrate our SDK to connect their ad spaces to the AdGeist marketplace.",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -179,4 +179,4 @@
179
179
  "languages": "kotlin-objc",
180
180
  "version": "0.49.8"
181
181
  }
182
- }
182
+ }
package/src/constants.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { AdSize } from './types/AdSize';
2
2
 
3
3
  export const PACKAGE_VERSION_TAG = 'RN';
4
- export const PACKAGE_VERSION = '0.0.27-beta';
4
+ export const PACKAGE_VERSION = '0.0.28-beta';
5
5
 
6
6
  export const AdSizes = {
7
7
  custom: (width: number, height: number): AdSize => ({ width, height }),
package/src/index.tsx CHANGED
@@ -1,6 +1,9 @@
1
1
  export * from './providers/AdgeistProvider';
2
+
2
3
  export * from './components/HTML5AdView';
3
4
 
4
5
  export * from './components/deprecated/BannerAdView';
5
6
 
6
7
  export * from './cdpclient/index';
8
+
9
+ export * from './utmtracker/index';
@@ -6,7 +6,7 @@ import type {
6
6
  import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
7
  import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
8
8
  import * as React from 'react';
9
- import { UIManager, findNodeHandle } from 'react-native';
9
+ import { Platform, UIManager, findNodeHandle } from 'react-native';
10
10
 
11
11
  export interface AdSize {
12
12
  width?: Double;
@@ -58,18 +58,26 @@ export const AdCommands = {
58
58
  } else {
59
59
  const reactTag = findNodeHandle(viewRef);
60
60
  if (reactTag != null) {
61
- UIManager.dispatchViewManagerCommand(reactTag, 1, [isTestMode]);
61
+ UIManager.dispatchViewManagerCommand(
62
+ reactTag,
63
+ Platform.OS === 'ios' ? 'loadAd' : 1,
64
+ [isTestMode]
65
+ );
62
66
  }
63
67
  }
64
68
  },
65
69
 
66
70
  destroy: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => {
67
- if (Commands?.destroy) {
71
+ if (isFabric) {
68
72
  Commands.destroy(viewRef);
69
73
  } else {
70
74
  const reactTag = findNodeHandle(viewRef);
71
75
  if (reactTag != null) {
72
- UIManager.dispatchViewManagerCommand(reactTag, 2, []);
76
+ UIManager.dispatchViewManagerCommand(
77
+ reactTag,
78
+ Platform.OS === 'ios' ? 'destroy' : 2,
79
+ []
80
+ );
73
81
  }
74
82
  }
75
83
  },
@@ -88,6 +88,8 @@ export interface Spec extends TurboModule {
88
88
  totalPlaybackTime: number
89
89
  ): Promise<string>;
90
90
 
91
+ trackDeeplinkUtm(url: string): void;
92
+
91
93
  // trackVideoQuartile(
92
94
  // campaignId: string,
93
95
  // adSpaceId: string,
@@ -0,0 +1,26 @@
1
+ import Adgeist from '../specs/NativeAdgeist';
2
+
3
+ class AdgeistError extends Error {
4
+ code?: string;
5
+
6
+ constructor(message: string, code?: string) {
7
+ super(message);
8
+ this.name = 'AdgeistError';
9
+ this.code = code;
10
+ Object.setPrototypeOf(this, AdgeistError.prototype);
11
+ }
12
+ }
13
+
14
+ /**
15
+ * @param uri - string
16
+ * @throws AdgeistError if the operation fails
17
+ */
18
+ export const trackConversionsWithDeepLinks = (uri: string): void => {
19
+ try {
20
+ Adgeist.trackDeeplinkUtm(uri);
21
+ } catch (error: unknown) {
22
+ const err =
23
+ error instanceof Error ? error : new Error('Failed to set user details');
24
+ throw new AdgeistError(err.message);
25
+ }
26
+ };