@thealteroffice/react-native-adgeist 0.0.31-beta → 0.0.32-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.
- package/Adgeist.podspec +1 -1
- package/README.md +2 -41
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/adgeist/components/HTML5AdViewManagerImpl.kt +4 -0
- package/android/src/main/java/com/adgeist/modules/AdgeistImpl.kt +11 -25
- package/android/src/main/java/com/adgeist/utils/CreativeExtensions.kt +0 -46
- package/android/src/newarch/java/com/Adgeist.kt +17 -63
- package/android/src/oldarch/java/com/Adgeist.kt +17 -64
- package/ios/Adgeist.mm +0 -4
- package/ios/AdgeistImpl.swift +17 -68
- package/lib/module/constants.js +3 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/AdgeistProvider.js +3 -3
- package/lib/module/providers/AdgeistProvider.js.map +1 -1
- package/lib/module/specs/NativeAdgeist.js.map +1 -1
- package/lib/typescript/src/constants.d.ts +3 -1
- package/lib/typescript/src/constants.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/providers/AdgeistProvider.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeAdgeist.d.ts +0 -1
- package/lib/typescript/src/specs/NativeAdgeist.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/constants.ts +4 -1
- package/src/index.tsx +0 -4
- package/src/providers/AdgeistProvider.tsx +8 -3
- package/src/specs/NativeAdgeist.ts +0 -2
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAdgeistSpec.java +0 -88
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerDelegate.java +0 -55
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerInterface.java +0 -24
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec-generated.cpp +0 -104
- package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec.h +0 -31
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.cpp +0 -60
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.h +0 -49
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.cpp +0 -28
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.h +0 -69
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +0 -150
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +0 -179
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.h +0 -32
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.cpp +0 -16
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.h +0 -29
- package/android/libs/adgeistkit-beta-release.aar +0 -0
- package/lib/module/components/deprecated/BannerAdView.js +0 -375
- package/lib/module/components/deprecated/BannerAdView.js.map +0 -1
- package/lib/module/types/CPMAdResponse.js +0 -2
- package/lib/module/types/CPMAdResponse.js.map +0 -1
- package/lib/module/utmtracker/index.js +0 -25
- package/lib/module/utmtracker/index.js.map +0 -1
- package/lib/typescript/src/components/deprecated/BannerAdView.d.ts +0 -17
- package/lib/typescript/src/components/deprecated/BannerAdView.d.ts.map +0 -1
- package/lib/typescript/src/types/CPMAdResponse.d.ts +0 -29
- package/lib/typescript/src/types/CPMAdResponse.d.ts.map +0 -1
- package/lib/typescript/src/utmtracker/index.d.ts +0 -6
- package/lib/typescript/src/utmtracker/index.d.ts.map +0 -1
- package/src/components/deprecated/BannerAdView.tsx +0 -527
- package/src/types/CPMAdResponse.ts +0 -31
- package/src/utmtracker/index.ts +0 -26
package/Adgeist.podspec
CHANGED
|
@@ -16,7 +16,7 @@ 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.
|
|
19
|
+
s.dependency "AdgeistKit", '= 1.0.15-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.
|
package/README.md
CHANGED
|
@@ -119,45 +119,6 @@ import { HTML5AdView, AdTypes } from '@thealteroffice/react-native-adgeist';
|
|
|
119
119
|
- `AdTypes.COMPANION` - Companion ads (requires minimum 320x320 dimensions)
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
## Support
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Before implementing campaign conversion analytics, ensure your app has deeplink support configured. Refer to these resources for setup guidance:
|
|
127
|
-
|
|
128
|
-
- [React Navigation - Deep Linking](https://reactnavigation.org/docs/deep-linking/)
|
|
129
|
-
- [React Native - Linking](https://reactnative.dev/docs/linking)
|
|
130
|
-
- [Expo - Linking into your app](https://docs.expo.dev/linking/into-your-app/)
|
|
131
|
-
|
|
132
|
-
#### Implementation
|
|
133
|
-
|
|
134
|
-
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.
|
|
135
|
-
|
|
136
|
-
```tsx
|
|
137
|
-
// Example usage with React Navigation
|
|
138
|
-
import { Linking } from 'react-native';
|
|
139
|
-
import { trackConversionsWithDeepLinks } from '@thealteroffice/react-native-adgeist';
|
|
140
|
-
|
|
141
|
-
useEffect(() => {
|
|
142
|
-
const handleUrl = (url: string) => {
|
|
143
|
-
trackConversionsWithDeepLinks(url);
|
|
144
|
-
// Continue with your normal deeplink handling
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
// Handle initial URL if app was opened from link
|
|
148
|
-
Linking.getInitialURL().then((url) => {
|
|
149
|
-
if (url) {
|
|
150
|
-
handleUrl(url);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
// Handle URL changes while app is running
|
|
155
|
-
const subscription = Linking.addEventListener('url', (event) => {
|
|
156
|
-
handleUrl(event.url);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
return () => subscription?.remove();
|
|
160
|
-
}, []);
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
**Important**: This method should be called as early as possible when handling deeplinks to ensure accurate attribution tracking.
|
|
124
|
+
If you run into any difficulties while integrating or using the Adgeist Mobile Ads SDK, reach out to beast@thealteroffice.com and we'll help you get it sorted out.
|
package/android/build.gradle
CHANGED
|
@@ -113,7 +113,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
113
113
|
|
|
114
114
|
dependencies {
|
|
115
115
|
implementation "com.facebook.react:react-android"
|
|
116
|
-
implementation "ai.adgeist:adgeistkit:1.1.
|
|
116
|
+
implementation "ai.adgeist:adgeistkit:1.1.27-beta"
|
|
117
117
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
118
118
|
|
|
119
119
|
/*
|
|
@@ -29,6 +29,10 @@ object HTML5AdViewManagerImpl {
|
|
|
29
29
|
fun createViewInstance(reactContext: ThemedReactContext): AdView {
|
|
30
30
|
Log.d(TAG, "Creating AdView with ThemedReactContext: ${reactContext.hashCode()}")
|
|
31
31
|
val adView = AdView(reactContext)
|
|
32
|
+
// react-native-screens destroys/recreates the host fragment whenever a
|
|
33
|
+
// screen is covered, so fragment onDestroy is not a teardown signal
|
|
34
|
+
// here; RN drives teardown via onDropViewInstance instead
|
|
35
|
+
adView.watchFragmentLifecycle = false
|
|
32
36
|
viewContextMap[System.identityHashCode(adView)] = reactContext
|
|
33
37
|
Log.d(TAG, "AdView created with hash: ${System.identityHashCode(adView)} and context hash: ${reactContext.hashCode()}")
|
|
34
38
|
return adView
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
package com.adgeist.modules
|
|
2
2
|
|
|
3
|
-
import android.net.Uri
|
|
4
3
|
import android.util.Log
|
|
5
4
|
import com.facebook.react.bridge.Promise
|
|
6
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
6
|
import com.adgeistkit.AdgeistCore
|
|
8
7
|
import com.adgeistkit.data.models.AdData
|
|
9
|
-
import com.adgeistkit.data.models.CPMAdResponse
|
|
10
8
|
import com.adgeistkit.data.models.Event
|
|
11
9
|
import com.adgeistkit.data.models.FixedAdResponse
|
|
12
10
|
import com.adgeistkit.data.models.UserDetails
|
|
@@ -15,7 +13,7 @@ import com.adgeistkit.data.network.FetchCreative
|
|
|
15
13
|
|
|
16
14
|
import com.facebook.react.bridge.ReadableMap
|
|
17
15
|
import com.adgeist.utils.toWritableMap
|
|
18
|
-
import com.adgeistkit.request.
|
|
16
|
+
import com.adgeistkit.request.AnalyticsRequest
|
|
19
17
|
|
|
20
18
|
class AdgeistImpl internal constructor(private val context: ReactApplicationContext) {
|
|
21
19
|
private var adgeistInstance: AdgeistCore? = null
|
|
@@ -41,30 +39,23 @@ class AdgeistImpl internal constructor(private val context: ReactApplicationCont
|
|
|
41
39
|
|
|
42
40
|
fun fetchCreative(adSpaceId: String, buyType: String, isTestEnvironment: Boolean, promise: Promise) {
|
|
43
41
|
getAd?.fetchCreative(adSpaceId, buyType, isTestEnvironment) { adData ->
|
|
44
|
-
if (adData != null) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
promise.resolve(response.toWritableMap())
|
|
52
|
-
}
|
|
53
|
-
else -> {
|
|
54
|
-
promise.reject("UNKNOWN_RESPONSE", "Unknown ad response type")
|
|
55
|
-
}
|
|
42
|
+
if (adData.isSuccess && adData.data != null) {
|
|
43
|
+
when (val response = adData.data) {
|
|
44
|
+
is FixedAdResponse -> {
|
|
45
|
+
promise.resolve(response.toWritableMap())
|
|
46
|
+
}
|
|
47
|
+
else -> {
|
|
48
|
+
promise.reject("UNKNOWN_RESPONSE", "Unknown ad response type")
|
|
56
49
|
}
|
|
57
|
-
} else {
|
|
58
|
-
promise.reject("AD_ERROR", adData.errorMessage)
|
|
59
50
|
}
|
|
60
51
|
} else {
|
|
61
|
-
promise.reject("
|
|
52
|
+
promise.reject("AD_ERROR", adData.errorMessage)
|
|
62
53
|
}
|
|
63
54
|
} ?: promise.reject("NOT_INITIALIZED", "SDK not initialized")
|
|
64
55
|
}
|
|
65
56
|
|
|
66
|
-
fun sendCreativeAnalytics(
|
|
67
|
-
postCreativeAnalytic?.
|
|
57
|
+
fun sendCreativeAnalytics(analyticsRequest: AnalyticsRequest, promise: Promise) {
|
|
58
|
+
postCreativeAnalytic?.sendTrackingDataV2(analyticsRequest)
|
|
68
59
|
promise.resolve("Event sent successfully")
|
|
69
60
|
}
|
|
70
61
|
|
|
@@ -110,11 +101,6 @@ class AdgeistImpl internal constructor(private val context: ReactApplicationCont
|
|
|
110
101
|
adgeistInstance?.updateConsentStatus(consent)
|
|
111
102
|
}
|
|
112
103
|
|
|
113
|
-
fun trackDeeplinkUtm(url: String) {
|
|
114
|
-
val uri = Uri.parse(url)
|
|
115
|
-
adgeistInstance?.trackUtmFromDeeplink(uri)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
104
|
companion object {
|
|
119
105
|
const val NAME = "Adgeist"
|
|
120
106
|
}
|
|
@@ -4,52 +4,6 @@ import com.facebook.react.bridge.Arguments
|
|
|
4
4
|
import com.facebook.react.bridge.WritableMap
|
|
5
5
|
import com.adgeistkit.data.models.*
|
|
6
6
|
|
|
7
|
-
fun CPMAdResponse.toWritableMap(): WritableMap {
|
|
8
|
-
val map = Arguments.createMap()
|
|
9
|
-
|
|
10
|
-
map.putBoolean("success", success)
|
|
11
|
-
map.putString("message", message)
|
|
12
|
-
|
|
13
|
-
val dataMap = Arguments.createMap()
|
|
14
|
-
val d = data
|
|
15
|
-
|
|
16
|
-
if (d != null) {
|
|
17
|
-
dataMap.putString("id", d.id)
|
|
18
|
-
dataMap.putString("bidId", d.bidId)
|
|
19
|
-
dataMap.putString("cur", d.cur)
|
|
20
|
-
|
|
21
|
-
val seatBidArray = Arguments.createArray()
|
|
22
|
-
d.seatBid.forEach { seatBid ->
|
|
23
|
-
val seatMap = Arguments.createMap()
|
|
24
|
-
seatMap.putString("bidId", seatBid.bidId)
|
|
25
|
-
|
|
26
|
-
val bidArr = Arguments.createArray()
|
|
27
|
-
seatBid.bid.forEach { bid ->
|
|
28
|
-
val bidMap = Arguments.createMap()
|
|
29
|
-
bidMap.putString("id", bid.id)
|
|
30
|
-
bidMap.putString("impId", bid.impId)
|
|
31
|
-
bidMap.putDouble("price", bid.price)
|
|
32
|
-
|
|
33
|
-
val extMap = Arguments.createMap()
|
|
34
|
-
extMap.putString("creativeUrl", bid.ext.creativeUrl)
|
|
35
|
-
extMap.putString("ctaUrl", bid.ext.ctaUrl)
|
|
36
|
-
extMap.putString("creativeTitle", bid.ext.creativeTitle)
|
|
37
|
-
extMap.putString("creativeDescription", bid.ext.creativeDescription)
|
|
38
|
-
|
|
39
|
-
bidMap.putMap("ext", extMap)
|
|
40
|
-
bidArr.pushMap(bidMap)
|
|
41
|
-
}
|
|
42
|
-
seatMap.putArray("bid", bidArr)
|
|
43
|
-
seatBidArray.pushMap(seatMap)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
dataMap.putArray("seatBid", seatBidArray)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
map.putMap("data", dataMap)
|
|
50
|
-
return map
|
|
51
|
-
}
|
|
52
|
-
|
|
53
7
|
fun FixedAdResponse.toWritableMap(): WritableMap {
|
|
54
8
|
val map = Arguments.createMap()
|
|
55
9
|
|
|
@@ -3,7 +3,7 @@ package com.adgeist
|
|
|
3
3
|
import com.facebook.react.bridge.Promise
|
|
4
4
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
5
|
import com.adgeist.modules.AdgeistImpl
|
|
6
|
-
import com.adgeistkit.request.
|
|
6
|
+
import com.adgeistkit.request.AnalyticsRequest
|
|
7
7
|
import com.facebook.react.bridge.ReadableMap
|
|
8
8
|
|
|
9
9
|
class Adgeist internal constructor(reactContext: ReactApplicationContext) :
|
|
@@ -26,78 +26,36 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
override fun trackImpression(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, renderTime: Double, promise: Promise) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
builder = when (buyType.uppercase()) {
|
|
32
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
33
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
34
|
-
else -> builder
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
implementation.sendCreativeAnalytics(builder.trackImpression(renderTime.toFloat()).build(), promise)
|
|
29
|
+
promise.resolve("trackImpression is not supported on Android")
|
|
38
30
|
}
|
|
39
31
|
|
|
40
32
|
override fun trackView(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, viewTime: Double, visibilityRatio: Double, scrollDepth: Double, timeToVisible: Double, promise: Promise) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
45
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
46
|
-
else -> builder
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
implementation.sendCreativeAnalytics(
|
|
50
|
-
builder.trackViewableImpression(timeToVisible.toFloat(),
|
|
33
|
+
val request = AnalyticsRequest.AnalyticsRequestBuilder(bidMeta, isTestEnvironment)
|
|
34
|
+
.trackViewableImpression(
|
|
35
|
+
timeToVisible.toLong(),
|
|
51
36
|
scrollDepth.toFloat(),
|
|
52
37
|
visibilityRatio.toFloat(),
|
|
53
|
-
viewTime.
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
viewTime.toLong()
|
|
39
|
+
)
|
|
40
|
+
.build()
|
|
41
|
+
|
|
42
|
+
implementation.sendCreativeAnalytics(request, promise)
|
|
56
43
|
}
|
|
57
44
|
|
|
58
45
|
override fun trackTotalView(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, totalViewTime: Double, promise: Promise) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
builder = when (buyType.uppercase()) {
|
|
62
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
63
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
64
|
-
else -> builder
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
implementation.sendCreativeAnalytics(
|
|
68
|
-
builder.trackTotalViewTime(totalViewTime.toFloat()).build(),
|
|
69
|
-
promise
|
|
70
|
-
)
|
|
46
|
+
promise.resolve("trackTotalView is not supported on Android")
|
|
71
47
|
}
|
|
72
48
|
|
|
73
49
|
override fun trackClick(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, promise: Promise) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
else -> builder
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
implementation.sendCreativeAnalytics(
|
|
83
|
-
builder.trackClick().build(),
|
|
84
|
-
promise
|
|
85
|
-
)
|
|
50
|
+
val request = AnalyticsRequest.AnalyticsRequestBuilder(bidMeta, isTestEnvironment)
|
|
51
|
+
.trackClick()
|
|
52
|
+
.build()
|
|
53
|
+
|
|
54
|
+
implementation.sendCreativeAnalytics(request, promise)
|
|
86
55
|
}
|
|
87
56
|
|
|
88
57
|
override fun trackVideoPlayback(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, totalPlaybackTime: Double, promise: Promise) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
builder = when (buyType.uppercase()) {
|
|
92
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
93
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
94
|
-
else -> builder
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
implementation.sendCreativeAnalytics(
|
|
98
|
-
builder.trackTotalPlaybackTime(totalPlaybackTime.toFloat()).build(),
|
|
99
|
-
promise
|
|
100
|
-
)
|
|
58
|
+
promise.resolve("trackVideoPlayback is not supported on Android")
|
|
101
59
|
}
|
|
102
60
|
|
|
103
61
|
override fun setUserDetails(userDetails: ReadableMap) {
|
|
@@ -115,8 +73,4 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
|
|
|
115
73
|
override fun updateConsentStatus(consent: Boolean) {
|
|
116
74
|
implementation.updateConsentStatus(consent)
|
|
117
75
|
}
|
|
118
|
-
|
|
119
|
-
override fun trackDeeplinkUtm(url: String) {
|
|
120
|
-
implementation.trackDeeplinkUtm(url)
|
|
121
|
-
}
|
|
122
76
|
}
|
|
@@ -5,7 +5,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
5
5
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
6
6
|
import com.facebook.react.bridge.ReactMethod
|
|
7
7
|
import com.adgeist.modules.AdgeistImpl
|
|
8
|
-
import com.adgeistkit.request.
|
|
8
|
+
import com.adgeistkit.request.AnalyticsRequest
|
|
9
9
|
import com.facebook.react.bridge.ReadableMap
|
|
10
10
|
|
|
11
11
|
class Adgeist internal constructor(reactContext: ReactApplicationContext) :
|
|
@@ -32,82 +32,40 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
|
|
|
32
32
|
|
|
33
33
|
@ReactMethod
|
|
34
34
|
fun trackImpression(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, renderTime: Double, promise: Promise) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
builder = when (buyType.uppercase()) {
|
|
38
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
39
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
40
|
-
else -> builder
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
implementation.sendCreativeAnalytics(builder.trackImpression(renderTime.toFloat()).build(), promise)
|
|
35
|
+
promise.resolve("trackImpression is not supported on Android")
|
|
44
36
|
}
|
|
45
37
|
|
|
46
38
|
@ReactMethod
|
|
47
39
|
fun trackView(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, viewTime: Double, visibilityRatio: Double, scrollDepth: Double, timeToVisible: Double, promise: Promise) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
52
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
53
|
-
else -> builder
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
implementation.sendCreativeAnalytics(
|
|
57
|
-
builder.trackViewableImpression(timeToVisible.toFloat(),
|
|
40
|
+
val request = AnalyticsRequest.AnalyticsRequestBuilder(bidMeta, isTestEnvironment)
|
|
41
|
+
.trackViewableImpression(
|
|
42
|
+
timeToVisible.toLong(),
|
|
58
43
|
scrollDepth.toFloat(),
|
|
59
44
|
visibilityRatio.toFloat(),
|
|
60
|
-
viewTime.
|
|
61
|
-
|
|
62
|
-
|
|
45
|
+
viewTime.toLong()
|
|
46
|
+
)
|
|
47
|
+
.build()
|
|
48
|
+
|
|
49
|
+
implementation.sendCreativeAnalytics(request, promise)
|
|
63
50
|
}
|
|
64
51
|
|
|
65
52
|
@ReactMethod
|
|
66
53
|
fun trackTotalView(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, totalViewTime: Double, visibilityRatio: Double, promise: Promise) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
builder = when (buyType.uppercase()) {
|
|
70
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
71
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
72
|
-
else -> builder
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
implementation.sendCreativeAnalytics(
|
|
76
|
-
builder.trackTotalViewTime(totalViewTime.toFloat()).build(),
|
|
77
|
-
promise
|
|
78
|
-
)
|
|
54
|
+
promise.resolve("trackTotalView is not supported on Android")
|
|
79
55
|
}
|
|
80
56
|
|
|
81
57
|
@ReactMethod
|
|
82
58
|
fun trackClick(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, promise: Promise) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
else -> builder
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
implementation.sendCreativeAnalytics(
|
|
92
|
-
builder.trackClick().build(),
|
|
93
|
-
promise
|
|
94
|
-
)
|
|
59
|
+
val request = AnalyticsRequest.AnalyticsRequestBuilder(bidMeta, isTestEnvironment)
|
|
60
|
+
.trackClick()
|
|
61
|
+
.build()
|
|
62
|
+
|
|
63
|
+
implementation.sendCreativeAnalytics(request, promise)
|
|
95
64
|
}
|
|
96
65
|
|
|
97
66
|
@ReactMethod
|
|
98
67
|
fun trackVideoPlayback(campaignId: String, adSpaceId: String, bidId: String, bidMeta: String, buyType: String, isTestEnvironment: Boolean, totalPlaybackTime: Double, promise: Promise) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
builder = when (buyType.uppercase()) {
|
|
102
|
-
"CPM" -> builder.buildCPMRequest(campaignId, bidId)
|
|
103
|
-
"FIXED" -> builder.buildFIXEDRequest(bidMeta)
|
|
104
|
-
else -> builder
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
implementation.sendCreativeAnalytics(
|
|
108
|
-
builder.trackTotalPlaybackTime(totalPlaybackTime.toFloat()).build(),
|
|
109
|
-
promise
|
|
110
|
-
)
|
|
68
|
+
promise.resolve("trackVideoPlayback is not supported on Android")
|
|
111
69
|
}
|
|
112
70
|
|
|
113
71
|
@ReactMethod
|
|
@@ -129,9 +87,4 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
|
|
|
129
87
|
fun updateConsentStatus(consent: Boolean) {
|
|
130
88
|
implementation.updateConsentStatus(consent)
|
|
131
89
|
}
|
|
132
|
-
|
|
133
|
-
@ReactMethod
|
|
134
|
-
fun trackDeeplinkUtm(url: String) {
|
|
135
|
-
implementation.trackDeeplinkUtm(url)
|
|
136
|
-
}
|
|
137
90
|
}
|
package/ios/Adgeist.mm
CHANGED
|
@@ -70,10 +70,6 @@ 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
|
-
|
|
77
73
|
RCT_EXPORT_METHOD(logEvent:(NSDictionary *)eventDict) {
|
|
78
74
|
[adgeist logEventWithEventDict:eventDict];
|
|
79
75
|
}
|
package/ios/AdgeistImpl.swift
CHANGED
|
@@ -102,14 +102,6 @@ import React
|
|
|
102
102
|
adgeistInstance?.updateConsentStatus(consent)
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
@objc public func trackDeeplinkUtm(url: String) {
|
|
106
|
-
guard let urlObj = URL(string: url) else {
|
|
107
|
-
print("Invalid URL provided for UTM tracking")
|
|
108
|
-
return
|
|
109
|
-
}
|
|
110
|
-
adgeistInstance?.trackDeeplink(url: urlObj)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
105
|
@objc public func logEvent(eventDict: [String: Any]) {
|
|
114
106
|
let filtered = eventDict.compactMapValues { value -> Any? in
|
|
115
107
|
(value is NSNull) ? nil : value
|
|
@@ -129,11 +121,11 @@ import React
|
|
|
129
121
|
}
|
|
130
122
|
|
|
131
123
|
public func sendCreativeAnalytics(
|
|
132
|
-
analyticsRequest:
|
|
124
|
+
analyticsRequest: AnalyticsRequest,
|
|
133
125
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
134
126
|
rejecter: @escaping RCTPromiseRejectBlock
|
|
135
127
|
) {
|
|
136
|
-
postCreativeAnalytic?.
|
|
128
|
+
postCreativeAnalytic?.sendTrackingDataV2(analyticsRequest: analyticsRequest)
|
|
137
129
|
resolver("Event sent successfully")
|
|
138
130
|
}
|
|
139
131
|
|
|
@@ -148,17 +140,8 @@ import React
|
|
|
148
140
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
149
141
|
rejecter: @escaping RCTPromiseRejectBlock
|
|
150
142
|
) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
let upperBuyType = buyType.uppercased()
|
|
154
|
-
if upperBuyType == "CPM" {
|
|
155
|
-
builder = builder.buildCPMRequest(campaignID: campaignId, bidID: bidId)
|
|
156
|
-
} else if upperBuyType == "FIXED" {
|
|
157
|
-
builder = builder.buildFIXEDRequest(metaData: bidMeta)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
let request = builder.trackImpression(renderTime: renderTime).build()
|
|
161
|
-
sendCreativeAnalytics(analyticsRequest: request, resolver: resolver, rejecter: rejecter)
|
|
143
|
+
// Not supported by AdgeistKit iOS anymore; kept for JS API compatibility
|
|
144
|
+
resolver("trackImpression is not supported on iOS")
|
|
162
145
|
}
|
|
163
146
|
|
|
164
147
|
@objc public func trackView(
|
|
@@ -175,21 +158,13 @@ import React
|
|
|
175
158
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
176
159
|
rejecter: @escaping RCTPromiseRejectBlock
|
|
177
160
|
) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
let request = builder.trackViewableImpression(
|
|
188
|
-
timeToVisible: timeToVisible,
|
|
189
|
-
scrollDepth: scrollDepth,
|
|
190
|
-
visibilityRatio: visibilityRatio,
|
|
191
|
-
viewTime: viewTime
|
|
192
|
-
).build()
|
|
161
|
+
let request = AnalyticsRequest.AnalyticsRequestBuilder(metaData: bidMeta, isTestMode: isTestEnvironment)
|
|
162
|
+
.trackViewableImpression(
|
|
163
|
+
timeToVisible: Int64(timeToVisible),
|
|
164
|
+
scrollDepth: scrollDepth,
|
|
165
|
+
visibilityRatio: visibilityRatio,
|
|
166
|
+
viewTime: Int64(viewTime)
|
|
167
|
+
).build()
|
|
193
168
|
sendCreativeAnalytics(analyticsRequest: request, resolver: resolver, rejecter: rejecter)
|
|
194
169
|
}
|
|
195
170
|
|
|
@@ -205,17 +180,8 @@ import React
|
|
|
205
180
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
206
181
|
rejecter: @escaping RCTPromiseRejectBlock
|
|
207
182
|
) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
let upperBuyType = buyType.uppercased()
|
|
211
|
-
if upperBuyType == "CPM" {
|
|
212
|
-
builder = builder.buildCPMRequest(campaignID: campaignId, bidID: bidId)
|
|
213
|
-
} else if upperBuyType == "FIXED" {
|
|
214
|
-
builder = builder.buildFIXEDRequest(metaData: bidMeta)
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
let request = builder.trackTotalViewTime(totalViewTime: totalViewTime).build()
|
|
218
|
-
sendCreativeAnalytics(analyticsRequest: request, resolver: resolver, rejecter: rejecter)
|
|
183
|
+
// Not supported by AdgeistKit iOS anymore; kept for JS API compatibility
|
|
184
|
+
resolver("trackTotalView is not supported on iOS")
|
|
219
185
|
}
|
|
220
186
|
|
|
221
187
|
@objc public func trackClick(
|
|
@@ -228,16 +194,8 @@ import React
|
|
|
228
194
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
229
195
|
rejecter: @escaping RCTPromiseRejectBlock
|
|
230
196
|
) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
let upperBuyType = buyType.uppercased()
|
|
234
|
-
if upperBuyType == "CPM" {
|
|
235
|
-
builder = builder.buildCPMRequest(campaignID: campaignId, bidID: bidId)
|
|
236
|
-
} else if upperBuyType == "FIXED" {
|
|
237
|
-
builder = builder.buildFIXEDRequest(metaData: bidMeta)
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
let request = builder.trackClick().build()
|
|
197
|
+
let request = AnalyticsRequest.AnalyticsRequestBuilder(metaData: bidMeta, isTestMode: isTestEnvironment)
|
|
198
|
+
.trackClick().build()
|
|
241
199
|
sendCreativeAnalytics(analyticsRequest: request, resolver: resolver, rejecter: rejecter)
|
|
242
200
|
}
|
|
243
201
|
|
|
@@ -252,17 +210,8 @@ import React
|
|
|
252
210
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
253
211
|
rejecter: @escaping RCTPromiseRejectBlock
|
|
254
212
|
) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
let upperBuyType = buyType.uppercased()
|
|
258
|
-
if upperBuyType == "CPM" {
|
|
259
|
-
builder = builder.buildCPMRequest(campaignID: campaignId, bidID: bidId)
|
|
260
|
-
} else if upperBuyType == "FIXED" {
|
|
261
|
-
builder = builder.buildFIXEDRequest(metaData: bidMeta)
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
let request = builder.trackTotalPlaybackTime(totalPlaybackTime: totalPlaybackTime).build()
|
|
265
|
-
sendCreativeAnalytics(analyticsRequest: request, resolver: resolver, rejecter: rejecter)
|
|
213
|
+
// Not supported by AdgeistKit iOS anymore; kept for JS API compatibility
|
|
214
|
+
resolver("trackVideoPlayback is not supported on iOS")
|
|
266
215
|
}
|
|
267
216
|
|
|
268
217
|
// @objc public func trackVideoQuartile(
|
package/lib/module/constants.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export const PACKAGE_VERSION_TAG = 'RN';
|
|
4
|
-
export const PACKAGE_VERSION = '0.0.
|
|
4
|
+
export const PACKAGE_VERSION = '0.0.32';
|
|
5
|
+
export const PACKAGE_SUFFIX = '-beta';
|
|
6
|
+
export const BACKEND_DOMAIN = 'https://beta.v2.bg-services.adgeist.ai';
|
|
5
7
|
export const AdSizes = {
|
|
6
8
|
Responsive: {
|
|
7
9
|
width: -1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PACKAGE_VERSION_TAG","PACKAGE_VERSION","AdSizes","Responsive","width","height","HTML_5_AD_NATIVE_COMPONENT_NAME"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,mBAAmB,GAAG,IAAI;AACvC,OAAO,MAAMC,eAAe,GAAG,
|
|
1
|
+
{"version":3,"names":["PACKAGE_VERSION_TAG","PACKAGE_VERSION","PACKAGE_SUFFIX","BACKEND_DOMAIN","AdSizes","Responsive","width","height","HTML_5_AD_NATIVE_COMPONENT_NAME"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,mBAAmB,GAAG,IAAI;AACvC,OAAO,MAAMC,eAAe,GAAG,QAAQ;AACvC,OAAO,MAAMC,cAAc,GAAG,OAAO;AAErC,OAAO,MAAMC,cAAc,GAAG,wCAAwC;AAEtE,OAAO,MAAMC,OAAO,GAAG;EACrBC,UAAU,EAAE;IAAEC,KAAK,EAAE,CAAC,CAAC;IAAEC,MAAM,EAAE,CAAC;EAAE;AACtC,CAAC;AAED,OAAO,MAAMC,+BAA+B,GAAG,wBAAwB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
export * from "./providers/AdgeistProvider.js";
|
|
4
4
|
export * from "./components/HTML5AdView.js";
|
|
5
|
-
export * from "./components/deprecated/BannerAdView.js";
|
|
6
5
|
export * from "./cdpclient/index.js";
|
|
7
|
-
export * from "./utmtracker/index.js";
|
|
8
6
|
export * from "./types/AdType.js";
|
|
9
7
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,gCAA6B;AAE3C,cAAc,6BAA0B;AAExC,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,gCAA6B;AAE3C,cAAc,6BAA0B;AAExC,cAAc,sBAAmB;AAEjC,cAAc,mBAAgB","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { createContext, useContext, useEffect, useState, useCallback } from 'react';
|
|
4
4
|
import Adgeist from "../specs/NativeAdgeist.js";
|
|
5
5
|
import { ConsentModal } from "../components/deprecated/ConsentModal.js";
|
|
6
|
-
import { PACKAGE_VERSION_TAG, PACKAGE_VERSION } from "../constants.js";
|
|
6
|
+
import { PACKAGE_VERSION_TAG, PACKAGE_VERSION, PACKAGE_SUFFIX, BACKEND_DOMAIN } from "../constants.js";
|
|
7
7
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
const AdgeistContext = /*#__PURE__*/createContext({
|
|
9
9
|
isTestEnvironment: false,
|
|
@@ -12,7 +12,7 @@ const AdgeistContext = /*#__PURE__*/createContext({
|
|
|
12
12
|
});
|
|
13
13
|
export const AdgeistProvider = ({
|
|
14
14
|
children,
|
|
15
|
-
customBidRequestBackendDomain =
|
|
15
|
+
customBidRequestBackendDomain = BACKEND_DOMAIN,
|
|
16
16
|
customPackageOrBundleID = null,
|
|
17
17
|
customAdgeistAppID = null,
|
|
18
18
|
isTestEnvironment = false,
|
|
@@ -36,7 +36,7 @@ export const AdgeistProvider = ({
|
|
|
36
36
|
domain: customBidRequestBackendDomain,
|
|
37
37
|
bundleId: customPackageOrBundleID,
|
|
38
38
|
appId: customAdgeistAppID,
|
|
39
|
-
version: `${PACKAGE_VERSION_TAG}-${PACKAGE_VERSION}`
|
|
39
|
+
version: `${PACKAGE_VERSION_TAG}-${PACKAGE_VERSION}${PACKAGE_SUFFIX}`
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
await Adgeist.initializeSdk(customBidRequestBackendDomain, customPackageOrBundleID, customAdgeistAppID, `${PACKAGE_VERSION_TAG}-${PACKAGE_VERSION}`);
|