cloudx-react-native 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/android/build.gradle +91 -2
  2. package/android/src/main/java/com/cloudxreactnative/CloudXAdViewEvent.kt +2 -2
  3. package/android/src/main/java/com/cloudxreactnative/CloudXAdViewManagerImpl.kt +6 -6
  4. package/android/src/main/java/com/cloudxreactnative/CloudXModuleImpl.kt +73 -1
  5. package/android/src/test/java/com/cloudxreactnative/CloudXModuleImplArbiterBidsTest.kt +254 -0
  6. package/android/src/test/java/com/cloudxreactnative/FakeReadable.kt +101 -0
  7. package/cloudx-react-native.podspec +1 -1
  8. package/ios/CloudX.mm +91 -4
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/types/Arbiter.js +33 -0
  11. package/lib/commonjs/types/Arbiter.js.map +1 -1
  12. package/lib/commonjs/types/RevenueData.js +1 -0
  13. package/lib/commonjs/types/RevenueData.js.map +1 -1
  14. package/lib/commonjs/types/index.js.map +1 -1
  15. package/lib/commonjs/version.js +1 -1
  16. package/lib/module/index.js.map +1 -1
  17. package/lib/module/types/Arbiter.js +33 -0
  18. package/lib/module/types/Arbiter.js.map +1 -1
  19. package/lib/module/types/RevenueData.js +1 -0
  20. package/lib/module/types/RevenueData.js.map +1 -1
  21. package/lib/module/types/index.js.map +1 -1
  22. package/lib/module/version.js +1 -1
  23. package/lib/typescript/src/index.d.ts +1 -1
  24. package/lib/typescript/src/index.d.ts.map +1 -1
  25. package/lib/typescript/src/types/Arbiter.d.ts +55 -2
  26. package/lib/typescript/src/types/Arbiter.d.ts.map +1 -1
  27. package/lib/typescript/src/types/RevenueData.d.ts +1 -0
  28. package/lib/typescript/src/types/RevenueData.d.ts.map +1 -1
  29. package/lib/typescript/src/types/index.d.ts +1 -1
  30. package/lib/typescript/src/types/index.d.ts.map +1 -1
  31. package/lib/typescript/src/version.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/src/index.ts +3 -0
  34. package/src/types/Arbiter.ts +79 -2
  35. package/src/types/RevenueData.ts +1 -0
  36. package/src/types/index.ts +3 -0
  37. package/src/version.ts +1 -1
