@thealteroffice/react-native-adgeist 0.0.15 → 0.0.17
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/android/build.gradle +1 -1
- package/android/generated/java/com/adgeist/NativeAdgeistSpec.java +83 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNAdgeistSpec-generated.cpp +98 -0
- package/android/generated/jni/RNAdgeistSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +149 -0
- package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +170 -0
- package/android/src/main/java/com/adgeist/implementation/AdgeistModuleImpl.kt +101 -9
- package/android/src/newarch/java/com/AdgeistModule.kt +93 -2
- package/android/src/oldarch/java/com/AdgeistModule.kt +101 -4
- package/ios/generated/RNAdgeistSpec/RNAdgeistSpec-generated.mm +42 -7
- package/ios/generated/RNAdgeistSpec/RNAdgeistSpec.h +57 -10
- package/ios/generated/RNAdgeistSpecJSI-generated.cpp +81 -14
- package/ios/generated/RNAdgeistSpecJSI.h +54 -9
- package/lib/module/NativeAdgeist.js.map +1 -1
- package/lib/module/components/BannerAd.js +164 -46
- package/lib/module/components/BannerAd.js.map +1 -1
- package/lib/module/utilities.js +16 -0
- package/lib/module/utilities.js.map +1 -0
- package/lib/typescript/src/NativeAdgeist.d.ts +6 -1
- package/lib/typescript/src/NativeAdgeist.d.ts.map +1 -1
- package/lib/typescript/src/components/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/utilities.d.ts +5 -0
- package/lib/typescript/src/utilities.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/NativeAdgeist.ts +61 -9
- package/src/components/BannerAd.tsx +226 -63
- package/src/utilities.ts +13 -0
|
@@ -43,15 +43,6 @@ class AdgeistModuleImpl internal constructor(private val context: ReactApplicati
|
|
|
43
43
|
} ?: promise.reject("NOT_INITIALIZED", "SDK not initialized")
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
fun sendCreativeAnalytic(campaignId: String, adSpaceId: String, publisherId: String, eventType: String, origin: String, apiKey: String, bidId: String, isTestEnvironment: Boolean = true, promise: Promise) {
|
|
47
|
-
postCreativeAnalytic?.sendTrackingData(campaignId, adSpaceId, publisherId, eventType, origin, apiKey, bidId, isTestEnvironment) { adData ->
|
|
48
|
-
if (adData != null) {
|
|
49
|
-
promise.resolve(adData)
|
|
50
|
-
} else {
|
|
51
|
-
promise.reject("NO_AD", "Couldn't find the campaign to update analytics")
|
|
52
|
-
}
|
|
53
|
-
} ?: promise.reject("NOT_INITIALIZED", "SDK not initialized")
|
|
54
|
-
}
|
|
55
46
|
|
|
56
47
|
fun setUserDetails(userDetailsMap: ReadableMap) {
|
|
57
48
|
val userDetails = UserDetails(
|
|
@@ -93,6 +84,107 @@ class AdgeistModuleImpl internal constructor(private val context: ReactApplicati
|
|
|
93
84
|
adgeistInstance?.updateConsentStatus(consent)
|
|
94
85
|
}
|
|
95
86
|
|
|
87
|
+
fun trackImpression(
|
|
88
|
+
campaignId: String,
|
|
89
|
+
adSpaceId: String,
|
|
90
|
+
publisherId: String,
|
|
91
|
+
apiKey: String,
|
|
92
|
+
bidId: String,
|
|
93
|
+
isTestEnvironment: Boolean,
|
|
94
|
+
renderTime: Float,
|
|
95
|
+
promise: Promise
|
|
96
|
+
) {
|
|
97
|
+
postCreativeAnalytic?.trackImpression(
|
|
98
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, renderTime
|
|
99
|
+
)
|
|
100
|
+
promise.resolve("Impression event sent")
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
fun trackView(
|
|
104
|
+
campaignId: String,
|
|
105
|
+
adSpaceId: String,
|
|
106
|
+
publisherId: String,
|
|
107
|
+
apiKey: String,
|
|
108
|
+
bidId: String,
|
|
109
|
+
isTestEnvironment: Boolean,
|
|
110
|
+
viewTime: Float,
|
|
111
|
+
visibilityRatio: Float,
|
|
112
|
+
scrollDepth: Float,
|
|
113
|
+
timeToVisible: Float,
|
|
114
|
+
promise: Promise
|
|
115
|
+
) {
|
|
116
|
+
postCreativeAnalytic?.trackView(
|
|
117
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment,
|
|
118
|
+
viewTime, visibilityRatio, scrollDepth, timeToVisible
|
|
119
|
+
)
|
|
120
|
+
promise.resolve("View event sent")
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
fun trackTotalView(
|
|
124
|
+
campaignId: String,
|
|
125
|
+
adSpaceId: String,
|
|
126
|
+
publisherId: String,
|
|
127
|
+
apiKey: String,
|
|
128
|
+
bidId: String,
|
|
129
|
+
isTestEnvironment: Boolean,
|
|
130
|
+
totalViewTime: Float,
|
|
131
|
+
visibilityRatio: Float,
|
|
132
|
+
promise: Promise
|
|
133
|
+
) {
|
|
134
|
+
postCreativeAnalytic?.trackTotalView(
|
|
135
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment,
|
|
136
|
+
totalViewTime, visibilityRatio
|
|
137
|
+
)
|
|
138
|
+
promise.resolve("Total view event sent")
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
fun trackClick(
|
|
142
|
+
campaignId: String,
|
|
143
|
+
adSpaceId: String,
|
|
144
|
+
publisherId: String,
|
|
145
|
+
apiKey: String,
|
|
146
|
+
bidId: String,
|
|
147
|
+
isTestEnvironment: Boolean,
|
|
148
|
+
promise: Promise
|
|
149
|
+
) {
|
|
150
|
+
postCreativeAnalytic?.trackClick(
|
|
151
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment
|
|
152
|
+
)
|
|
153
|
+
promise.resolve("Click event sent")
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
fun trackVideoPlayback(
|
|
157
|
+
campaignId: String,
|
|
158
|
+
adSpaceId: String,
|
|
159
|
+
publisherId: String,
|
|
160
|
+
apiKey: String,
|
|
161
|
+
bidId: String,
|
|
162
|
+
isTestEnvironment: Boolean,
|
|
163
|
+
totalPlaybackTime: Float,
|
|
164
|
+
promise: Promise
|
|
165
|
+
) {
|
|
166
|
+
postCreativeAnalytic?.trackVideoPlayback(
|
|
167
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, totalPlaybackTime
|
|
168
|
+
)
|
|
169
|
+
promise.resolve("Video playback event sent")
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
fun trackVideoQuartile(
|
|
173
|
+
campaignId: String,
|
|
174
|
+
adSpaceId: String,
|
|
175
|
+
publisherId: String,
|
|
176
|
+
apiKey: String,
|
|
177
|
+
bidId: String,
|
|
178
|
+
isTestEnvironment: Boolean,
|
|
179
|
+
quartile: String,
|
|
180
|
+
promise: Promise
|
|
181
|
+
) {
|
|
182
|
+
postCreativeAnalytic?.trackVideoQuartile(
|
|
183
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, quartile
|
|
184
|
+
)
|
|
185
|
+
promise.resolve("Video quartile event sent")
|
|
186
|
+
}
|
|
187
|
+
|
|
96
188
|
companion object {
|
|
97
189
|
const val NAME = "Adgeist"
|
|
98
190
|
}
|
|
@@ -22,10 +22,101 @@ class AdgeistModule internal constructor(reactContext: ReactApplicationContext)
|
|
|
22
22
|
implementation.fetchCreative(apiKey, origin, adSpaceId, publisherId, isTestEnvironment, promise)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
override fun
|
|
26
|
-
|
|
25
|
+
override fun trackImpression(
|
|
26
|
+
campaignId: String,
|
|
27
|
+
adSpaceId: String,
|
|
28
|
+
publisherId: String,
|
|
29
|
+
apiKey: String,
|
|
30
|
+
bidId: String,
|
|
31
|
+
isTestEnvironment: Boolean,
|
|
32
|
+
renderTime: Double,
|
|
33
|
+
promise: Promise
|
|
34
|
+
) {
|
|
35
|
+
implementation.trackImpression(
|
|
36
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, renderTime.toFloat(), promise
|
|
37
|
+
)
|
|
27
38
|
}
|
|
28
39
|
|
|
40
|
+
override fun trackView(
|
|
41
|
+
campaignId: String,
|
|
42
|
+
adSpaceId: String,
|
|
43
|
+
publisherId: String,
|
|
44
|
+
apiKey: String,
|
|
45
|
+
bidId: String,
|
|
46
|
+
isTestEnvironment: Boolean,
|
|
47
|
+
viewTime: Double,
|
|
48
|
+
visibilityRatio: Double,
|
|
49
|
+
scrollDepth: Double,
|
|
50
|
+
timeToVisible: Double,
|
|
51
|
+
promise: Promise
|
|
52
|
+
) {
|
|
53
|
+
implementation.trackView(
|
|
54
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment,
|
|
55
|
+
viewTime.toFloat(), visibilityRatio.toFloat(), scrollDepth.toFloat(), timeToVisible.toFloat(), promise
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override fun trackTotalView(
|
|
60
|
+
campaignId: String,
|
|
61
|
+
adSpaceId: String,
|
|
62
|
+
publisherId: String,
|
|
63
|
+
apiKey: String,
|
|
64
|
+
bidId: String,
|
|
65
|
+
isTestEnvironment: Boolean,
|
|
66
|
+
totalViewTime: Double,
|
|
67
|
+
visibilityRatio: Double,
|
|
68
|
+
promise: Promise
|
|
69
|
+
) {
|
|
70
|
+
implementation.trackTotalView(
|
|
71
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment,
|
|
72
|
+
totalViewTime.toFloat(), visibilityRatio.toFloat(), promise
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
override fun trackClick(
|
|
77
|
+
campaignId: String,
|
|
78
|
+
adSpaceId: String,
|
|
79
|
+
publisherId: String,
|
|
80
|
+
apiKey: String,
|
|
81
|
+
bidId: String,
|
|
82
|
+
isTestEnvironment: Boolean,
|
|
83
|
+
promise: Promise
|
|
84
|
+
) {
|
|
85
|
+
implementation.trackClick(
|
|
86
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, promise
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override fun trackVideoPlayback(
|
|
91
|
+
campaignId: String,
|
|
92
|
+
adSpaceId: String,
|
|
93
|
+
publisherId: String,
|
|
94
|
+
apiKey: String,
|
|
95
|
+
bidId: String,
|
|
96
|
+
isTestEnvironment: Boolean,
|
|
97
|
+
totalPlaybackTime: Double,
|
|
98
|
+
promise: Promise
|
|
99
|
+
) {
|
|
100
|
+
implementation.trackVideoPlayback(
|
|
101
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, totalPlaybackTime.toFloat(), promise
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
override fun trackVideoQuartile(
|
|
106
|
+
campaignId: String,
|
|
107
|
+
adSpaceId: String,
|
|
108
|
+
publisherId: String,
|
|
109
|
+
apiKey: String,
|
|
110
|
+
bidId: String,
|
|
111
|
+
isTestEnvironment: Boolean,
|
|
112
|
+
quartile: String,
|
|
113
|
+
promise: Promise
|
|
114
|
+
) {
|
|
115
|
+
implementation.trackVideoQuartile(
|
|
116
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, quartile, promise
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
29
120
|
override fun setUserDetails(userDetails: ReadableMap) {
|
|
30
121
|
implementation.setUserDetails(userDetails)
|
|
31
122
|
}
|
|
@@ -24,10 +24,6 @@ class AdgeistModule internal constructor(reactContext: ReactApplicationContext)
|
|
|
24
24
|
implementation.fetchCreative(apiKey, origin, adSpaceId, publisherId, isTestEnvironment, promise)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@ReactMethod
|
|
28
|
-
fun sendCreativeAnalytic(campaignId: String, adSpaceId: String, publisherId: String, eventType: String, origin: String, apiKey: String, bidId: String, isTestEnvironment: Boolean , promise: Promise) {
|
|
29
|
-
implementation.sendCreativeAnalytic(campaignId, adSpaceId, publisherId, eventType, origin, apiKey, bidId, isTestEnvironment, promise)
|
|
30
|
-
}
|
|
31
27
|
|
|
32
28
|
@ReactMethod
|
|
33
29
|
fun setUserDetails(userDetails: ReadableMap) {
|
|
@@ -48,4 +44,105 @@ class AdgeistModule internal constructor(reactContext: ReactApplicationContext)
|
|
|
48
44
|
fun updateConsentStatus(consent: Boolean) {
|
|
49
45
|
implementation.updateConsentStatus(consent)
|
|
50
46
|
}
|
|
47
|
+
|
|
48
|
+
@ReactMethod
|
|
49
|
+
fun trackImpression(
|
|
50
|
+
campaignId: String,
|
|
51
|
+
adSpaceId: String,
|
|
52
|
+
publisherId: String,
|
|
53
|
+
apiKey: String,
|
|
54
|
+
bidId: String,
|
|
55
|
+
isTestEnvironment: Boolean,
|
|
56
|
+
renderTime: Double,
|
|
57
|
+
promise: Promise
|
|
58
|
+
) {
|
|
59
|
+
implementation.trackImpression(
|
|
60
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, renderTime.toFloat(), promise
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@ReactMethod
|
|
65
|
+
fun trackView(
|
|
66
|
+
campaignId: String,
|
|
67
|
+
adSpaceId: String,
|
|
68
|
+
publisherId: String,
|
|
69
|
+
apiKey: String,
|
|
70
|
+
bidId: String,
|
|
71
|
+
isTestEnvironment: Boolean,
|
|
72
|
+
viewTime: Double,
|
|
73
|
+
visibilityRatio: Double,
|
|
74
|
+
scrollDepth: Double,
|
|
75
|
+
timeToVisible: Double,
|
|
76
|
+
promise: Promise
|
|
77
|
+
) {
|
|
78
|
+
implementation.trackView(
|
|
79
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment,
|
|
80
|
+
viewTime.toFloat(), visibilityRatio.toFloat(), scrollDepth.toFloat(), timeToVisible.toFloat(), promise
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@ReactMethod
|
|
85
|
+
fun trackTotalView(
|
|
86
|
+
campaignId: String,
|
|
87
|
+
adSpaceId: String,
|
|
88
|
+
publisherId: String,
|
|
89
|
+
apiKey: String,
|
|
90
|
+
bidId: String,
|
|
91
|
+
isTestEnvironment: Boolean,
|
|
92
|
+
totalViewTime: Double,
|
|
93
|
+
visibilityRatio: Double,
|
|
94
|
+
promise: Promise
|
|
95
|
+
) {
|
|
96
|
+
implementation.trackTotalView(
|
|
97
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment,
|
|
98
|
+
totalViewTime.toFloat(), visibilityRatio.toFloat(), promise
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@ReactMethod
|
|
103
|
+
fun trackClick(
|
|
104
|
+
campaignId: String,
|
|
105
|
+
adSpaceId: String,
|
|
106
|
+
publisherId: String,
|
|
107
|
+
apiKey: String,
|
|
108
|
+
bidId: String,
|
|
109
|
+
isTestEnvironment: Boolean,
|
|
110
|
+
promise: Promise
|
|
111
|
+
) {
|
|
112
|
+
implementation.trackClick(
|
|
113
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, promise
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@ReactMethod
|
|
118
|
+
fun trackVideoPlayback(
|
|
119
|
+
campaignId: String,
|
|
120
|
+
adSpaceId: String,
|
|
121
|
+
publisherId: String,
|
|
122
|
+
apiKey: String,
|
|
123
|
+
bidId: String,
|
|
124
|
+
isTestEnvironment: Boolean,
|
|
125
|
+
totalPlaybackTime: Double,
|
|
126
|
+
promise: Promise
|
|
127
|
+
) {
|
|
128
|
+
implementation.trackVideoPlayback(
|
|
129
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, totalPlaybackTime.toFloat(), promise
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@ReactMethod
|
|
134
|
+
fun trackVideoQuartile(
|
|
135
|
+
campaignId: String,
|
|
136
|
+
adSpaceId: String,
|
|
137
|
+
publisherId: String,
|
|
138
|
+
apiKey: String,
|
|
139
|
+
bidId: String,
|
|
140
|
+
isTestEnvironment: Boolean,
|
|
141
|
+
quartile: String,
|
|
142
|
+
promise: Promise
|
|
143
|
+
) {
|
|
144
|
+
implementation.trackVideoQuartile(
|
|
145
|
+
campaignId, adSpaceId, publisherId, apiKey, bidId, isTestEnvironment, quartile, promise
|
|
146
|
+
)
|
|
147
|
+
}
|
|
51
148
|
}
|
|
@@ -34,10 +34,6 @@ namespace facebook::react {
|
|
|
34
34
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "fetchCreative", @selector(fetchCreative:origin:adSpaceId:publisherId:isTestEnvironment:resolve:reject:), args, count);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
38
|
-
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "sendCreativeAnalytic", @selector(sendCreativeAnalytic:adSpaceId:publisherId:eventType:origin:apiKey:bidId:isTestEnvironment:resolve:reject:), args, count);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
37
|
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_setUserDetails(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
42
38
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "setUserDetails", @selector(setUserDetails:), args, count);
|
|
43
39
|
}
|
|
@@ -54,6 +50,30 @@ namespace facebook::react {
|
|
|
54
50
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "updateConsentStatus", @selector(updateConsentStatus:), args, count);
|
|
55
51
|
}
|
|
56
52
|
|
|
53
|
+
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackImpression(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
54
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "trackImpression", @selector(trackImpression:adSpaceId:publisherId:apiKey:bidId:isTestEnvironment:renderTime:resolve:reject:), args, count);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
58
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "trackView", @selector(trackView:adSpaceId:publisherId:apiKey:bidId:isTestEnvironment:viewTime:visibilityRatio:scrollDepth:timeToVisible:resolve:reject:), args, count);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackTotalView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
62
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "trackTotalView", @selector(trackTotalView:adSpaceId:publisherId:apiKey:bidId:isTestEnvironment:totalViewTime:visibilityRatio:resolve:reject:), args, count);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackClick(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
66
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "trackClick", @selector(trackClick:adSpaceId:publisherId:apiKey:bidId:isTestEnvironment:resolve:reject:), args, count);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayback(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
70
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "trackVideoPlayback", @selector(trackVideoPlayback:adSpaceId:publisherId:apiKey:bidId:isTestEnvironment:totalPlaybackTime:resolve:reject:), args, count);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackVideoQuartile(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
74
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "trackVideoQuartile", @selector(trackVideoQuartile:adSpaceId:publisherId:apiKey:bidId:isTestEnvironment:quartile:resolve:reject:), args, count);
|
|
75
|
+
}
|
|
76
|
+
|
|
57
77
|
NativeAdgeistSpecJSI::NativeAdgeistSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
58
78
|
: ObjCTurboModule(params) {
|
|
59
79
|
|
|
@@ -63,9 +83,6 @@ namespace facebook::react {
|
|
|
63
83
|
methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
|
|
64
84
|
|
|
65
85
|
|
|
66
|
-
methodMap_["sendCreativeAnalytic"] = MethodMetadata {8, __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic};
|
|
67
|
-
|
|
68
|
-
|
|
69
86
|
methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_setUserDetails};
|
|
70
87
|
|
|
71
88
|
|
|
@@ -77,5 +94,23 @@ namespace facebook::react {
|
|
|
77
94
|
|
|
78
95
|
methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_updateConsentStatus};
|
|
79
96
|
|
|
97
|
+
|
|
98
|
+
methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackImpression};
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistSpecJSI_trackView};
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
methodMap_["trackTotalView"] = MethodMetadata {8, __hostFunction_NativeAdgeistSpecJSI_trackTotalView};
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistSpecJSI_trackClick};
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayback};
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
methodMap_["trackVideoQuartile"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackVideoQuartile};
|
|
114
|
+
|
|
80
115
|
}
|
|
81
116
|
} // namespace facebook::react
|
|
@@ -45,21 +45,68 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
45
45
|
isTestEnvironment:(BOOL)isTestEnvironment
|
|
46
46
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
47
47
|
reject:(RCTPromiseRejectBlock)reject;
|
|
48
|
-
- (void)sendCreativeAnalytic:(NSString *)campaignId
|
|
49
|
-
adSpaceId:(NSString *)adSpaceId
|
|
50
|
-
publisherId:(NSString *)publisherId
|
|
51
|
-
eventType:(NSString *)eventType
|
|
52
|
-
origin:(NSString *)origin
|
|
53
|
-
apiKey:(NSString *)apiKey
|
|
54
|
-
bidId:(NSString *)bidId
|
|
55
|
-
isTestEnvironment:(BOOL)isTestEnvironment
|
|
56
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
57
|
-
reject:(RCTPromiseRejectBlock)reject;
|
|
58
48
|
- (void)setUserDetails:(NSDictionary *)user;
|
|
59
49
|
- (void)logEvent:(NSDictionary *)event;
|
|
60
50
|
- (void)getConsentStatus:(RCTPromiseResolveBlock)resolve
|
|
61
51
|
reject:(RCTPromiseRejectBlock)reject;
|
|
62
52
|
- (void)updateConsentStatus:(BOOL)consent;
|
|
53
|
+
- (void)trackImpression:(NSString *)campaignId
|
|
54
|
+
adSpaceId:(NSString *)adSpaceId
|
|
55
|
+
publisherId:(NSString *)publisherId
|
|
56
|
+
apiKey:(NSString *)apiKey
|
|
57
|
+
bidId:(NSString *)bidId
|
|
58
|
+
isTestEnvironment:(BOOL)isTestEnvironment
|
|
59
|
+
renderTime:(double)renderTime
|
|
60
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
61
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
62
|
+
- (void)trackView:(NSString *)campaignId
|
|
63
|
+
adSpaceId:(NSString *)adSpaceId
|
|
64
|
+
publisherId:(NSString *)publisherId
|
|
65
|
+
apiKey:(NSString *)apiKey
|
|
66
|
+
bidId:(NSString *)bidId
|
|
67
|
+
isTestEnvironment:(BOOL)isTestEnvironment
|
|
68
|
+
viewTime:(double)viewTime
|
|
69
|
+
visibilityRatio:(double)visibilityRatio
|
|
70
|
+
scrollDepth:(double)scrollDepth
|
|
71
|
+
timeToVisible:(double)timeToVisible
|
|
72
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
73
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
74
|
+
- (void)trackTotalView:(NSString *)campaignId
|
|
75
|
+
adSpaceId:(NSString *)adSpaceId
|
|
76
|
+
publisherId:(NSString *)publisherId
|
|
77
|
+
apiKey:(NSString *)apiKey
|
|
78
|
+
bidId:(NSString *)bidId
|
|
79
|
+
isTestEnvironment:(BOOL)isTestEnvironment
|
|
80
|
+
totalViewTime:(double)totalViewTime
|
|
81
|
+
visibilityRatio:(double)visibilityRatio
|
|
82
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
83
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
84
|
+
- (void)trackClick:(NSString *)campaignId
|
|
85
|
+
adSpaceId:(NSString *)adSpaceId
|
|
86
|
+
publisherId:(NSString *)publisherId
|
|
87
|
+
apiKey:(NSString *)apiKey
|
|
88
|
+
bidId:(NSString *)bidId
|
|
89
|
+
isTestEnvironment:(BOOL)isTestEnvironment
|
|
90
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
91
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
92
|
+
- (void)trackVideoPlayback:(NSString *)campaignId
|
|
93
|
+
adSpaceId:(NSString *)adSpaceId
|
|
94
|
+
publisherId:(NSString *)publisherId
|
|
95
|
+
apiKey:(NSString *)apiKey
|
|
96
|
+
bidId:(NSString *)bidId
|
|
97
|
+
isTestEnvironment:(BOOL)isTestEnvironment
|
|
98
|
+
totalPlaybackTime:(double)totalPlaybackTime
|
|
99
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
100
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
101
|
+
- (void)trackVideoQuartile:(NSString *)campaignId
|
|
102
|
+
adSpaceId:(NSString *)adSpaceId
|
|
103
|
+
publisherId:(NSString *)publisherId
|
|
104
|
+
apiKey:(NSString *)apiKey
|
|
105
|
+
bidId:(NSString *)bidId
|
|
106
|
+
isTestEnvironment:(BOOL)isTestEnvironment
|
|
107
|
+
quartile:(NSString *)quartile
|
|
108
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
109
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
63
110
|
|
|
64
111
|
@end
|
|
65
112
|
|
|
@@ -27,19 +27,6 @@ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative(jsi::Runt
|
|
|
27
27
|
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asBool()
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
31
|
-
return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->sendCreativeAnalytic(
|
|
32
|
-
rt,
|
|
33
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
34
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
35
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
36
|
-
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
|
|
37
|
-
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
|
|
38
|
-
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asString(rt),
|
|
39
|
-
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asString(rt),
|
|
40
|
-
count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asBool()
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
30
|
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
44
31
|
static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->setUserDetails(
|
|
45
32
|
rt,
|
|
@@ -66,16 +53,96 @@ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus(jsi
|
|
|
66
53
|
);
|
|
67
54
|
return jsi::Value::undefined();
|
|
68
55
|
}
|
|
56
|
+
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
57
|
+
return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackImpression(
|
|
58
|
+
rt,
|
|
59
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
60
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
61
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
62
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
|
|
63
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
|
|
64
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
|
|
65
|
+
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
69
|
+
return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackView(
|
|
70
|
+
rt,
|
|
71
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
72
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
73
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
74
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
|
|
75
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
|
|
76
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
|
|
77
|
+
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber(),
|
|
78
|
+
count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber(),
|
|
79
|
+
count <= 8 ? throw jsi::JSError(rt, "Expected argument in position 8 to be passed") : args[8].asNumber(),
|
|
80
|
+
count <= 9 ? throw jsi::JSError(rt, "Expected argument in position 9 to be passed") : args[9].asNumber()
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
84
|
+
return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackTotalView(
|
|
85
|
+
rt,
|
|
86
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
87
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
88
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
89
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
|
|
90
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
|
|
91
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
|
|
92
|
+
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber(),
|
|
93
|
+
count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber()
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackClick(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
97
|
+
return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackClick(
|
|
98
|
+
rt,
|
|
99
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
100
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
101
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
102
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
|
|
103
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
|
|
104
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool()
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
108
|
+
return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackVideoPlayback(
|
|
109
|
+
rt,
|
|
110
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
111
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
112
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
113
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
|
|
114
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
|
|
115
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
|
|
116
|
+
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoQuartile(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
120
|
+
return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackVideoQuartile(
|
|
121
|
+
rt,
|
|
122
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
123
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
124
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
125
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
|
|
126
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
|
|
127
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
|
|
128
|
+
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asString(rt)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
69
131
|
|
|
70
132
|
NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
71
133
|
: TurboModule("Adgeist", jsInvoker) {
|
|
72
134
|
methodMap_["initializeSdk"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk};
|
|
73
135
|
methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
|
|
74
|
-
methodMap_["sendCreativeAnalytic"] = MethodMetadata {8, __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic};
|
|
75
136
|
methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails};
|
|
76
137
|
methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_logEvent};
|
|
77
138
|
methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus};
|
|
78
139
|
methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus};
|
|
140
|
+
methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression};
|
|
141
|
+
methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistCxxSpecJSI_trackView};
|
|
142
|
+
methodMap_["trackTotalView"] = MethodMetadata {8, __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView};
|
|
143
|
+
methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistCxxSpecJSI_trackClick};
|
|
144
|
+
methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback};
|
|
145
|
+
methodMap_["trackVideoQuartile"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoQuartile};
|
|
79
146
|
}
|
|
80
147
|
|
|
81
148
|
|