@@ -1,3 +1,5 @@
1
+ import groovy.json.JsonSlurper
2
+
1
3
  buildscript {
2
4
  repositories {
3
5
  google()
@@ -8,10 +10,87 @@ buildscript {
8
10
  }
9
11
  }
10
12
 
11
- def isNewArchitectureEnabled() {
13
+ def resolveReactNativePackageJsonWithNode() {
14
+ def stdout = new ByteArrayOutputStream()
15
+ def stderr = new ByteArrayOutputStream()
16
+
17
+ try {
18
+ def result = exec {
19
+ workingDir rootProject.projectDir
20
+ commandLine "node", "--print", "require.resolve('react-native/package.json', { paths: [process.cwd()] })"
21
+ standardOutput = stdout
22
+ errorOutput = stderr
23
+ ignoreExitValue = true
24
+ }
25
+
26
+ def resolvedPath = stdout.toString().trim()
27
+ if (result.exitValue == 0 && resolvedPath) {
28
+ def packageJson = file(resolvedPath)
29
+ if (packageJson.exists()) {
30
+ return packageJson
31
+ }
32
+ }
33
+ } catch (Exception ignored) {
34
+ return null
35
+ }
36
+
37
+ return null
38
+ }
39
+
40
+ def resolveReactNativePackageJson() {
41
+ def packageJson = resolveReactNativePackageJsonWithNode()
42
+ if (packageJson != null) {
43
+ return packageJson
44
+ }
45
+
46
+ packageJson = file("$rootProject.projectDir/../node_modules/react-native/package.json")
47
+ if (packageJson.exists()) {
48
+ return packageJson
49
+ }
50
+
51
+ logger.warn("CloudX React Native: could not find react-native/package.json; falling back to newArchEnabled.")
52
+ return null
53
+ }
54
+
55
+ def getReactNativeVersion() {
56
+ def packageJson = resolveReactNativePackageJson()
57
+ if (packageJson == null) {
58
+ return null
59
+ }
60
+
61
+ def parsedPackageJson = new JsonSlurper().parseText(packageJson.text)
62
+ return parsedPackageJson.version as String
63
+ }
64
+
65
+ def isReactNativeNewArchitectureOnly() {
66
+ def version = getReactNativeVersion()
67
+ if (version == null) {
68
+ return false
69
+ }
70
+
71
+ def matcher = version =~ /^(\d+)\.(\d+)\..*$/
72
+ if (!matcher.matches()) {
73
+ return false
74
+ }
75
+
76
+ def major = matcher[0][1].toInteger()
77
+ def minor = matcher[0][2].toInteger()
78
+ return major > 0 || (major == 0 && minor >= 82)
79
+ }
80
+
81
+ def isNewArchitectureEnabledByProperty() {
12
82
  return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
13
83
  }
14
84
 
85
+ def isNewArchitectureEnabled() {
86
+ /*
87
+ * React Native 0.82+ is New Architecture-only and ignores attempts to opt
88
+ * back into Legacy Architecture, so CloudX must build its codegen-backed
89
+ * Android sources for those host apps regardless of the app flag.
90
+ */
91
+ return isReactNativeNewArchitectureOnly() || isNewArchitectureEnabledByProperty()
92
+ }
93
+
15
94
  apply plugin: "com.android.library"
16
95
  apply plugin: "kotlin-android"
17
96
 
@@ -54,6 +133,13 @@ android {
54
133
  }
55
134
  }
56
135
 
136
+ testOptions {
137
+ unitTests {
138
+ // android.util.Log is a stub that throws in plain JVM unit tests.
139
+ returnDefaultValues = true
140
+ }
141
+ }
142
+
57
143
  compileOptions {
58
144
  sourceCompatibility JavaVersion.VERSION_17
59
145
  targetCompatibility JavaVersion.VERSION_17
@@ -72,5 +158,8 @@ repositories {
72
158
  dependencies {
73
159
  implementation "com.facebook.react:react-native:0.76.2"
74
160
 
75
- implementation "io.cloudx:sdk:4.4.0"
161
+ implementation "io.cloudx:sdk:4.5.0"
162
+
163
+ testImplementation "junit:junit:4.13.2"
164
+ testImplementation "io.mockk:mockk:1.13.10"
76
165
  }
@@ -10,11 +10,11 @@ import com.facebook.react.uimanager.events.Event
10
10
  class CloudXAdViewEvent(
11
11
  surfaceId: Int,
12
12
  viewId: Int,
13
- private val eventName: String,
13
+ private val registrationName: String,
14
14
  private val payload: WritableMap,
15
15
  ) : Event<CloudXAdViewEvent>(surfaceId, viewId) {
16
16
 
17
- override fun getEventName(): String = eventName
17
+ override fun getEventName(): String = registrationName
18
18
 
19
19
  override fun getEventData(): WritableMap = payload
20
20
 
@@ -15,12 +15,12 @@ object CloudXAdViewManagerImpl {
15
15
  fun createViewInstance(reactContext: ThemedReactContext): CloudXAdView = CloudXAdView(reactContext)
16
16
 
17
17
  fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any> =
18
- MapBuilder.builder<String, Any>()
19
- .put(CloudXAdEvents.ON_AD_VIEW_LOADED_EVENT, eventRegistration(CloudXAdEvents.ON_AD_VIEW_LOADED_EVENT))
20
- .put(CloudXAdEvents.ON_AD_VIEW_LOAD_FAILED_EVENT, eventRegistration(CloudXAdEvents.ON_AD_VIEW_LOAD_FAILED_EVENT))
21
- .put(CloudXAdEvents.ON_AD_VIEW_CLICKED_EVENT, eventRegistration(CloudXAdEvents.ON_AD_VIEW_CLICKED_EVENT))
22
- .put(CloudXAdEvents.ON_AD_VIEW_REVENUE_PAID_EVENT, eventRegistration(CloudXAdEvents.ON_AD_VIEW_REVENUE_PAID_EVENT))
23
- .build()
18
+ mutableMapOf(
19
+ CloudXAdEvents.ON_AD_VIEW_LOADED_EVENT to eventRegistration(CloudXAdEvents.ON_AD_VIEW_LOADED_EVENT),
20
+ CloudXAdEvents.ON_AD_VIEW_LOAD_FAILED_EVENT to eventRegistration(CloudXAdEvents.ON_AD_VIEW_LOAD_FAILED_EVENT),
21
+ CloudXAdEvents.ON_AD_VIEW_CLICKED_EVENT to eventRegistration(CloudXAdEvents.ON_AD_VIEW_CLICKED_EVENT),
22
+ CloudXAdEvents.ON_AD_VIEW_REVENUE_PAID_EVENT to eventRegistration(CloudXAdEvents.ON_AD_VIEW_REVENUE_PAID_EVENT),
23
+ )
24
24
 
25
25
  private fun eventRegistration(name: String): Map<String, String> = MapBuilder.of("registrationName", name)
26
26
 
@@ -26,6 +26,7 @@ import io.cloudx.sdk.CloudXAdViewListener
26
26
  import io.cloudx.sdk.CloudXArbiterBid
27
27
  import io.cloudx.sdk.CloudXArbiterConfiguration
28
28
  import io.cloudx.sdk.CloudXArbiterListener
29
+ import io.cloudx.sdk.CloudXArbiterPrecision
29
30
  import io.cloudx.sdk.CloudXArbiterResult
30
31
  import io.cloudx.sdk.CloudXError
31
32
  import io.cloudx.sdk.CloudXInitializationConfiguration
@@ -70,6 +71,8 @@ class CloudXModuleImpl(private val reactApplicationContext: ReactApplicationCont
70
71
 
71
72
  companion object {
72
73
  private const val TAG = "CloudX"
74
+ private const val ADMOB_DEFAULT_NETWORK_NAME = "admob"
75
+ private const val GAM_DEFAULT_NETWORK_NAME = "gam"
73
76
  const val MODULE_NAME = "CloudX"
74
77
  }
75
78
 
@@ -181,6 +184,11 @@ class CloudXModuleImpl(private val reactApplicationContext: ReactApplicationCont
181
184
 
182
185
  fun arbiter(configuration: ReadableMap, promise: Promise) {
183
186
  val bids = arbiterBids(configuration)
187
+ if (bids.isEmpty()) {
188
+ promise.resolve(emptyArbiterResult())
189
+ return
190
+ }
191
+
184
192
  val arbiterConfiguration = CloudXArbiterConfiguration.builder(bids).build()
185
193
  CloudX.arbiter(arbiterConfiguration, object : CloudXArbiterListener {
186
194
  override fun onCompleted(result: CloudXArbiterResult) {
@@ -569,7 +577,8 @@ class CloudXModuleImpl(private val reactApplicationContext: ReactApplicationCont
569
577
  CloudXExtraParameters.applyToAdView(adView, pending)
570
578
  }
571
579
 
572
- private fun arbiterBids(configuration: ReadableMap): List<CloudXArbiterBid> {
580
+ // internal rather than private so unit tests can exercise bid parsing directly.
581
+ internal fun arbiterBids(configuration: ReadableMap): List<CloudXArbiterBid> {
573
582
  if (!configuration.hasKey("bids") || configuration.getType("bids") != ReadableType.Array) {
574
583
  return emptyList()
575
584
  }
@@ -596,6 +605,9 @@ class CloudXModuleImpl(private val reactApplicationContext: ReactApplicationCont
596
605
  "CLOUDX" -> cloudXArbiterBid(index)
597
606
  "LEVELPLAY" -> levelPlayArbiterBid(index)
598
607
  "PUBMATIC" -> pubMaticArbiterBid(index)
608
+ "CUSTOM" -> customArbiterBid(index)
609
+ "ADMOB" -> adMobArbiterBid(index)
610
+ "GAM" -> gamArbiterBid(index)
599
611
  else -> {
600
612
  Log.w(TAG, "arbiter: ignoring bid with unsupported platform=$platform at index=$index")
601
613
  null
@@ -662,6 +674,54 @@ class CloudXModuleImpl(private val reactApplicationContext: ReactApplicationCont
662
674
  )
663
675
  }
664
676
 
677
+ private fun ReadableMap.customArbiterBid(index: Int): CloudXArbiterBid? {
678
+ val platformName = stringValue("platformName")
679
+ val revenuePerImpressionUSD = doubleValue("revenuePerImpressionUSD")
680
+ val precision = stringValue("precision")
681
+ if (platformName.isNullOrBlank() || revenuePerImpressionUSD == null || precision.isNullOrBlank()) {
682
+ Log.w(TAG, "arbiter: ignoring CUSTOM bid with missing required fields at index=$index")
683
+ return null
684
+ }
685
+
686
+ return CloudXArbiterBid.custom(
687
+ platformName = platformName,
688
+ networkName = optionalStringValue("networkName").orEmpty(),
689
+ revenuePerImpressionUSD = revenuePerImpressionUSD,
690
+ precision = CloudXArbiterPrecision.of(precision),
691
+ extras = stringMapValue("extras"),
692
+ )
693
+ }
694
+
695
+ private fun ReadableMap.adMobArbiterBid(index: Int): CloudXArbiterBid? {
696
+ val adUnitId = stringValue("adUnitId")
697
+ if (adUnitId.isNullOrBlank()) {
698
+ Log.w(TAG, "arbiter: ignoring ADMOB bid with missing adUnitId at index=$index")
699
+ return null
700
+ }
701
+
702
+ return CloudXArbiterBid.adMob(
703
+ adUnitId = adUnitId,
704
+ networkName = optionalStringValue("networkName") ?: ADMOB_DEFAULT_NETWORK_NAME,
705
+ manualRevenuePerImpressionUSD = doubleValue("manualRevenuePerImpressionUSD"),
706
+ extras = stringMapValue("extras"),
707
+ )
708
+ }
709
+
710
+ private fun ReadableMap.gamArbiterBid(index: Int): CloudXArbiterBid? {
711
+ val adUnitId = stringValue("adUnitId")
712
+ if (adUnitId.isNullOrBlank()) {
713
+ Log.w(TAG, "arbiter: ignoring GAM bid with missing adUnitId at index=$index")
714
+ return null
715
+ }
716
+
717
+ return CloudXArbiterBid.gam(
718
+ adUnitId = adUnitId,
719
+ networkName = optionalStringValue("networkName") ?: GAM_DEFAULT_NETWORK_NAME,
720
+ manualRevenuePerImpressionUSD = doubleValue("manualRevenuePerImpressionUSD"),
721
+ extras = stringMapValue("extras"),
722
+ )
723
+ }
724
+
665
725
  private fun ReadableMap.toRevenueData(): CloudXRevenueData? {
666
726
  val platform = stringValue("platform")
667
727
  val revenuePlatform = platform?.toRevenuePlatformOrNull()
@@ -698,6 +758,7 @@ class CloudXModuleImpl(private val reactApplicationContext: ReactApplicationCont
698
758
  if (platform.isBlank()) return null
699
759
  return when {
700
760
  platform.equals("AdMob", ignoreCase = true) -> CloudXRevenuePlatform.ADMOB
761
+ platform.equals("GAM", ignoreCase = true) -> CloudXRevenuePlatform.GAM
701
762
  platform.equals("InMobi", ignoreCase = true) -> CloudXRevenuePlatform.INMOBI
702
763
  else -> CloudXRevenuePlatform.custom(platform)
703
764
  }
@@ -749,10 +810,21 @@ class CloudXModuleImpl(private val reactApplicationContext: ReactApplicationCont
749
810
  return result
750
811
  }
751
812
 
813
+ private fun emptyArbiterResult(): WritableMap {
814
+ val map = Arguments.createMap()
815
+ map.putString("id", "")
816
+ map.putString("platform", "NONE")
817
+ map.putString("platformName", "NONE")
818
+ map.putNull("bidId")
819
+ map.putMap("extras", Arguments.createMap())
820
+ return map
821
+ }
822
+
752
823
  private fun CloudXArbiterResult.toWritableMap(): WritableMap {
753
824
  val map = Arguments.createMap()
754
825
  map.putString("id", id)
755
826
  map.putString("platform", platform.name)
827
+ map.putString("platformName", platformName)
756
828
  map.putString("bidId", bidId)
757
829
  map.putMap("extras", extras.toWritableMap())
758
830
  return map
@@ -0,0 +1,254 @@
1
+ package com.cloudxreactnative
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import io.cloudx.sdk.CloudXArbiterBid
5
+ import io.cloudx.sdk.CloudXArbiterPlatform
6
+ import io.mockk.every
7
+ import io.mockk.mockk
8
+ import org.junit.Assert.assertEquals
9
+ import org.junit.Assert.assertNull
10
+ import org.junit.Assert.assertTrue
11
+ import org.junit.Test
12
+
13
+ /**
14
+ * Covers ADMOB bid parsing in [CloudXModuleImpl.arbiterBids], including coexistence with the
15
+ * pre-existing bid platforms.
16
+ *
17
+ * The SDK's AdMobBid class is internal to io.cloudx.sdk, so its adUnitId / networkName /
18
+ * manualRevenuePerImpressionUSD are not visible from this module. Assertions read them back by
19
+ * reflection; platform and extras come off the public CloudXArbiterBid surface.
20
+ */
21
+ class CloudXModuleImplArbiterBidsTest {
22
+
23
+ // arbiterBids never touches the context, but the constructor registers a lifecycle listener.
24
+ private fun module(): CloudXModuleImpl {
25
+ val context = mockk<ReactApplicationContext>(relaxed = true)
26
+ every { context.addLifecycleEventListener(any()) } returns Unit
27
+ return CloudXModuleImpl(context)
28
+ }
29
+
30
+ private fun bidsFrom(vararg bids: Map<String, Any?>): List<CloudXArbiterBid> {
31
+ val configuration = FakeReadableMap(
32
+ mapOf("bids" to FakeReadableArray(bids.map { FakeReadableMap(it) }))
33
+ )
34
+ return module().arbiterBids(configuration)
35
+ }
36
+
37
+ private fun CloudXArbiterBid.field(name: String): Any? {
38
+ val field = javaClass.getDeclaredField(name)
39
+ field.isAccessible = true
40
+ return field.get(this)
41
+ }
42
+
43
+ @Test
44
+ fun `routes ADMOB platform to an AdMob bid`() {
45
+ val bids = bidsFrom(mapOf("platform" to "ADMOB", "adUnitId" to "unit-1"))
46
+
47
+ assertEquals(1, bids.size)
48
+ assertEquals(CloudXArbiterPlatform.ADMOB, bids[0].platform)
49
+ assertEquals("unit-1", bids[0].field("adUnitId"))
50
+ }
51
+
52
+ @Test
53
+ fun `accepts a lowercase platform token`() {
54
+ val bids = bidsFrom(mapOf("platform" to "admob", "adUnitId" to "unit-1"))
55
+
56
+ assertEquals(1, bids.size)
57
+ assertEquals(CloudXArbiterPlatform.ADMOB, bids[0].platform)
58
+ }
59
+
60
+ @Test
61
+ fun `defaults networkName to admob when absent`() {
62
+ val bids = bidsFrom(mapOf("platform" to "ADMOB", "adUnitId" to "unit-1"))
63
+
64
+ assertEquals("admob", bids[0].field("networkName"))
65
+ }
66
+
67
+ @Test
68
+ fun `defaults networkName to admob when blank`() {
69
+ val bids = bidsFrom(
70
+ mapOf("platform" to "ADMOB", "adUnitId" to "unit-1", "networkName" to " ")
71
+ )
72
+
73
+ assertEquals("admob", bids[0].field("networkName"))
74
+ }
75
+
76
+ @Test
77
+ fun `passes an explicit networkName through`() {
78
+ val bids = bidsFrom(
79
+ mapOf("platform" to "ADMOB", "adUnitId" to "unit-1", "networkName" to "applovin")
80
+ )
81
+
82
+ assertEquals("applovin", bids[0].field("networkName"))
83
+ }
84
+
85
+ @Test
86
+ fun `drops a bid with a missing adUnitId`() {
87
+ val bids = bidsFrom(mapOf("platform" to "ADMOB"))
88
+
89
+ assertTrue(bids.isEmpty())
90
+ }
91
+
92
+ @Test
93
+ fun `drops a bid with a blank adUnitId`() {
94
+ val bids = bidsFrom(mapOf("platform" to "ADMOB", "adUnitId" to " "))
95
+
96
+ assertTrue(bids.isEmpty())
97
+ }
98
+
99
+ @Test
100
+ fun `keeps surrounding bids when one ADMOB bid is dropped`() {
101
+ val bids = bidsFrom(
102
+ mapOf("platform" to "ADMOB", "adUnitId" to ""),
103
+ mapOf("platform" to "ADMOB", "adUnitId" to "unit-2"),
104
+ )
105
+
106
+ assertEquals(1, bids.size)
107
+ assertEquals("unit-2", bids[0].field("adUnitId"))
108
+ }
109
+
110
+ @Test
111
+ fun `carries a manual price when present`() {
112
+ val bids = bidsFrom(
113
+ mapOf(
114
+ "platform" to "ADMOB",
115
+ "adUnitId" to "unit-1",
116
+ "manualRevenuePerImpressionUSD" to 0.004,
117
+ )
118
+ )
119
+
120
+ assertEquals(0.004, bids[0].field("manualRevenuePerImpressionUSD") as Double, 1e-9)
121
+ }
122
+
123
+ @Test
124
+ fun `leaves the manual price null when absent`() {
125
+ val bids = bidsFrom(mapOf("platform" to "ADMOB", "adUnitId" to "unit-1"))
126
+
127
+ assertNull(bids[0].field("manualRevenuePerImpressionUSD"))
128
+ }
129
+
130
+ @Test
131
+ fun `keeps a zero manual price distinct from absent`() {
132
+ val bids = bidsFrom(
133
+ mapOf(
134
+ "platform" to "ADMOB",
135
+ "adUnitId" to "unit-1",
136
+ "manualRevenuePerImpressionUSD" to 0.0,
137
+ )
138
+ )
139
+
140
+ assertEquals(0.0, bids[0].field("manualRevenuePerImpressionUSD") as Double, 1e-9)
141
+ }
142
+
143
+ @Test
144
+ fun `forwards a negative manual price unchanged`() {
145
+ val bids = bidsFrom(
146
+ mapOf(
147
+ "platform" to "ADMOB",
148
+ "adUnitId" to "unit-1",
149
+ "manualRevenuePerImpressionUSD" to -1.5,
150
+ )
151
+ )
152
+
153
+ // The wrapper is transparent about the value it was handed; the native SDK decides to drop it.
154
+ assertEquals(-1.5, bids[0].field("manualRevenuePerImpressionUSD") as Double, 1e-9)
155
+ }
156
+
157
+ @Test
158
+ fun `maps a CUSTOM bid alongside an ADMOB bid in order`() {
159
+ val bids = bidsFrom(
160
+ mapOf(
161
+ "platform" to "CUSTOM",
162
+ "platformName" to "CUSTOM_MEDIATOR",
163
+ "revenuePerImpressionUSD" to 0.002,
164
+ "precision" to "exact",
165
+ ),
166
+ mapOf("platform" to "ADMOB", "adUnitId" to "unit-2"),
167
+ )
168
+
169
+ assertEquals(2, bids.size)
170
+ assertEquals(CloudXArbiterPlatform.CUSTOM, bids[0].platform)
171
+ assertEquals("CUSTOM_MEDIATOR", bids[0].platformName)
172
+ assertEquals(CloudXArbiterPlatform.ADMOB, bids[1].platform)
173
+ assertEquals("unit-2", bids[1].field("adUnitId"))
174
+ }
175
+
176
+ @Test
177
+ fun `maps string extras and skips non-string entries`() {
178
+ val bids = bidsFrom(
179
+ mapOf(
180
+ "platform" to "ADMOB",
181
+ "adUnitId" to "unit-1",
182
+ "extras" to FakeReadableMap(mapOf("k" to "v", "n" to 1.0)),
183
+ )
184
+ )
185
+
186
+ assertEquals(mapOf("k" to "v"), bids[0].extras)
187
+ }
188
+
189
+ @Test
190
+ fun `defaults extras to empty when absent`() {
191
+ val bids = bidsFrom(mapOf("platform" to "ADMOB", "adUnitId" to "unit-1"))
192
+
193
+ assertEquals(emptyMap<String, String>(), bids[0].extras)
194
+ }
195
+
196
+ @Test
197
+ fun `routes GAM platform to a Gam bid with default networkName`() {
198
+ val bids = bidsFrom(mapOf("platform" to "GAM", "adUnitId" to "/21775744923/example/banner"))
199
+
200
+ assertEquals(1, bids.size)
201
+ assertEquals(CloudXArbiterPlatform.GAM, bids[0].platform)
202
+ assertEquals("/21775744923/example/banner", bids[0].field("adUnitId"))
203
+ assertEquals("gam", bids[0].field("networkName"))
204
+ }
205
+
206
+ @Test
207
+ fun `carries GAM manual price and extras through`() {
208
+ val bids = bidsFrom(
209
+ mapOf(
210
+ "platform" to "GAM",
211
+ "adUnitId" to "/21775744923/example/banner",
212
+ "networkName" to "reservation",
213
+ "manualRevenuePerImpressionUSD" to 0.0025,
214
+ "extras" to FakeReadableMap(mapOf("k" to "v")),
215
+ )
216
+ )
217
+
218
+ assertEquals("reservation", bids[0].field("networkName"))
219
+ assertEquals(0.0025, bids[0].field("manualRevenuePerImpressionUSD") as Double, 1e-9)
220
+ assertEquals(mapOf("k" to "v"), bids[0].extras)
221
+ }
222
+
223
+ @Test
224
+ fun `keeps a zero GAM manual price distinct from absent`() {
225
+ val bids = bidsFrom(
226
+ mapOf(
227
+ "platform" to "GAM",
228
+ "adUnitId" to "/21775744923/example/banner",
229
+ "manualRevenuePerImpressionUSD" to 0.0,
230
+ )
231
+ )
232
+
233
+ assertEquals(0.0, bids[0].field("manualRevenuePerImpressionUSD") as Double, 1e-9)
234
+ }
235
+
236
+ @Test
237
+ fun `drops a GAM bid with a blank adUnitId`() {
238
+ val bids = bidsFrom(mapOf("platform" to "GAM", "adUnitId" to " "))
239
+
240
+ assertTrue(bids.isEmpty())
241
+ }
242
+
243
+ @Test
244
+ fun `maps an ADMOB bid alongside a GAM bid in order`() {
245
+ val bids = bidsFrom(
246
+ mapOf("platform" to "ADMOB", "adUnitId" to "ca-app-pub-1/2"),
247
+ mapOf("platform" to "GAM", "adUnitId" to "/21775744923/example/banner"),
248
+ )
249
+
250
+ assertEquals(2, bids.size)
251
+ assertEquals(CloudXArbiterPlatform.ADMOB, bids[0].platform)
252
+ assertEquals(CloudXArbiterPlatform.GAM, bids[1].platform)
253
+ }
254
+ }
@@ -0,0 +1,101 @@
1
+ package com.cloudxreactnative
2
+
3
+ import com.facebook.react.bridge.Dynamic
4
+ import com.facebook.react.bridge.ReadableArray
5
+ import com.facebook.react.bridge.ReadableMap
6
+ import com.facebook.react.bridge.ReadableMapKeySetIterator
7
+ import com.facebook.react.bridge.ReadableType
8
+ import java.util.ArrayList
9
+ import java.util.HashMap
10
+
11
+ /**
12
+ * Minimal in-memory [ReadableMap] backed by a plain Kotlin map.
13
+ *
14
+ * The bridge only ever reads values through hasKey/getType/getString/getDouble/getMap, so the
15
+ * remaining members throw rather than pretend to work.
16
+ */
17
+ internal class FakeReadableMap(private val values: Map<String, Any?>) : ReadableMap {
18
+
19
+ override val entryIterator: Iterator<Map.Entry<String, Any>>
20
+ get() = throw UnsupportedOperationException("not used by the bridge")
21
+
22
+ override fun hasKey(name: String): Boolean = values.containsKey(name)
23
+
24
+ override fun isNull(name: String): Boolean = values[name] == null
25
+
26
+ override fun getType(name: String): ReadableType = when (values[name]) {
27
+ null -> ReadableType.Null
28
+ is Boolean -> ReadableType.Boolean
29
+ is Number -> ReadableType.Number
30
+ is String -> ReadableType.String
31
+ is ReadableMap -> ReadableType.Map
32
+ is ReadableArray -> ReadableType.Array
33
+ else -> throw IllegalArgumentException("unsupported value for key=$name")
34
+ }
35
+
36
+ override fun getString(name: String): String? = values[name] as String?
37
+
38
+ override fun getDouble(name: String): Double = (values[name] as Number).toDouble()
39
+
40
+ override fun getInt(name: String): Int = (values[name] as Number).toInt()
41
+
42
+ override fun getLong(name: String): Long = (values[name] as Number).toLong()
43
+
44
+ override fun getBoolean(name: String): Boolean = values[name] as Boolean
45
+
46
+ override fun getMap(name: String): ReadableMap? = values[name] as ReadableMap?
47
+
48
+ override fun getArray(name: String): ReadableArray? = values[name] as ReadableArray?
49
+
50
+ override fun keySetIterator(): ReadableMapKeySetIterator {
51
+ val keys = values.keys.toList().iterator()
52
+ return object : ReadableMapKeySetIterator {
53
+ override fun hasNextKey(): Boolean = keys.hasNext()
54
+ override fun nextKey(): String = keys.next()
55
+ }
56
+ }
57
+
58
+ override fun getDynamic(name: String): Dynamic =
59
+ throw UnsupportedOperationException("not used by the bridge")
60
+
61
+ override fun toHashMap(): HashMap<String, Any> =
62
+ throw UnsupportedOperationException("not used by the bridge")
63
+ }
64
+
65
+ /** Minimal in-memory [ReadableArray] holding the bid maps handed to the bridge. */
66
+ internal class FakeReadableArray(private val values: List<Any?>) : ReadableArray {
67
+
68
+ override fun size(): Int = values.size
69
+
70
+ override fun isNull(index: Int): Boolean = values[index] == null
71
+
72
+ override fun getType(index: Int): ReadableType = when (values[index]) {
73
+ null -> ReadableType.Null
74
+ is Boolean -> ReadableType.Boolean
75
+ is Number -> ReadableType.Number
76
+ is String -> ReadableType.String
77
+ is ReadableMap -> ReadableType.Map
78
+ is ReadableArray -> ReadableType.Array
79
+ else -> throw IllegalArgumentException("unsupported value at index=$index")
80
+ }
81
+
82
+ override fun getMap(index: Int): ReadableMap = values[index] as ReadableMap
83
+
84
+ override fun getString(index: Int): String = values[index] as String
85
+
86
+ override fun getDouble(index: Int): Double = (values[index] as Number).toDouble()
87
+
88
+ override fun getInt(index: Int): Int = (values[index] as Number).toInt()
89
+
90
+ override fun getLong(index: Int): Long = (values[index] as Number).toLong()
91
+
92
+ override fun getBoolean(index: Int): Boolean = values[index] as Boolean
93
+
94
+ override fun getArray(index: Int): ReadableArray = values[index] as ReadableArray
95
+
96
+ override fun getDynamic(index: Int): Dynamic =
97
+ throw UnsupportedOperationException("not used by the bridge")
98
+
99
+ override fun toArrayList(): ArrayList<Any> =
100
+ throw UnsupportedOperationException("not used by the bridge")
101
+ }
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
14
14
 
15
15
  s.requires_arc = true
16
16
 
17
- s.dependency "CloudXCore", "~> 3.6.0"
17
+ s.dependency "CloudXCore", "~> 3.7.0"
18
18
 
19
19
  s.source_files = "ios/**/*.{h,mm}"
20
20
 
package/ios/CloudX.mm CHANGED
@@ -140,6 +140,12 @@ static NSString *const BOTTOM_RIGHT = @"bottom_right";
140
140
  static NSString *const ARBITER_PLATFORM_CLOUDX = @"CLOUDX";
141
141
  static NSString *const ARBITER_PLATFORM_LEVELPLAY = @"LEVELPLAY";
142
142
  static NSString *const ARBITER_PLATFORM_PUBMATIC = @"PUBMATIC";
143
+ static NSString *const ARBITER_PLATFORM_CUSTOM = @"CUSTOM";
144
+ static NSString *const ARBITER_PLATFORM_ADMOB = @"ADMOB";
145
+ static NSString *const ARBITER_PLATFORM_GAM = @"GAM";
146
+
147
+ static NSString *const ADMOB_DEFAULT_NETWORK_NAME = @"admob";
148
+ static NSString *const GAM_DEFAULT_NETWORK_NAME = @"gam";
143
149
 
144
150
  static CloudX *CloudXShared;
145
151
 
@@ -1643,6 +1649,11 @@ RCT_EXPORT_METHOD(destroyRewarded:(NSString *)adUnitIdentifier)
1643
1649
  return CLXRevenuePlatformAdMob;
1644
1650
  }
1645
1651
 
1652
+ if ( [trimmedPlatform caseInsensitiveCompare: CLXRevenuePlatformGAM] == NSOrderedSame )
1653
+ {
1654
+ return CLXRevenuePlatformGAM;
1655
+ }
1656
+
1646
1657
  if ( [trimmedPlatform caseInsensitiveCompare: CLXRevenuePlatformInMobi] == NSOrderedSame )
1647
1658
  {
1648
1659
  return CLXRevenuePlatformInMobi;
@@ -1787,6 +1798,18 @@ RCT_EXPORT_METHOD(destroyRewarded:(NSString *)adUnitIdentifier)
1787
1798
  {
1788
1799
  return [self pubMaticArbiterBidFromDictionary: dictionary];
1789
1800
  }
1801
+ if ( [platform isEqualToString: ARBITER_PLATFORM_CUSTOM] )
1802
+ {
1803
+ return [self customArbiterBidFromDictionary: dictionary];
1804
+ }
1805
+ if ( [platform isEqualToString: ARBITER_PLATFORM_ADMOB] )
1806
+ {
1807
+ return [self adMobArbiterBidFromDictionary: dictionary];
1808
+ }
1809
+ if ( [platform isEqualToString: ARBITER_PLATFORM_GAM] )
1810
+ {
1811
+ return [self gamArbiterBidFromDictionary: dictionary];
1812
+ }
1790
1813
  return nil;
1791
1814
  }
1792
1815
 
@@ -1850,12 +1873,76 @@ RCT_EXPORT_METHOD(destroyRewarded:(NSString *)adUnitIdentifier)
1850
1873
  extras: [self stringMapFromDictionaryValue: dictionary[@"extras"]]];
1851
1874
  }
1852
1875
 
1876
+ - (nullable CLXArbiterBid *)customArbiterBidFromDictionary:(NSDictionary<NSString *, id> *)dictionary
1877
+ {
1878
+ NSString *platformName = [self stringValueFromDictionary: dictionary key: @"platformName"];
1879
+ NSNumber *revenuePerImpressionUSD = [self numberValueFromDictionary: dictionary key: @"revenuePerImpressionUSD"];
1880
+ NSString *precision = [self stringValueFromDictionary: dictionary key: @"precision"];
1881
+ if ( platformName.length == 0 || !revenuePerImpressionUSD || precision.length == 0 )
1882
+ {
1883
+ [self log: @"arbiter: ignoring CUSTOM bid with missing required fields"];
1884
+ return nil;
1885
+ }
1886
+
1887
+ NSString *networkName = [self optionalStringValueFromDictionary: dictionary key: @"networkName"] ?: @"";
1888
+ return [CLXArbiterBid customBidWithPlatformName: platformName
1889
+ networkName: networkName
1890
+ revenuePerImpressionUSD: revenuePerImpressionUSD.doubleValue
1891
+ precision: [CLXArbiterPrecision precisionWithName: precision]
1892
+ extras: [self stringMapFromDictionaryValue: dictionary[@"extras"]]];
1893
+ }
1894
+
1895
+ - (nullable CLXArbiterBid *)adMobArbiterBidFromDictionary:(NSDictionary<NSString *, id> *)dictionary
1896
+ {
1897
+ // Values are passed untrimmed once valid; blankness only decides accept vs default.
1898
+ NSString *adUnitId = [self stringValueFromDictionary: dictionary key: @"adUnitId"];
1899
+ if ( [self isBlankString: adUnitId] )
1900
+ {
1901
+ [self log: @"arbiter: ignoring ADMOB bid with missing adUnitId"];
1902
+ return nil;
1903
+ }
1904
+
1905
+ NSString *networkName = [self stringValueFromDictionary: dictionary key: @"networkName"];
1906
+ if ( [self isBlankString: networkName] )
1907
+ {
1908
+ networkName = ADMOB_DEFAULT_NETWORK_NAME;
1909
+ }
1910
+
1911
+ return [CLXArbiterBid adMobBidWithAdUnitId: adUnitId
1912
+ networkName: networkName
1913
+ manualRevenuePerImpressionUSD: [self revenueNumberValueFromDictionary: dictionary key: @"manualRevenuePerImpressionUSD"]
1914
+ extras: [self stringMapFromDictionaryValue: dictionary[@"extras"]]];
1915
+ }
1916
+
1917
+ - (nullable CLXArbiterBid *)gamArbiterBidFromDictionary:(NSDictionary<NSString *, id> *)dictionary
1918
+ {
1919
+ // Same blank-check rationale as the ADMOB parser above.
1920
+ NSString *adUnitId = [self stringValueFromDictionary: dictionary key: @"adUnitId"];
1921
+ if ( [self isBlankString: adUnitId] )
1922
+ {
1923
+ [self log: @"arbiter: ignoring GAM bid with missing adUnitId"];
1924
+ return nil;
1925
+ }
1926
+
1927
+ NSString *networkName = [self stringValueFromDictionary: dictionary key: @"networkName"];
1928
+ if ( [self isBlankString: networkName] )
1929
+ {
1930
+ networkName = GAM_DEFAULT_NETWORK_NAME;
1931
+ }
1932
+
1933
+ return [CLXArbiterBid gamBidWithAdUnitId: adUnitId
1934
+ networkName: networkName
1935
+ manualRevenuePerImpressionUSD: [self revenueNumberValueFromDictionary: dictionary key: @"manualRevenuePerImpressionUSD"]
1936
+ extras: [self stringMapFromDictionaryValue: dictionary[@"extras"]]];
1937
+ }
1938
+
1853
1939
  - (NSDictionary<NSString *, id> *)arbiterResultInfoForResult:(CLXArbiterResult *)result
1854
1940
  {
1855
- return @{@"id": result.identifier ?: @"",
1856
- @"platform": result.platform.name ?: @"NONE",
1857
- @"bidId": result.bidId ?: [NSNull null],
1858
- @"extras": result.extras ?: @{}};
1941
+ return @{@"id": result.identifier ?: @"",
1942
+ @"platform": result.platform.name ?: @"NONE",
1943
+ @"platformName": result.platformName ?: @"NONE",
1944
+ @"bidId": result.bidId ?: [NSNull null],
1945
+ @"extras": result.extras ?: @{}};
1859
1946
  }
1860
1947
 
1861
1948
  - (nullable NSString *)stringValueFromDictionary:(NSDictionary<NSString *, id> *)dictionary key:(NSString *)key
@@ -1 +1 @@
1
- {"version":3,"names":["_CloudX","_interopRequireWildcard","require","_NativeCloudX","_interopRequireDefault","_EventEmitter","_Arbiter","_RevenueData","_CloudXInterstitialAd","_CloudXAppOpenAd","_CloudXRewardedAd","_CloudXBannerAd","_CloudXMRECAd","_CloudXAdPosition","_CloudXBannerView","_CloudXMRECView","_CloudXErrorCode","_AppTrackingTransparency","_hooks","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CloudXLogLevel","exports","VERBOSE","DEBUG","INFO","WARN","ERROR","NONE"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAIA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAGA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AAGA,IAAAY,iBAAA,GAAAZ,OAAA;AACA,I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AKA;;AAGA;;AAGA;;AASA;;AAiCA;AACO,MAAMgB,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1BE,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACV,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["_CloudX","_interopRequireWildcard","require","_NativeCloudX","_interopRequireDefault","_EventEmitter","_Arbiter","_RevenueData","_CloudXInterstitialAd","_CloudXAppOpenAd","_CloudXRewardedAd","_CloudXBannerAd","_CloudXMRECAd","_CloudXAdPosition","_CloudXBannerView","_CloudXMRECView","_CloudXErrorCode","_AppTrackingTransparency","_hooks","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CloudXLogLevel","exports","VERBOSE","DEBUG","INFO","WARN","ERROR","NONE"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAIA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAGA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AAGA,IAAAY,iBAAA,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ACA;;AAKA;;AAQA;;AAKA;;AAGA;;AAGA;;AASA;;AAoCA;AACO,MAAMgB,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1BE,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACV,CAAU","ignoreList":[]}
@@ -22,6 +22,39 @@ const CloudXArbiterBid = exports.CloudXArbiterBid = {
22
22
  platform: 'PUBMATIC',
23
23
  ...params
24
24
  };
25
+ },
26
+ custom(params) {
27
+ return {
28
+ platform: 'CUSTOM',
29
+ ...params
30
+ };
31
+ },
32
+ /**
33
+ * Creates an AdMob bid candidate.
34
+ *
35
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
36
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
37
+ * realized price recorded for `adUnitId`.
38
+ */
39
+ adMob(params) {
40
+ return {
41
+ platform: 'ADMOB',
42
+ ...params
43
+ };
44
+ },
45
+ /**
46
+ * Creates a Google Ad Manager bid candidate. Priced exactly like {@link adMob}; Ad Manager
47
+ * is a separate demand source, so both may bid in the same arbitration.
48
+ *
49
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
50
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
51
+ * realized price recorded for `adUnitId`.
52
+ */
53
+ gam(params) {
54
+ return {
55
+ platform: 'GAM',
56
+ ...params
57
+ };
25
58
  }
26
59
  };
27
60
  //# sourceMappingURL=Arbiter.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CloudXArbiterBid","exports","cloudX","ad","platform","levelPlay","params","pubMatic"],"sourceRoot":"../../../src","sources":["types/Arbiter.ts"],"mappings":";;;;;;AA6BO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC5BE,MAAMA,CAACC,EAAgB,EAAuB;IAC1C,OAAO;MACHC,QAAQ,EAAE,QAAQ;MAClBD;IACJ,CAAC;EACL,CAAC;EAEDE,SAASA,CAACC,MAAmD,EAA6B;IACtF,OAAO;MACHF,QAAQ,EAAE,WAAW;MACrB,GAAGE;IACP,CAAC;EACL,CAAC;EAEDC,QAAQA,CAACD,MAAkD,EAA4B;IACnF,OAAO;MACHF,QAAQ,EAAE,UAAU;MACpB,GAAGE;IACP,CAAC;EACL;AACJ,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["CloudXArbiterBid","exports","cloudX","ad","platform","levelPlay","params","pubMatic","custom","adMob","gam"],"sourceRoot":"../../../src","sources":["types/Arbiter.ts"],"mappings":";;;;;;AAqEO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC5BE,MAAMA,CAACC,EAAgB,EAAuB;IAC1C,OAAO;MACHC,QAAQ,EAAE,QAAQ;MAClBD;IACJ,CAAC;EACL,CAAC;EAEDE,SAASA,CAACC,MAAmD,EAA6B;IACtF,OAAO;MACHF,QAAQ,EAAE,WAAW;MACrB,GAAGE;IACP,CAAC;EACL,CAAC;EAEDC,QAAQA,CAACD,MAAkD,EAA4B;IACnF,OAAO;MACHF,QAAQ,EAAE,UAAU;MACpB,GAAGE;IACP,CAAC;EACL,CAAC;EAEDE,MAAMA,CAACF,MAAgD,EAA0B;IAC7E,OAAO;MACHF,QAAQ,EAAE,QAAQ;MAClB,GAAGE;IACP,CAAC;EACL,CAAC;EAED;AACJ;AACA;AACA;AACA;AACA;AACA;EACIG,KAAKA,CAACH,MAA+C,EAAyB;IAC1E,OAAO;MACHF,QAAQ,EAAE,OAAO;MACjB,GAAGE;IACP,CAAC;EACL,CAAC;EAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACII,GAAGA,CAACJ,MAA6C,EAAuB;IACpE,OAAO;MACHF,QAAQ,EAAE,KAAK;MACf,GAAGE;IACP,CAAC;EACL;AACJ,CAAU","ignoreList":[]}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.CloudXRevenuePrecision = exports.CloudXRevenuePlatform = void 0;
7
7
  const CloudXRevenuePlatform = exports.CloudXRevenuePlatform = {
8
8
  ADMOB: 'AdMob',
9
+ GAM: 'GAM',
9
10
  /*
10
11
  * InMobi does not provide a React Native SDK.
11
12
  * INMOBI: 'InMobi',
@@ -1 +1 @@
1
- {"version":3,"names":["CloudXRevenuePlatform","exports","ADMOB","custom","name","trim","CloudXRevenuePrecision","EXACT","ESTIMATED","PUBLISHER_DEFINED","UNDEFINED"],"sourceRoot":"../../../src","sources":["types/RevenueData.ts"],"mappings":";;;;;;AAEO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACjCE,KAAK,EAAE,OAAO;EACd;AACJ;AACA;AACA;EACIC,MAAM,EAAGC,IAAY,IAAiCA,IAAI,CAACC,IAAI,CAAC;AACpE,CAAU;AAEH,MAAMC,sBAAsB,GAAAL,OAAA,CAAAK,sBAAA,GAAG;EAClCC,KAAK,EAAE,OAAO;EACdC,SAAS,EAAE,WAAW;EACtBC,iBAAiB,EAAE,mBAAmB;EACtCC,SAAS,EAAE;AACf,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["CloudXRevenuePlatform","exports","ADMOB","GAM","custom","name","trim","CloudXRevenuePrecision","EXACT","ESTIMATED","PUBLISHER_DEFINED","UNDEFINED"],"sourceRoot":"../../../src","sources":["types/RevenueData.ts"],"mappings":";;;;;;AAEO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACjCE,KAAK,EAAE,OAAO;EACdC,GAAG,EAAE,KAAK;EACV;AACJ;AACA;AACA;EACIC,MAAM,EAAGC,IAAY,IAAiCA,IAAI,CAACC,IAAI,CAAC;AACpE,CAAU;AAEH,MAAMC,sBAAsB,GAAAN,OAAA,CAAAM,sBAAA,GAAG;EAClCC,KAAK,EAAE,OAAO;EACdC,SAAS,EAAE,WAAW;EACtBC,iBAAiB,EAAE,mBAAmB;EACtCC,SAAS,EAAE;AACf,CAAU","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_RevenueData","require"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAYA,IAAAA,YAAA,GAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_RevenueData","require"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAeA,IAAAA,YAAA,GAAAC,OAAA","ignoreList":[]}
@@ -9,5 +9,5 @@ exports.PLUGIN_VERSION = void 0;
9
9
  // This value is reported to the native SDK in CloudX.initialize() and is used
10
10
  // for wrapper-version telemetry/attribution, so a stale value mis-attributes
11
11
  // installs to the wrong release.
12
- const PLUGIN_VERSION = exports.PLUGIN_VERSION = '3.6.0';
12
+ const PLUGIN_VERSION = exports.PLUGIN_VERSION = '3.7.0';
13
13
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","CloudX","NativeCloudX","emitter","cloudXEventEmitter","CloudXArbiterBid","CloudXRevenuePlatform","CloudXRevenuePrecision","CloudXInterstitialAd","CloudXAppOpenAd","CloudXRewardedAd","CloudXBannerAd","CloudXMRECAd","CloudXAdPosition","CloudXBannerView","CloudXMRECView","CloudXErrorCode","requestTrackingAuthorization","getTrackingAuthorizationStatus","CloudXATTStatus","useCloudXInterstitial","useCloudXAppOpen","useCloudXRewarded","useCloudXBanner","CloudXLogLevel","VERBOSE","DEBUG","INFO","WARN","ERROR","NONE"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA,SAASA,OAAO,EAAEC,MAAM,QAAQ,UAAU;AAC1C,SAASD,OAAO,IAAIE,YAAY,QAAQ,sBAAsB;AAC9D;AACA;AACA;AACA,SAASC,OAAO,IAAIC,kBAAkB,QAAQ,gBAAgB;AAC9D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ,qBAAqB;;AAEnF;AACA,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AAGjD;AACA,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA,SAASC,4BAA4B,EAAEC,8BAA8B,EAAEC,eAAe,QAAQ,2BAA2B;;AAEzH;AACA,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,iBAAiB,EAAEC,eAAe,QAAQ,SAAS;;AAQrG;;AAiCA;AACA,OAAO,MAAMC,cAAc,GAAG;EAC1BC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACV,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["default","CloudX","NativeCloudX","emitter","cloudXEventEmitter","CloudXArbiterBid","CloudXRevenuePlatform","CloudXRevenuePrecision","CloudXInterstitialAd","CloudXAppOpenAd","CloudXRewardedAd","CloudXBannerAd","CloudXMRECAd","CloudXAdPosition","CloudXBannerView","CloudXMRECView","CloudXErrorCode","requestTrackingAuthorization","getTrackingAuthorizationStatus","CloudXATTStatus","useCloudXInterstitial","useCloudXAppOpen","useCloudXRewarded","useCloudXBanner","CloudXLogLevel","VERBOSE","DEBUG","INFO","WARN","ERROR","NONE"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA,SAASA,OAAO,EAAEC,MAAM,QAAQ,UAAU;AAC1C,SAASD,OAAO,IAAIE,YAAY,QAAQ,sBAAsB;AAC9D;AACA;AACA;AACA,SAASC,OAAO,IAAIC,kBAAkB,QAAQ,gBAAgB;AAC9D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ,qBAAqB;;AAEnF;AACA,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AAGjD;AACA,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA,SAASC,4BAA4B,EAAEC,8BAA8B,EAAEC,eAAe,QAAQ,2BAA2B;;AAEzH;AACA,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,iBAAiB,EAAEC,eAAe,QAAQ,SAAS;;AAQrG;;AAoCA;AACA,OAAO,MAAMC,cAAc,GAAG;EAC1BC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACV,CAAU","ignoreList":[]}
@@ -16,6 +16,39 @@ export const CloudXArbiterBid = {
16
16
  platform: 'PUBMATIC',
17
17
  ...params
18
18
  };
19
+ },
20
+ custom(params) {
21
+ return {
22
+ platform: 'CUSTOM',
23
+ ...params
24
+ };
25
+ },
26
+ /**
27
+ * Creates an AdMob bid candidate.
28
+ *
29
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
30
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
31
+ * realized price recorded for `adUnitId`.
32
+ */
33
+ adMob(params) {
34
+ return {
35
+ platform: 'ADMOB',
36
+ ...params
37
+ };
38
+ },
39
+ /**
40
+ * Creates a Google Ad Manager bid candidate. Priced exactly like {@link adMob}; Ad Manager
41
+ * is a separate demand source, so both may bid in the same arbitration.
42
+ *
43
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
44
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
45
+ * realized price recorded for `adUnitId`.
46
+ */
47
+ gam(params) {
48
+ return {
49
+ platform: 'GAM',
50
+ ...params
51
+ };
19
52
  }
20
53
  };
21
54
  //# sourceMappingURL=Arbiter.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CloudXArbiterBid","cloudX","ad","platform","levelPlay","params","pubMatic"],"sourceRoot":"../../../src","sources":["types/Arbiter.ts"],"mappings":"AA6BA,OAAO,MAAMA,gBAAgB,GAAG;EAC5BC,MAAMA,CAACC,EAAgB,EAAuB;IAC1C,OAAO;MACHC,QAAQ,EAAE,QAAQ;MAClBD;IACJ,CAAC;EACL,CAAC;EAEDE,SAASA,CAACC,MAAmD,EAA6B;IACtF,OAAO;MACHF,QAAQ,EAAE,WAAW;MACrB,GAAGE;IACP,CAAC;EACL,CAAC;EAEDC,QAAQA,CAACD,MAAkD,EAA4B;IACnF,OAAO;MACHF,QAAQ,EAAE,UAAU;MACpB,GAAGE;IACP,CAAC;EACL;AACJ,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["CloudXArbiterBid","cloudX","ad","platform","levelPlay","params","pubMatic","custom","adMob","gam"],"sourceRoot":"../../../src","sources":["types/Arbiter.ts"],"mappings":"AAqEA,OAAO,MAAMA,gBAAgB,GAAG;EAC5BC,MAAMA,CAACC,EAAgB,EAAuB;IAC1C,OAAO;MACHC,QAAQ,EAAE,QAAQ;MAClBD;IACJ,CAAC;EACL,CAAC;EAEDE,SAASA,CAACC,MAAmD,EAA6B;IACtF,OAAO;MACHF,QAAQ,EAAE,WAAW;MACrB,GAAGE;IACP,CAAC;EACL,CAAC;EAEDC,QAAQA,CAACD,MAAkD,EAA4B;IACnF,OAAO;MACHF,QAAQ,EAAE,UAAU;MACpB,GAAGE;IACP,CAAC;EACL,CAAC;EAEDE,MAAMA,CAACF,MAAgD,EAA0B;IAC7E,OAAO;MACHF,QAAQ,EAAE,QAAQ;MAClB,GAAGE;IACP,CAAC;EACL,CAAC;EAED;AACJ;AACA;AACA;AACA;AACA;AACA;EACIG,KAAKA,CAACH,MAA+C,EAAyB;IAC1E,OAAO;MACHF,QAAQ,EAAE,OAAO;MACjB,GAAGE;IACP,CAAC;EACL,CAAC;EAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACII,GAAGA,CAACJ,MAA6C,EAAuB;IACpE,OAAO;MACHF,QAAQ,EAAE,KAAK;MACf,GAAGE;IACP,CAAC;EACL;AACJ,CAAU","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  export const CloudXRevenuePlatform = {
2
2
  ADMOB: 'AdMob',
3
+ GAM: 'GAM',
3
4
  /*
4
5
  * InMobi does not provide a React Native SDK.
5
6
  * INMOBI: 'InMobi',
@@ -1 +1 @@
1
- {"version":3,"names":["CloudXRevenuePlatform","ADMOB","custom","name","trim","CloudXRevenuePrecision","EXACT","ESTIMATED","PUBLISHER_DEFINED","UNDEFINED"],"sourceRoot":"../../../src","sources":["types/RevenueData.ts"],"mappings":"AAEA,OAAO,MAAMA,qBAAqB,GAAG;EACjCC,KAAK,EAAE,OAAO;EACd;AACJ;AACA;AACA;EACIC,MAAM,EAAGC,IAAY,IAAiCA,IAAI,CAACC,IAAI,CAAC;AACpE,CAAU;AAEV,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,KAAK,EAAE,OAAO;EACdC,SAAS,EAAE,WAAW;EACtBC,iBAAiB,EAAE,mBAAmB;EACtCC,SAAS,EAAE;AACf,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["CloudXRevenuePlatform","ADMOB","GAM","custom","name","trim","CloudXRevenuePrecision","EXACT","ESTIMATED","PUBLISHER_DEFINED","UNDEFINED"],"sourceRoot":"../../../src","sources":["types/RevenueData.ts"],"mappings":"AAEA,OAAO,MAAMA,qBAAqB,GAAG;EACjCC,KAAK,EAAE,OAAO;EACdC,GAAG,EAAE,KAAK;EACV;AACJ;AACA;AACA;EACIC,MAAM,EAAGC,IAAY,IAAiCA,IAAI,CAACC,IAAI,CAAC;AACpE,CAAU;AAEV,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,KAAK,EAAE,OAAO;EACdC,SAAS,EAAE,WAAW;EACtBC,iBAAiB,EAAE,mBAAmB;EACtCC,SAAS,EAAE;AACf,CAAU","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["CloudXRevenuePlatform","CloudXRevenuePrecision"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"AAYA,SAASA,qBAAqB,EAAEC,sBAAsB,QAAQ,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["CloudXRevenuePlatform","CloudXRevenuePrecision"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"AAeA,SAASA,qBAAqB,EAAEC,sBAAsB,QAAQ,eAAe","ignoreList":[]}
@@ -3,5 +3,5 @@
3
3
  // This value is reported to the native SDK in CloudX.initialize() and is used
4
4
  // for wrapper-version telemetry/attribution, so a stale value mis-attributes
5
5
  // installs to the wrong release.
6
- export const PLUGIN_VERSION = '3.6.0';
6
+ export const PLUGIN_VERSION = '3.7.0';
7
7
  //# sourceMappingURL=version.js.map
@@ -16,7 +16,7 @@ export { CloudXErrorCode } from './CloudXErrorCode';
16
16
  export { requestTrackingAuthorization, getTrackingAuthorizationStatus, CloudXATTStatus } from './AppTrackingTransparency';
17
17
  export { useCloudXInterstitial, useCloudXAppOpen, useCloudXRewarded, useCloudXBanner } from './hooks';
18
18
  export type { CloudXInterstitialHookResult, CloudXAppOpenHookResult, CloudXRewardedHookResult, CloudXBannerHookResult, } from './hooks';
19
- export type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, CloudXAdRewardInfo, CloudXInitializationResult, CloudXConfiguration, CloudXType, CloudXLogLevelValue, CloudXArbiterConfiguration, CloudXArbiterPlatform, CloudXArbiterResult, CloudXSDKArbiterBid, CloudXLevelPlayArbiterBid, CloudXPubMaticArbiterBid, CloudXRevenueData, CloudXRevenuePlatformValue, CloudXRevenuePrecisionValue, CloudXFullscreenAdType, CloudXInterstitialAdType, CloudXAppOpenAdType, CloudXRewardedAdType, CloudXViewAdType, CloudXBannerAdType, CloudXMRECAdType, CloudXAdProps, CloudXAdEventObject, CloudXAdEventListener, CloudXExtraParameterValue, CloudXExtraParameters, } from './types';
19
+ export type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, CloudXAdRewardInfo, CloudXInitializationResult, CloudXConfiguration, CloudXType, CloudXLogLevelValue, CloudXArbiterConfiguration, CloudXArbiterPlatform, CloudXArbiterResult, CloudXSDKArbiterBid, CloudXLevelPlayArbiterBid, CloudXPubMaticArbiterBid, CloudXCustomArbiterBid, CloudXAdMobArbiterBid, CloudXGamArbiterBid, CloudXRevenueData, CloudXRevenuePlatformValue, CloudXRevenuePrecisionValue, CloudXFullscreenAdType, CloudXInterstitialAdType, CloudXAppOpenAdType, CloudXRewardedAdType, CloudXViewAdType, CloudXBannerAdType, CloudXMRECAdType, CloudXAdProps, CloudXAdEventObject, CloudXAdEventListener, CloudXExtraParameterValue, CloudXExtraParameters, } from './types';
20
20
  export declare const CloudXLogLevel: {
21
21
  readonly VERBOSE: "verbose";
22
22
  readonly DEBUG: "debug";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAI/D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,qBAAq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E,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACtG,YAAY,EACR,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,GACzB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACR,YAAY,EACZ,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,GACxB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { CloudXAdInfo } from './AdInfo';
2
- export type CloudXArbiterPlatform = 'CLOUDX' | 'LEVELPLAY' | 'PUBMATIC' | 'NONE';
2
+ export type CloudXArbiterPlatform = 'CLOUDX' | 'LEVELPLAY' | 'PUBMATIC' | 'CUSTOM' | 'ADMOB' | 'GAM' | 'NONE';
3
3
  export type CloudXSDKArbiterBid = {
4
4
  platform: 'CLOUDX';
5
5
  ad: CloudXAdInfo;
@@ -17,11 +17,63 @@ export type CloudXPubMaticArbiterBid = {
17
17
  partnerName?: string | null;
18
18
  extras?: Record<string, string>;
19
19
  };
20
- export type CloudXArbiterBid = CloudXSDKArbiterBid | CloudXLevelPlayArbiterBid | CloudXPubMaticArbiterBid;
20
+ export type CloudXCustomArbiterBid = {
21
+ platform: 'CUSTOM';
22
+ platformName: string;
23
+ networkName: string;
24
+ revenuePerImpressionUSD: number;
25
+ precision: string;
26
+ extras?: Record<string, string>;
27
+ };
28
+ export type CloudXAdMobArbiterBid = {
29
+ platform: 'ADMOB';
30
+ adUnitId: string;
31
+ networkName?: string;
32
+ /**
33
+ * Publisher-supplied per-impression USD price.
34
+ *
35
+ * `0.0` is a real price, not an absent one. Negative and non-finite values are dropped
36
+ * natively with a warning and the bid falls back to its realized price.
37
+ */
38
+ manualRevenuePerImpressionUSD?: number;
39
+ extras?: Record<string, string>;
40
+ };
41
+ export type CloudXGamArbiterBid = {
42
+ platform: 'GAM';
43
+ adUnitId: string;
44
+ networkName?: string;
45
+ /**
46
+ * Publisher-supplied per-impression USD price.
47
+ *
48
+ * `0.0` is a real price, not an absent one. Negative and non-finite values are dropped
49
+ * natively with a warning and the bid falls back to its realized price.
50
+ */
51
+ manualRevenuePerImpressionUSD?: number;
52
+ extras?: Record<string, string>;
53
+ };
54
+ export type CloudXArbiterBid = CloudXSDKArbiterBid | CloudXLevelPlayArbiterBid | CloudXPubMaticArbiterBid | CloudXCustomArbiterBid | CloudXAdMobArbiterBid | CloudXGamArbiterBid;
21
55
  export declare const CloudXArbiterBid: {
22
56
  readonly cloudX: (ad: CloudXAdInfo) => CloudXSDKArbiterBid;
23
57
  readonly levelPlay: (params: Omit<CloudXLevelPlayArbiterBid, "platform">) => CloudXLevelPlayArbiterBid;
24
58
  readonly pubMatic: (params: Omit<CloudXPubMaticArbiterBid, "platform">) => CloudXPubMaticArbiterBid;
59
+ readonly custom: (params: Omit<CloudXCustomArbiterBid, "platform">) => CloudXCustomArbiterBid;
60
+ /**
61
+ * Creates an AdMob bid candidate.
62
+ *
63
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
64
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
65
+ * realized price recorded for `adUnitId`.
66
+ */
67
+ readonly adMob: (params: Omit<CloudXAdMobArbiterBid, "platform">) => CloudXAdMobArbiterBid;
68
+ /**
69
+ * Creates a Google Ad Manager bid candidate. Priced exactly like {@link adMob}; Ad Manager
70
+ * is a separate demand source, so both may bid in the same arbitration.
71
+ *
72
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
73
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
74
+ * realized price recorded for `adUnitId`.
75
+ */
76
+ readonly gam: (params: Omit<CloudXGamArbiterBid, "platform">) => CloudXGamArbiterBid;
25
77
  };
26
78
  export type CloudXArbiterConfiguration = {
27
79
  bids: CloudXArbiterBid[];
@@ -29,6 +81,7 @@ export type CloudXArbiterConfiguration = {
29
81
  export type CloudXArbiterResult = {
30
82
  id: string;
31
83
  platform: CloudXArbiterPlatform;
84
+ platformName: string;
32
85
  bidId?: string | null;
33
86
  extras: Record<string, string>;
34
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Arbiter.d.ts","sourceRoot":"","sources":["../../../../src/types/Arbiter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,EAAE,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,UAAU,CAAC;IAC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O,MAAM,gBAAgB;0BACd,YAAY,KAAG,mBAAmB;iCAO3B,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC,KAAG,yBAAyB;gCAOxE,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,KAAG,wBAAwB;8BAOvE,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,KAAG,sBAAsB;IAOhF;;;;;;OAMG;6BACW,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,KAAG,qBAAqB;IAO7E;;;;;;;OAOG;2BACS,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,KAAG,mBAAmB;CAMjE,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,gBAAgB,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export type CloudXRevenuePlatformValue = string;
2
2
  export declare const CloudXRevenuePlatform: {
3
3
  readonly ADMOB: "AdMob";
4
+ readonly GAM: "GAM";
4
5
  readonly custom: (name: string) => CloudXRevenuePlatformValue;
5
6
  };
6
7
  export declare const CloudXRevenuePrecision: {
@@ -1 +1 @@
1
- {"version":3,"file":"RevenueData.d.ts","sourceRoot":"","sources":["../../../../src/types/RevenueData.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEhD,eAAO,MAAM,qBAAqB;;4BAMf,MAAM,KAAG,0BAA0B;CAC5C,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,sB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I,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, CloudXAdRewardInfo } from './AdInfo';
2
2
  export type { CloudXInitializationResult, CloudXConfiguration } from './Configuration';
3
3
  export type { CloudXType, CloudXLogLevelValue } from './CloudX';
4
- export type { CloudXArbiterBid, CloudXArbiterConfiguration, CloudXArbiterPlatform, CloudXArbiterResult, CloudXSDKArbiterBid, CloudXLevelPlayArbiterBid, CloudXPubMaticArbiterBid, } from './Arbiter';
4
+ export type { CloudXArbiterBid, CloudXArbiterConfiguration, CloudXArbiterPlatform, CloudXArbiterResult, CloudXSDKArbiterBid, CloudXLevelPlayArbiterBid, CloudXPubMaticArbiterBid, CloudXCustomArbiterBid, CloudXAdMobArbiterBid, CloudXGamArbiterBid, } from './Arbiter';
5
5
  export { CloudXRevenuePlatform, CloudXRevenuePrecision } from './RevenueData';
6
6
  export type { CloudXRevenueData, CloudXRevenuePlatformValue, CloudXRevenuePrecisionValue } from './RevenueData';
7
7
  export type { CloudXFullscreenAdType } from './FullscreenAd';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACpH,YAAY,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,CAAC;AAChE,YAAY,EACR,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAChH,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC5E,YAAY,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const PLUGIN_VERSION = "3.6.0";
1
+ export declare const PLUGIN_VERSION = "3.7.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudx-react-native",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "React Native wrapper for CloudX SDK (iOS & Android)",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/index.ts CHANGED
@@ -52,6 +52,9 @@ export type {
52
52
  CloudXSDKArbiterBid,
53
53
  CloudXLevelPlayArbiterBid,
54
54
  CloudXPubMaticArbiterBid,
55
+ CloudXCustomArbiterBid,
56
+ CloudXAdMobArbiterBid,
57
+ CloudXGamArbiterBid,
55
58
  CloudXRevenueData,
56
59
  CloudXRevenuePlatformValue,
57
60
  CloudXRevenuePrecisionValue,
@@ -1,6 +1,6 @@
1
1
  import type { CloudXAdInfo } from './AdInfo';
2
2
 
3
- export type CloudXArbiterPlatform = 'CLOUDX' | 'LEVELPLAY' | 'PUBMATIC' | 'NONE';
3
+ export type CloudXArbiterPlatform = 'CLOUDX' | 'LEVELPLAY' | 'PUBMATIC' | 'CUSTOM' | 'ADMOB' | 'GAM' | 'NONE';
4
4
 
5
5
  export type CloudXSDKArbiterBid = {
6
6
  platform: 'CLOUDX';
@@ -22,10 +22,50 @@ export type CloudXPubMaticArbiterBid = {
22
22
  extras?: Record<string, string>;
23
23
  };
24
24
 
25
+ export type CloudXCustomArbiterBid = {
26
+ platform: 'CUSTOM';
27
+ platformName: string;
28
+ networkName: string;
29
+ revenuePerImpressionUSD: number;
30
+ precision: string;
31
+ extras?: Record<string, string>;
32
+ };
33
+
34
+ export type CloudXAdMobArbiterBid = {
35
+ platform: 'ADMOB';
36
+ adUnitId: string;
37
+ networkName?: string;
38
+ /**
39
+ * Publisher-supplied per-impression USD price.
40
+ *
41
+ * `0.0` is a real price, not an absent one. Negative and non-finite values are dropped
42
+ * natively with a warning and the bid falls back to its realized price.
43
+ */
44
+ manualRevenuePerImpressionUSD?: number;
45
+ extras?: Record<string, string>;
46
+ };
47
+
48
+ export type CloudXGamArbiterBid = {
49
+ platform: 'GAM';
50
+ adUnitId: string;
51
+ networkName?: string;
52
+ /**
53
+ * Publisher-supplied per-impression USD price.
54
+ *
55
+ * `0.0` is a real price, not an absent one. Negative and non-finite values are dropped
56
+ * natively with a warning and the bid falls back to its realized price.
57
+ */
58
+ manualRevenuePerImpressionUSD?: number;
59
+ extras?: Record<string, string>;
60
+ };
61
+
25
62
  export type CloudXArbiterBid =
26
63
  | CloudXSDKArbiterBid
27
64
  | CloudXLevelPlayArbiterBid
28
- | CloudXPubMaticArbiterBid;
65
+ | CloudXPubMaticArbiterBid
66
+ | CloudXCustomArbiterBid
67
+ | CloudXAdMobArbiterBid
68
+ | CloudXGamArbiterBid;
29
69
 
30
70
  export const CloudXArbiterBid = {
31
71
  cloudX(ad: CloudXAdInfo): CloudXSDKArbiterBid {
@@ -48,6 +88,42 @@ export const CloudXArbiterBid = {
48
88
  ...params,
49
89
  };
50
90
  },
91
+
92
+ custom(params: Omit<CloudXCustomArbiterBid, 'platform'>): CloudXCustomArbiterBid {
93
+ return {
94
+ platform: 'CUSTOM',
95
+ ...params,
96
+ };
97
+ },
98
+
99
+ /**
100
+ * Creates an AdMob bid candidate.
101
+ *
102
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
103
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
104
+ * realized price recorded for `adUnitId`.
105
+ */
106
+ adMob(params: Omit<CloudXAdMobArbiterBid, 'platform'>): CloudXAdMobArbiterBid {
107
+ return {
108
+ platform: 'ADMOB',
109
+ ...params,
110
+ };
111
+ },
112
+
113
+ /**
114
+ * Creates a Google Ad Manager bid candidate. Priced exactly like {@link adMob}; Ad Manager
115
+ * is a separate demand source, so both may bid in the same arbitration.
116
+ *
117
+ * `manualRevenuePerImpressionUSD` of `0.0` is a real price, not an absent one; negative and
118
+ * non-finite values are dropped natively with a warning. Omitting it leaves pricing to the
119
+ * realized price recorded for `adUnitId`.
120
+ */
121
+ gam(params: Omit<CloudXGamArbiterBid, 'platform'>): CloudXGamArbiterBid {
122
+ return {
123
+ platform: 'GAM',
124
+ ...params,
125
+ };
126
+ },
51
127
  } as const;
52
128
 
53
129
  export type CloudXArbiterConfiguration = {
@@ -57,6 +133,7 @@ export type CloudXArbiterConfiguration = {
57
133
  export type CloudXArbiterResult = {
58
134
  id: string;
59
135
  platform: CloudXArbiterPlatform;
136
+ platformName: string;
60
137
  bidId?: string | null;
61
138
  extras: Record<string, string>;
62
139
  };
@@ -2,6 +2,7 @@ export type CloudXRevenuePlatformValue = string;
2
2
 
3
3
  export const CloudXRevenuePlatform = {
4
4
  ADMOB: 'AdMob',
5
+ GAM: 'GAM',
5
6
  /*
6
7
  * InMobi does not provide a React Native SDK.
7
8
  * INMOBI: 'InMobi',
@@ -9,6 +9,9 @@ export type {
9
9
  CloudXSDKArbiterBid,
10
10
  CloudXLevelPlayArbiterBid,
11
11
  CloudXPubMaticArbiterBid,
12
+ CloudXCustomArbiterBid,
13
+ CloudXAdMobArbiterBid,
14
+ CloudXGamArbiterBid,
12
15
  } from './Arbiter';
13
16
  export { CloudXRevenuePlatform, CloudXRevenuePrecision } from './RevenueData';
14
17
  export type { CloudXRevenueData, CloudXRevenuePlatformValue, CloudXRevenuePrecisionValue } from './RevenueData';
package/src/version.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  // This value is reported to the native SDK in CloudX.initialize() and is used
4
4
  // for wrapper-version telemetry/attribution, so a stale value mis-attributes
5
5
  // installs to the wrong release.
6
- export const PLUGIN_VERSION = '3.6.0';
6
+ export const PLUGIN_VERSION = '3.7.0';