@bigcrunch/react-native-ads 0.13.0 → 0.15.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.
- package/android/bigcrunch-ads/com/bigcrunch/ads/BigCrunchAds.kt +14 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/adapters/GoogleAdsAdapter.kt +6 -3
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/AnalyticsClient.kt +27 -15
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/BidRequestClient.kt +11 -7
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/ConfigManager.kt +25 -4
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/DeviceContext.kt +1 -1
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/AdEvent.kt +2 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/PlacementConfig.kt +3 -0
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchAdsModule.kt +14 -1
- package/ios/BigCrunchAds/Sources/Adapters/GoogleAdsAdapter.swift +4 -0
- package/ios/BigCrunchAds/Sources/BigCrunchAds.swift +19 -0
- package/ios/BigCrunchAds/Sources/BigCrunchRewarded.swift +2 -0
- package/ios/BigCrunchAds/Sources/Core/AnalyticsClient.swift +27 -16
- package/ios/BigCrunchAds/Sources/Core/BidRequestClient.swift +11 -7
- package/ios/BigCrunchAds/Sources/Core/ConfigManager.swift +60 -3
- package/ios/BigCrunchAds/Sources/Core/DeviceContext.swift +1 -1
- package/ios/BigCrunchAds/Sources/Models/AdEvent.swift +4 -0
- package/ios/BigCrunchAds/Sources/Models/PlacementConfig.swift +3 -0
- package/ios/BigCrunchAdsModule.m +5 -0
- package/ios/BigCrunchAdsModule.swift +10 -0
- package/lib/BigCrunchAds.d.ts +15 -1
- package/lib/BigCrunchAds.d.ts.map +1 -1
- package/lib/BigCrunchAds.js +16 -0
- package/lib/NativeBigCrunchAds.d.ts +1 -0
- package/lib/NativeBigCrunchAds.d.ts.map +1 -1
- package/lib/types/config.d.ts +3 -1
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/BigCrunchAds.ts +18 -0
- package/src/NativeBigCrunchAds.ts +3 -0
- package/src/types/config.ts +3 -1
- package/src/types/index.ts +5 -0
|
@@ -341,6 +341,20 @@ object BigCrunchAds {
|
|
|
341
341
|
DeviceHelper.getDeviceData(appContext)
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
+
/**
|
|
345
|
+
* Set the account type for the current user
|
|
346
|
+
*
|
|
347
|
+
* Included in all analytics events. Defaults to "guest" if not set.
|
|
348
|
+
* Valid values: "guest", "logged_in", "paid", "subscriber", "free"
|
|
349
|
+
*
|
|
350
|
+
* @param accountType The user's account type
|
|
351
|
+
*/
|
|
352
|
+
fun setAccountType(accountType: String) = runSafely {
|
|
353
|
+
requireInitialized()
|
|
354
|
+
analyticsClient.setAccountType(accountType)
|
|
355
|
+
BCLogger.d(TAG, "Account type set to: $accountType")
|
|
356
|
+
}
|
|
357
|
+
|
|
344
358
|
/**
|
|
345
359
|
* Set GDPR consent string for privacy compliance
|
|
346
360
|
*
|
|
@@ -238,6 +238,7 @@ internal class GoogleAdsAdapter(
|
|
|
238
238
|
|
|
239
239
|
analyticsClient.trackAdImpression(
|
|
240
240
|
placementId = placementConfig.placementId,
|
|
241
|
+
slotId = placementConfig.id,
|
|
241
242
|
format = placementConfig.format,
|
|
242
243
|
gamAdUnit = placementConfig.gamAdUnit,
|
|
243
244
|
adSize = adSizeString,
|
|
@@ -257,7 +258,7 @@ internal class GoogleAdsAdapter(
|
|
|
257
258
|
|
|
258
259
|
override fun onAdClicked() {
|
|
259
260
|
BCLogger.d(TAG, "Banner ad clicked: ${placementConfig.placementId}")
|
|
260
|
-
analyticsClient.trackAdClick(placementConfig.placementId, placementConfig.format)
|
|
261
|
+
analyticsClient.trackAdClick(placementConfig.placementId, placementConfig.id, placementConfig.format)
|
|
261
262
|
safeCallback { callback.onAdClicked() }
|
|
262
263
|
}
|
|
263
264
|
|
|
@@ -398,6 +399,7 @@ internal class GoogleAdsAdapter(
|
|
|
398
399
|
|
|
399
400
|
analyticsClient.trackAdImpression(
|
|
400
401
|
placementId = placementConfig.placementId,
|
|
402
|
+
slotId = placementConfig.id,
|
|
401
403
|
format = placementConfig.format,
|
|
402
404
|
gamAdUnit = placementConfig.gamAdUnit,
|
|
403
405
|
advertiserId = adMetadata["advertiser_id"] as? String,
|
|
@@ -420,7 +422,7 @@ internal class GoogleAdsAdapter(
|
|
|
420
422
|
|
|
421
423
|
override fun onAdClicked() {
|
|
422
424
|
BCLogger.d(TAG, "Interstitial ad clicked: ${placementConfig.placementId}")
|
|
423
|
-
analyticsClient.trackAdClick(placementConfig.placementId, placementConfig.format)
|
|
425
|
+
analyticsClient.trackAdClick(placementConfig.placementId, placementConfig.id, placementConfig.format)
|
|
424
426
|
safeCallback { callback.onAdClicked() }
|
|
425
427
|
}
|
|
426
428
|
|
|
@@ -506,6 +508,7 @@ internal class GoogleAdsAdapter(
|
|
|
506
508
|
|
|
507
509
|
analyticsClient.trackAdImpression(
|
|
508
510
|
placementId = placementConfig.placementId,
|
|
511
|
+
slotId = placementConfig.id,
|
|
509
512
|
format = placementConfig.format,
|
|
510
513
|
gamAdUnit = placementConfig.gamAdUnit,
|
|
511
514
|
advertiserId = adMetadata["advertiser_id"] as? String,
|
|
@@ -528,7 +531,7 @@ internal class GoogleAdsAdapter(
|
|
|
528
531
|
|
|
529
532
|
override fun onAdClicked() {
|
|
530
533
|
BCLogger.d(TAG, "Rewarded ad clicked: ${placementConfig.placementId}")
|
|
531
|
-
analyticsClient.trackAdClick(placementConfig.placementId, placementConfig.format)
|
|
534
|
+
analyticsClient.trackAdClick(placementConfig.placementId, placementConfig.id, placementConfig.format)
|
|
532
535
|
safeCallback { callback.onAdClicked() }
|
|
533
536
|
}
|
|
534
537
|
|
|
@@ -77,6 +77,10 @@ internal class AnalyticsClient(
|
|
|
77
77
|
@Volatile
|
|
78
78
|
private var currentCustomDimensions: Map<String, String> = emptyMap()
|
|
79
79
|
|
|
80
|
+
/** Current account type (set by setAccountType, used by all events) */
|
|
81
|
+
@Volatile
|
|
82
|
+
private var currentAcctType: String = "guest"
|
|
83
|
+
|
|
80
84
|
// MARK: - Session Context
|
|
81
85
|
|
|
82
86
|
private val sessionManager: SessionManager
|
|
@@ -265,7 +269,7 @@ internal class AnalyticsClient(
|
|
|
265
269
|
utmContent = common.utmContent ?: "",
|
|
266
270
|
gclid = "",
|
|
267
271
|
fbclid = "",
|
|
268
|
-
acctType =
|
|
272
|
+
acctType = currentAcctType,
|
|
269
273
|
diiSource = "",
|
|
270
274
|
gamNetworkCode = gamNetworkCode,
|
|
271
275
|
amznPubId = NIL_UUID,
|
|
@@ -289,6 +293,7 @@ internal class AnalyticsClient(
|
|
|
289
293
|
*/
|
|
290
294
|
fun createImpressionContext(
|
|
291
295
|
placementId: String,
|
|
296
|
+
slotId: String,
|
|
292
297
|
gamAdUnit: String,
|
|
293
298
|
format: String,
|
|
294
299
|
width: Int? = null,
|
|
@@ -296,6 +301,7 @@ internal class AnalyticsClient(
|
|
|
296
301
|
): ImpressionContext {
|
|
297
302
|
val context = ImpressionContext(
|
|
298
303
|
placementId = placementId,
|
|
304
|
+
slotId = slotId,
|
|
299
305
|
gamAdUnit = gamAdUnit,
|
|
300
306
|
format = format,
|
|
301
307
|
width = width,
|
|
@@ -331,6 +337,10 @@ internal class AnalyticsClient(
|
|
|
331
337
|
/**
|
|
332
338
|
* Store auction data for a placement (called by AdOrchestrator after S2S demand fetch)
|
|
333
339
|
*/
|
|
340
|
+
fun setAccountType(accountType: String) {
|
|
341
|
+
currentAcctType = accountType
|
|
342
|
+
}
|
|
343
|
+
|
|
334
344
|
fun setAuctionData(placementId: String, auctionData: AuctionData) {
|
|
335
345
|
placementAuctionData[placementId] = auctionData
|
|
336
346
|
BCLogger.d(TAG, "Stored auction data for placement: $placementId (channel: ${auctionData.demandChannel ?: "unknown"})")
|
|
@@ -388,7 +398,7 @@ internal class AnalyticsClient(
|
|
|
388
398
|
|
|
389
399
|
// Create impression record with auction data fields populated
|
|
390
400
|
val impressionRecord = ImpressionRecord(
|
|
391
|
-
slotId = context.
|
|
401
|
+
slotId = context.slotId,
|
|
392
402
|
gamUnit = context.gamAdUnit,
|
|
393
403
|
gamPriceBucket = effectiveAuctionData.gamPriceBucket ?: "",
|
|
394
404
|
impressionId = context.impressionId,
|
|
@@ -434,7 +444,7 @@ internal class AnalyticsClient(
|
|
|
434
444
|
utmContent = common.utmContent ?: "",
|
|
435
445
|
gclid = "",
|
|
436
446
|
fbclid = "",
|
|
437
|
-
acctType =
|
|
447
|
+
acctType = currentAcctType,
|
|
438
448
|
diiSource = "",
|
|
439
449
|
gamNetworkCode = getGamNetworkCode(),
|
|
440
450
|
amznPubId = NIL_UUID,
|
|
@@ -450,6 +460,7 @@ internal class AnalyticsClient(
|
|
|
450
460
|
*/
|
|
451
461
|
fun trackAdImpression(
|
|
452
462
|
placementId: String,
|
|
463
|
+
slotId: String,
|
|
453
464
|
format: String,
|
|
454
465
|
gamAdUnit: String = "",
|
|
455
466
|
adSize: String = "",
|
|
@@ -474,7 +485,7 @@ internal class AnalyticsClient(
|
|
|
474
485
|
|
|
475
486
|
// Create impression record with auction data fields populated
|
|
476
487
|
val impressionRecord = ImpressionRecord(
|
|
477
|
-
slotId =
|
|
488
|
+
slotId = slotId,
|
|
478
489
|
gamUnit = gamAdUnit,
|
|
479
490
|
gamPriceBucket = auctionData?.gamPriceBucket ?: "",
|
|
480
491
|
impressionId = UUID.randomUUID().toString(),
|
|
@@ -524,7 +535,7 @@ internal class AnalyticsClient(
|
|
|
524
535
|
utmContent = common.utmContent ?: "",
|
|
525
536
|
gclid = "",
|
|
526
537
|
fbclid = "",
|
|
527
|
-
acctType =
|
|
538
|
+
acctType = currentAcctType,
|
|
528
539
|
diiSource = "",
|
|
529
540
|
gamNetworkCode = getGamNetworkCode(),
|
|
530
541
|
amznPubId = NIL_UUID,
|
|
@@ -544,7 +555,7 @@ internal class AnalyticsClient(
|
|
|
544
555
|
* @param placementId Placement ID
|
|
545
556
|
* @param format Ad format
|
|
546
557
|
*/
|
|
547
|
-
fun trackAdClick(impressionId: String, placementId: String, format: String) {
|
|
558
|
+
fun trackAdClick(impressionId: String, placementId: String, slotId: String, format: String) {
|
|
548
559
|
// Get common event fields
|
|
549
560
|
val common = getCommonEventFields()
|
|
550
561
|
|
|
@@ -554,7 +565,7 @@ internal class AnalyticsClient(
|
|
|
554
565
|
// Create nested click data - impressionId must be valid UUID
|
|
555
566
|
val clickData = ClickData(
|
|
556
567
|
clickId = UUID.randomUUID().toString(),
|
|
557
|
-
slotId =
|
|
568
|
+
slotId = slotId,
|
|
558
569
|
impressionId = impressionId.takeIf { it.isNotEmpty() } ?: UUID.randomUUID().toString()
|
|
559
570
|
)
|
|
560
571
|
|
|
@@ -585,7 +596,7 @@ internal class AnalyticsClient(
|
|
|
585
596
|
utmContent = common.utmContent ?: "",
|
|
586
597
|
gclid = "",
|
|
587
598
|
fbclid = "",
|
|
588
|
-
acctType =
|
|
599
|
+
acctType = currentAcctType,
|
|
589
600
|
diiSource = "",
|
|
590
601
|
gamNetworkCode = getGamNetworkCode(),
|
|
591
602
|
amznPubId = NIL_UUID,
|
|
@@ -599,8 +610,8 @@ internal class AnalyticsClient(
|
|
|
599
610
|
/**
|
|
600
611
|
* Track an ad click (simple version without impression ID)
|
|
601
612
|
*/
|
|
602
|
-
fun trackAdClick(placementId: String, format: String) {
|
|
603
|
-
trackAdClick("", placementId, format)
|
|
613
|
+
fun trackAdClick(placementId: String, slotId: String, format: String) {
|
|
614
|
+
trackAdClick("", placementId, slotId, format)
|
|
604
615
|
}
|
|
605
616
|
|
|
606
617
|
// MARK: - Viewability Tracking
|
|
@@ -617,6 +628,7 @@ internal class AnalyticsClient(
|
|
|
617
628
|
fun trackAdViewable(
|
|
618
629
|
impressionId: String,
|
|
619
630
|
placementId: String,
|
|
631
|
+
slotId: String,
|
|
620
632
|
format: String,
|
|
621
633
|
viewableTimeMs: Long,
|
|
622
634
|
percentVisible: Int
|
|
@@ -629,7 +641,7 @@ internal class AnalyticsClient(
|
|
|
629
641
|
|
|
630
642
|
// Create nested viewability data - impressionId must be valid UUID
|
|
631
643
|
val viewabilityData = ViewabilityData(
|
|
632
|
-
slotId =
|
|
644
|
+
slotId = slotId,
|
|
633
645
|
impressionId = impressionId.takeIf { it.isNotEmpty() } ?: UUID.randomUUID().toString()
|
|
634
646
|
)
|
|
635
647
|
|
|
@@ -660,7 +672,7 @@ internal class AnalyticsClient(
|
|
|
660
672
|
utmContent = common.utmContent ?: "",
|
|
661
673
|
gclid = "",
|
|
662
674
|
fbclid = "",
|
|
663
|
-
acctType =
|
|
675
|
+
acctType = currentAcctType,
|
|
664
676
|
diiSource = "",
|
|
665
677
|
gamNetworkCode = getGamNetworkCode(),
|
|
666
678
|
amznPubId = NIL_UUID,
|
|
@@ -674,8 +686,8 @@ internal class AnalyticsClient(
|
|
|
674
686
|
/**
|
|
675
687
|
* Track ad viewability (simple version without metrics)
|
|
676
688
|
*/
|
|
677
|
-
fun trackAdViewable(placementId: String, format: String) {
|
|
678
|
-
trackAdViewable("", placementId, format, 0, 0)
|
|
689
|
+
fun trackAdViewable(placementId: String, slotId: String, format: String) {
|
|
690
|
+
trackAdViewable("", placementId, slotId, format, 0, 0)
|
|
679
691
|
}
|
|
680
692
|
|
|
681
693
|
// MARK: - Engagement Tracking
|
|
@@ -721,7 +733,7 @@ internal class AnalyticsClient(
|
|
|
721
733
|
utmContent = common.utmContent ?: "",
|
|
722
734
|
gclid = "",
|
|
723
735
|
fbclid = "",
|
|
724
|
-
acctType =
|
|
736
|
+
acctType = currentAcctType,
|
|
725
737
|
diiSource = "",
|
|
726
738
|
gamNetworkCode = getGamNetworkCode(),
|
|
727
739
|
amznPubId = NIL_UUID,
|
|
@@ -188,7 +188,7 @@ internal class BidRequestClient(
|
|
|
188
188
|
|
|
189
189
|
private fun buildImp(placement: PlacementConfig): JSONObject {
|
|
190
190
|
val imp = JSONObject()
|
|
191
|
-
imp.put("id", placement.
|
|
191
|
+
imp.put("id", placement.id)
|
|
192
192
|
|
|
193
193
|
val deviceContext = DeviceContext.getInstance()
|
|
194
194
|
|
|
@@ -268,7 +268,8 @@ internal class BidRequestClient(
|
|
|
268
268
|
*/
|
|
269
269
|
private fun buildBiddersExt(placements: List<PlacementConfig>): JSONObject {
|
|
270
270
|
val bidders = configManager.getCachedConfig()?.bidders ?: return JSONObject()
|
|
271
|
-
val
|
|
271
|
+
val placementIdToUuid = placements.associate { it.placementId to it.id }
|
|
272
|
+
val placementIds = placementIdToUuid.keys
|
|
272
273
|
val biddersExt = JSONObject()
|
|
273
274
|
|
|
274
275
|
for ((bidderName, bidderEntry) in bidders) {
|
|
@@ -285,7 +286,7 @@ internal class BidRequestClient(
|
|
|
285
286
|
for (placementId in placementIds) {
|
|
286
287
|
bidderPlacements[placementId]?.let { impParams ->
|
|
287
288
|
impArray.put(JSONObject().apply {
|
|
288
|
-
put("impid", placementId)
|
|
289
|
+
put("impid", placementIdToUuid[placementId])
|
|
289
290
|
put("params", mapToJson(impParams))
|
|
290
291
|
})
|
|
291
292
|
}
|
|
@@ -316,8 +317,9 @@ internal class BidRequestClient(
|
|
|
316
317
|
|
|
317
318
|
val auctionId = json.optString("id", "")
|
|
318
319
|
|
|
319
|
-
// Build floor price lookup
|
|
320
|
-
val floorPrices = placements.associate { it.
|
|
320
|
+
// Build floor price lookup and UUID-to-placementId mapping
|
|
321
|
+
val floorPrices = placements.associate { it.id to it.floorPrice }
|
|
322
|
+
val uuidToPlacementId = placements.associate { it.id to it.placementId }
|
|
321
323
|
|
|
322
324
|
// Collect all bids grouped by impid
|
|
323
325
|
data class BidInfo(
|
|
@@ -376,8 +378,10 @@ internal class BidRequestClient(
|
|
|
376
378
|
demandChannel = "S2S"
|
|
377
379
|
)
|
|
378
380
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
+
// Re-key from UUID to placementId for internal use
|
|
382
|
+
val placementId = uuidToPlacementId[impid] ?: impid
|
|
383
|
+
results[placementId] = BidResponse(winner.targeting, auctionData)
|
|
384
|
+
BCLogger.d(TAG, "Winner for $placementId: $${winner.price}")
|
|
381
385
|
}
|
|
382
386
|
|
|
383
387
|
BCLogger.i(TAG, "Parsed ${results.size} winning bids")
|
|
@@ -5,10 +5,14 @@ import com.bigcrunch.ads.internal.HttpClient
|
|
|
5
5
|
import com.bigcrunch.ads.internal.KeyValueStore
|
|
6
6
|
import com.bigcrunch.ads.models.AppConfig
|
|
7
7
|
import com.bigcrunch.ads.models.PlacementConfig
|
|
8
|
+
import com.squareup.moshi.JsonDataException
|
|
9
|
+
import com.squareup.moshi.JsonEncodingException
|
|
8
10
|
import com.squareup.moshi.Moshi
|
|
9
11
|
import kotlinx.coroutines.sync.Mutex
|
|
10
12
|
import kotlinx.coroutines.sync.withLock
|
|
11
13
|
|
|
14
|
+
class ConfigParseException(message: String, cause: Throwable? = null) : Exception(message, cause)
|
|
15
|
+
|
|
12
16
|
/**
|
|
13
17
|
* Manages application configuration fetching, caching, and access
|
|
14
18
|
*
|
|
@@ -61,12 +65,14 @@ internal class ConfigManager(
|
|
|
61
65
|
refresh = com.bigcrunch.ads.models.RefreshConfig(enabled = true, intervalMs = 30000, maxRefreshes = 20),
|
|
62
66
|
placements = listOf(
|
|
63
67
|
PlacementConfig(
|
|
68
|
+
id = "00000000-0000-0000-0000-000000000001",
|
|
64
69
|
placementId = "test_banner_320x50",
|
|
65
70
|
format = "banner",
|
|
66
71
|
gamAdUnit = "ca-app-pub-3940256099942544/6300978111",
|
|
67
72
|
sizes = listOf(com.bigcrunch.ads.models.AdSize(width = 320, height = 50))
|
|
68
73
|
),
|
|
69
74
|
PlacementConfig(
|
|
75
|
+
id = "00000000-0000-0000-0000-000000000002",
|
|
70
76
|
placementId = "test_mrec",
|
|
71
77
|
format = "banner",
|
|
72
78
|
gamAdUnit = "ca-app-pub-3940256099942544/6300978111",
|
|
@@ -74,18 +80,21 @@ internal class ConfigManager(
|
|
|
74
80
|
refresh = com.bigcrunch.ads.models.RefreshConfig(enabled = true, intervalMs = 15000, maxRefreshes = 40)
|
|
75
81
|
),
|
|
76
82
|
PlacementConfig(
|
|
83
|
+
id = "00000000-0000-0000-0000-000000000003",
|
|
77
84
|
placementId = "test_adaptive_banner",
|
|
78
85
|
format = "banner",
|
|
79
86
|
gamAdUnit = "ca-app-pub-3940256099942544/6300978111",
|
|
80
87
|
sizes = listOf(com.bigcrunch.ads.models.AdSize.adaptive())
|
|
81
88
|
),
|
|
82
89
|
PlacementConfig(
|
|
90
|
+
id = "00000000-0000-0000-0000-000000000004",
|
|
83
91
|
placementId = "test_interstitial",
|
|
84
92
|
format = "interstitial",
|
|
85
93
|
gamAdUnit = "ca-app-pub-3940256099942544/1033173712",
|
|
86
94
|
sizes = null
|
|
87
95
|
),
|
|
88
96
|
PlacementConfig(
|
|
97
|
+
id = "00000000-0000-0000-0000-000000000005",
|
|
89
98
|
placementId = "test_rewarded",
|
|
90
99
|
format = "rewarded",
|
|
91
100
|
gamAdUnit = "ca-app-pub-3940256099942544/5224354917",
|
|
@@ -150,8 +159,9 @@ internal class ConfigManager(
|
|
|
150
159
|
val config = try {
|
|
151
160
|
adapter.fromJson(json)
|
|
152
161
|
} catch (e: Exception) {
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
val message = describeJsonError(e)
|
|
163
|
+
BCLogger.e("ConfigManager", "Failed to parse config JSON from $url: $message", e)
|
|
164
|
+
return Result.failure(ConfigParseException(message, e))
|
|
155
165
|
}
|
|
156
166
|
|
|
157
167
|
if (config != null) {
|
|
@@ -163,7 +173,7 @@ internal class ConfigManager(
|
|
|
163
173
|
Result.success(config)
|
|
164
174
|
} else {
|
|
165
175
|
BCLogger.e("ConfigManager", "Invalid config JSON")
|
|
166
|
-
Result.failure(
|
|
176
|
+
Result.failure(ConfigParseException("Config JSON parsed to null"))
|
|
167
177
|
}
|
|
168
178
|
}
|
|
169
179
|
storedConfig != null -> {
|
|
@@ -288,11 +298,22 @@ internal class ConfigManager(
|
|
|
288
298
|
val json = storage.getString(CONFIG_STORAGE_KEY) ?: return null
|
|
289
299
|
adapter.fromJson(json)
|
|
290
300
|
} catch (e: Exception) {
|
|
291
|
-
BCLogger.e("ConfigManager", "Failed to load config from storage", e)
|
|
301
|
+
BCLogger.e("ConfigManager", "Failed to load config from storage: ${describeJsonError(e)}", e)
|
|
292
302
|
null
|
|
293
303
|
}
|
|
294
304
|
}
|
|
295
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Produce a human-readable description from a Moshi parse error
|
|
308
|
+
*/
|
|
309
|
+
private fun describeJsonError(e: Exception): String {
|
|
310
|
+
return when (e) {
|
|
311
|
+
is JsonDataException -> e.message ?: "Invalid JSON data"
|
|
312
|
+
is JsonEncodingException -> e.message ?: "Malformed JSON"
|
|
313
|
+
else -> e.message ?: e.toString()
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
296
317
|
/**
|
|
297
318
|
* Save config to persistent storage
|
|
298
319
|
*/
|
|
@@ -28,7 +28,7 @@ internal class DeviceContext private constructor(context: Context) {
|
|
|
28
28
|
|
|
29
29
|
companion object {
|
|
30
30
|
private const val TAG = "DeviceContext"
|
|
31
|
-
internal const val SDK_VERSION = "0.
|
|
31
|
+
internal const val SDK_VERSION = "0.15.0"
|
|
32
32
|
|
|
33
33
|
@Volatile
|
|
34
34
|
private var instance: DeviceContext? = null
|
|
@@ -46,7 +46,7 @@ class BigCrunchAdsModule(reactContext: ReactApplicationContext) :
|
|
|
46
46
|
BigCrunchAds.initialize(
|
|
47
47
|
context = context,
|
|
48
48
|
propertyId = propertyId,
|
|
49
|
-
env = if (environment == "staging")
|
|
49
|
+
env = if (environment == "sandbox" || environment == "staging")
|
|
50
50
|
BigCrunchAds.Environment.Staging
|
|
51
51
|
else
|
|
52
52
|
BigCrunchAds.Environment.Prod,
|
|
@@ -543,6 +543,19 @@ class BigCrunchAdsModule(reactContext: ReactApplicationContext) :
|
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
|
|
546
|
+
/**
|
|
547
|
+
* Set account type
|
|
548
|
+
*/
|
|
549
|
+
@ReactMethod
|
|
550
|
+
fun setAccountType(accountType: String, promise: Promise) {
|
|
551
|
+
try {
|
|
552
|
+
BigCrunchAds.setAccountType(accountType)
|
|
553
|
+
promise.resolve(null)
|
|
554
|
+
} catch (e: Exception) {
|
|
555
|
+
promise.reject("ACCOUNT_ERROR", "Failed to set account type: ${e.message}", e)
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
546
559
|
/**
|
|
547
560
|
* Set debug mode
|
|
548
561
|
*/
|
|
@@ -367,6 +367,7 @@ private class BannerDelegateWrapper: NSObject, GoogleMobileAds.BannerViewDelegat
|
|
|
367
367
|
|
|
368
368
|
analyticsClient.trackAdImpression(
|
|
369
369
|
placementId: placementConfig.placementId,
|
|
370
|
+
slotId: placementConfig.id,
|
|
370
371
|
format: placementConfig.format,
|
|
371
372
|
gamAdUnit: placementConfig.gamAdUnit,
|
|
372
373
|
adSize: adSizeString,
|
|
@@ -388,6 +389,7 @@ private class BannerDelegateWrapper: NSObject, GoogleMobileAds.BannerViewDelegat
|
|
|
388
389
|
BCLogger.debug("GoogleAdsAdapter: Banner ad clicked: \(placementConfig.placementId)")
|
|
389
390
|
analyticsClient.trackAdClick(
|
|
390
391
|
placementId: placementConfig.placementId,
|
|
392
|
+
slotId: placementConfig.id,
|
|
391
393
|
format: placementConfig.format
|
|
392
394
|
)
|
|
393
395
|
delegate?.bannerAdDidRecordClick(bannerView)
|
|
@@ -431,6 +433,7 @@ private class InterstitialDelegateWrapper: NSObject, GoogleMobileAds.FullScreenC
|
|
|
431
433
|
|
|
432
434
|
analyticsClient.trackAdImpression(
|
|
433
435
|
placementId: placementConfig.placementId,
|
|
436
|
+
slotId: placementConfig.id,
|
|
434
437
|
format: placementConfig.format,
|
|
435
438
|
gamAdUnit: placementConfig.gamAdUnit,
|
|
436
439
|
advertiserId: adMetadata["advertiser_id"] as? String,
|
|
@@ -457,6 +460,7 @@ private class InterstitialDelegateWrapper: NSObject, GoogleMobileAds.FullScreenC
|
|
|
457
460
|
BCLogger.debug("GoogleAdsAdapter: Interstitial ad clicked: \(placementConfig.placementId)")
|
|
458
461
|
analyticsClient.trackAdClick(
|
|
459
462
|
placementId: placementConfig.placementId,
|
|
463
|
+
slotId: placementConfig.id,
|
|
460
464
|
format: placementConfig.format
|
|
461
465
|
)
|
|
462
466
|
delegate?.interstitialAdDidRecordClick(interstitialAd)
|
|
@@ -249,6 +249,25 @@ public final class BigCrunchAds {
|
|
|
249
249
|
)
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
// MARK: - Account Type
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Set the account type for the current user
|
|
256
|
+
*
|
|
257
|
+
* Included in all analytics events. Defaults to "guest" if not set.
|
|
258
|
+
* Valid values: "guest", "logged_in", "paid", "subscriber", "free"
|
|
259
|
+
*
|
|
260
|
+
* - Parameter accountType: The user's account type
|
|
261
|
+
*/
|
|
262
|
+
public static func setAccountType(_ accountType: String) {
|
|
263
|
+
guard _isInitialized else {
|
|
264
|
+
BCLogger.warning("setAccountType called before initialization, ignoring")
|
|
265
|
+
return
|
|
266
|
+
}
|
|
267
|
+
analyticsClient.setAccountType(accountType)
|
|
268
|
+
BCLogger.debug("Account type set to: \(accountType)")
|
|
269
|
+
}
|
|
270
|
+
|
|
252
271
|
// MARK: - Privacy Compliance
|
|
253
272
|
|
|
254
273
|
/**
|
|
@@ -465,6 +465,7 @@ private class RewardedDelegateWrapper: NSObject, FullScreenContentDelegate {
|
|
|
465
465
|
|
|
466
466
|
analyticsClient.trackAdImpression(
|
|
467
467
|
placementId: placementConfig.placementId,
|
|
468
|
+
slotId: placementConfig.id,
|
|
468
469
|
format: placementConfig.format,
|
|
469
470
|
advertiserId: adMetadata["advertiser_id"] as? String,
|
|
470
471
|
campaignId: adMetadata["campaign_id"] as? String,
|
|
@@ -492,6 +493,7 @@ private class RewardedDelegateWrapper: NSObject, FullScreenContentDelegate {
|
|
|
492
493
|
BCLogger.debug("BigCrunchRewarded: Rewarded ad clicked: \(placementId)")
|
|
493
494
|
analyticsClient.trackAdClick(
|
|
494
495
|
placementId: placementConfig.placementId,
|
|
496
|
+
slotId: placementConfig.id,
|
|
495
497
|
format: placementConfig.format
|
|
496
498
|
)
|
|
497
499
|
delegate?.rewardedDidClick(placementId: placementId)
|
|
@@ -38,6 +38,9 @@ internal class AnalyticsClient {
|
|
|
38
38
|
/// Current custom dimensions (set by trackScreenView, used by all events)
|
|
39
39
|
private var currentCustomDimensions: [String: String] = [:]
|
|
40
40
|
|
|
41
|
+
/// Current account type (set by setAccountType, used by all events)
|
|
42
|
+
private var currentAcctType: String = "guest"
|
|
43
|
+
|
|
41
44
|
/// Batching for impressions (250ms delay)
|
|
42
45
|
private var impressionBatch: [ImpressionBatchEvent] = []
|
|
43
46
|
private var impressionBatchTimer: Timer?
|
|
@@ -200,7 +203,7 @@ internal class AnalyticsClient {
|
|
|
200
203
|
utmContent: common.utmContent ?? "",
|
|
201
204
|
gclid: "",
|
|
202
205
|
fbclid: "",
|
|
203
|
-
acctType:
|
|
206
|
+
acctType: currentAcctType,
|
|
204
207
|
diiSource: "",
|
|
205
208
|
gamNetworkCode: gamNetworkCode,
|
|
206
209
|
amznPubId: AnalyticsClient.nilUUID, // amzn_pub_id must be valid UUID
|
|
@@ -236,6 +239,7 @@ internal class AnalyticsClient {
|
|
|
236
239
|
*/
|
|
237
240
|
func createImpressionContext(
|
|
238
241
|
placementId: String,
|
|
242
|
+
slotId: String,
|
|
239
243
|
gamAdUnit: String,
|
|
240
244
|
format: String,
|
|
241
245
|
width: Int? = nil,
|
|
@@ -243,6 +247,7 @@ internal class AnalyticsClient {
|
|
|
243
247
|
) -> ImpressionContext {
|
|
244
248
|
let context = ImpressionContext(
|
|
245
249
|
placementId: placementId,
|
|
250
|
+
slotId: slotId,
|
|
246
251
|
gamAdUnit: gamAdUnit,
|
|
247
252
|
format: format,
|
|
248
253
|
width: width,
|
|
@@ -283,6 +288,10 @@ internal class AnalyticsClient {
|
|
|
283
288
|
/**
|
|
284
289
|
* Store auction data for a placement (called by AdOrchestrator after S2S demand fetch)
|
|
285
290
|
*/
|
|
291
|
+
func setAccountType(_ accountType: String) {
|
|
292
|
+
currentAcctType = accountType
|
|
293
|
+
}
|
|
294
|
+
|
|
286
295
|
func setAuctionData(placementId: String, auctionData: AuctionData) {
|
|
287
296
|
contextLock.lock()
|
|
288
297
|
placementAuctionData[placementId] = auctionData
|
|
@@ -344,7 +353,7 @@ internal class AnalyticsClient {
|
|
|
344
353
|
|
|
345
354
|
// Create the impression record
|
|
346
355
|
let impressionRecord = ImpressionRecord(
|
|
347
|
-
slotId: context.
|
|
356
|
+
slotId: context.slotId,
|
|
348
357
|
gamUnit: context.gamAdUnit,
|
|
349
358
|
gamPriceBucket: effectiveAuctionData.gamPriceBucket ?? "",
|
|
350
359
|
impressionId: context.impressionId,
|
|
@@ -394,7 +403,7 @@ internal class AnalyticsClient {
|
|
|
394
403
|
utmContent: common.utmContent ?? "",
|
|
395
404
|
gclid: "",
|
|
396
405
|
fbclid: "",
|
|
397
|
-
acctType:
|
|
406
|
+
acctType: currentAcctType,
|
|
398
407
|
diiSource: "",
|
|
399
408
|
gamNetworkCode: gamNetworkCode,
|
|
400
409
|
amznPubId: AnalyticsClient.nilUUID, // amzn_pub_id must be valid UUID
|
|
@@ -410,6 +419,7 @@ internal class AnalyticsClient {
|
|
|
410
419
|
*/
|
|
411
420
|
func trackAdImpression(
|
|
412
421
|
placementId: String,
|
|
422
|
+
slotId: String,
|
|
413
423
|
format: String,
|
|
414
424
|
gamAdUnit: String = "",
|
|
415
425
|
adSize: String = "",
|
|
@@ -438,7 +448,7 @@ internal class AnalyticsClient {
|
|
|
438
448
|
|
|
439
449
|
// Create the impression record with auction data fields populated
|
|
440
450
|
let impressionRecord = ImpressionRecord(
|
|
441
|
-
slotId:
|
|
451
|
+
slotId: slotId,
|
|
442
452
|
gamUnit: gamAdUnit,
|
|
443
453
|
gamPriceBucket: auctionData?.gamPriceBucket ?? "",
|
|
444
454
|
impressionId: UUID().uuidString,
|
|
@@ -488,7 +498,7 @@ internal class AnalyticsClient {
|
|
|
488
498
|
utmContent: common.utmContent ?? "",
|
|
489
499
|
gclid: "",
|
|
490
500
|
fbclid: "",
|
|
491
|
-
acctType:
|
|
501
|
+
acctType: currentAcctType,
|
|
492
502
|
diiSource: "",
|
|
493
503
|
gamNetworkCode: gamNetworkCode,
|
|
494
504
|
amznPubId: AnalyticsClient.nilUUID, // amzn_pub_id must be valid UUID
|
|
@@ -509,7 +519,7 @@ internal class AnalyticsClient {
|
|
|
509
519
|
* - placementId: Placement ID
|
|
510
520
|
* - format: Ad format
|
|
511
521
|
*/
|
|
512
|
-
func trackAdClick(impressionId: String, placementId: String, format: String) {
|
|
522
|
+
func trackAdClick(impressionId: String, placementId: String, slotId: String, format: String) {
|
|
513
523
|
// Get common event fields
|
|
514
524
|
let common = getCommonEventFields()
|
|
515
525
|
|
|
@@ -523,7 +533,7 @@ internal class AnalyticsClient {
|
|
|
523
533
|
// Note: customDimensions values must be string arrays per backend validation
|
|
524
534
|
let clickData = ClickData(
|
|
525
535
|
clickId: UUID().uuidString,
|
|
526
|
-
slotId:
|
|
536
|
+
slotId: slotId,
|
|
527
537
|
impressionId: impressionId.isEmpty ? UUID().uuidString : impressionId, // Must be valid UUID
|
|
528
538
|
refreshCount: 0,
|
|
529
539
|
adAmznp: "",
|
|
@@ -565,7 +575,7 @@ internal class AnalyticsClient {
|
|
|
565
575
|
utmContent: common.utmContent ?? "",
|
|
566
576
|
gclid: "",
|
|
567
577
|
fbclid: "",
|
|
568
|
-
acctType:
|
|
578
|
+
acctType: currentAcctType,
|
|
569
579
|
diiSource: "",
|
|
570
580
|
gamNetworkCode: gamNetworkCode,
|
|
571
581
|
amznPubId: AnalyticsClient.nilUUID,
|
|
@@ -579,8 +589,8 @@ internal class AnalyticsClient {
|
|
|
579
589
|
/**
|
|
580
590
|
* Track an ad click (simple version without impression ID)
|
|
581
591
|
*/
|
|
582
|
-
func trackAdClick(placementId: String, format: String) {
|
|
583
|
-
trackAdClick(impressionId: "", placementId: placementId, format: format)
|
|
592
|
+
func trackAdClick(placementId: String, slotId: String, format: String) {
|
|
593
|
+
trackAdClick(impressionId: "", placementId: placementId, slotId: slotId, format: format)
|
|
584
594
|
}
|
|
585
595
|
|
|
586
596
|
// MARK: - Viewability Tracking
|
|
@@ -598,6 +608,7 @@ internal class AnalyticsClient {
|
|
|
598
608
|
func trackAdViewable(
|
|
599
609
|
impressionId: String,
|
|
600
610
|
placementId: String,
|
|
611
|
+
slotId: String,
|
|
601
612
|
format: String,
|
|
602
613
|
viewableTimeMs: Int64,
|
|
603
614
|
percentVisible: Int
|
|
@@ -613,7 +624,7 @@ internal class AnalyticsClient {
|
|
|
613
624
|
|
|
614
625
|
// Create viewability data with nested structure per backend schema
|
|
615
626
|
let viewabilityData = ViewabilityData(
|
|
616
|
-
slotId:
|
|
627
|
+
slotId: slotId,
|
|
617
628
|
impressionId: impressionId.isEmpty ? UUID().uuidString : impressionId, // Must be valid UUID
|
|
618
629
|
refreshCount: 0,
|
|
619
630
|
adAmznp: "",
|
|
@@ -655,7 +666,7 @@ internal class AnalyticsClient {
|
|
|
655
666
|
utmContent: common.utmContent ?? "",
|
|
656
667
|
gclid: "",
|
|
657
668
|
fbclid: "",
|
|
658
|
-
acctType:
|
|
669
|
+
acctType: currentAcctType,
|
|
659
670
|
diiSource: "",
|
|
660
671
|
gamNetworkCode: gamNetworkCode,
|
|
661
672
|
amznPubId: AnalyticsClient.nilUUID,
|
|
@@ -668,7 +679,7 @@ internal class AnalyticsClient {
|
|
|
668
679
|
/**
|
|
669
680
|
* Track ad viewability (simple version without metrics)
|
|
670
681
|
*/
|
|
671
|
-
func trackAdViewable(placementId: String, format: String) {
|
|
682
|
+
func trackAdViewable(placementId: String, slotId: String, format: String) {
|
|
672
683
|
// Get common event fields
|
|
673
684
|
let common = getCommonEventFields()
|
|
674
685
|
|
|
@@ -680,7 +691,7 @@ internal class AnalyticsClient {
|
|
|
680
691
|
|
|
681
692
|
// Create viewability data with nested structure per backend schema
|
|
682
693
|
let viewabilityData = ViewabilityData(
|
|
683
|
-
slotId:
|
|
694
|
+
slotId: slotId,
|
|
684
695
|
impressionId: UUID().uuidString, // Generate UUID since none provided
|
|
685
696
|
refreshCount: 0,
|
|
686
697
|
adAmznp: "",
|
|
@@ -722,7 +733,7 @@ internal class AnalyticsClient {
|
|
|
722
733
|
utmContent: common.utmContent ?? "",
|
|
723
734
|
gclid: "",
|
|
724
735
|
fbclid: "",
|
|
725
|
-
acctType:
|
|
736
|
+
acctType: currentAcctType,
|
|
726
737
|
diiSource: "",
|
|
727
738
|
gamNetworkCode: gamNetworkCode,
|
|
728
739
|
amznPubId: AnalyticsClient.nilUUID,
|
|
@@ -778,7 +789,7 @@ internal class AnalyticsClient {
|
|
|
778
789
|
utmContent: common.utmContent ?? "",
|
|
779
790
|
gclid: "",
|
|
780
791
|
fbclid: "",
|
|
781
|
-
acctType:
|
|
792
|
+
acctType: currentAcctType,
|
|
782
793
|
diiSource: "",
|
|
783
794
|
gamNetworkCode: gamNetworkCode,
|
|
784
795
|
amznPubId: AnalyticsClient.nilUUID,
|
|
@@ -189,7 +189,7 @@ internal class BidRequestClient {
|
|
|
189
189
|
|
|
190
190
|
private func buildImp(_ placement: PlacementConfig) -> [String: Any] {
|
|
191
191
|
var imp: [String: Any] = [
|
|
192
|
-
"id": placement.
|
|
192
|
+
"id": placement.id
|
|
193
193
|
]
|
|
194
194
|
|
|
195
195
|
switch placement.format {
|
|
@@ -262,7 +262,8 @@ internal class BidRequestClient {
|
|
|
262
262
|
return [:]
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
let
|
|
265
|
+
let placementIdToUuid = Dictionary(uniqueKeysWithValues: placements.map { ($0.placementId, $0.id) })
|
|
266
|
+
let placementIds = Set(placementIdToUuid.keys)
|
|
266
267
|
var biddersExt: [String: Any] = [:]
|
|
267
268
|
|
|
268
269
|
for (bidderName, bidderEntry) in bidders {
|
|
@@ -279,7 +280,7 @@ internal class BidRequestClient {
|
|
|
279
280
|
for placementId in placementIds {
|
|
280
281
|
if let impParams = bidderPlacements[placementId] {
|
|
281
282
|
impEntries.append([
|
|
282
|
-
"impid": placementId,
|
|
283
|
+
"impid": placementIdToUuid[placementId] ?? placementId,
|
|
283
284
|
"params": impParams.mapValues { $0.value }
|
|
284
285
|
])
|
|
285
286
|
}
|
|
@@ -326,8 +327,9 @@ internal class BidRequestClient {
|
|
|
326
327
|
|
|
327
328
|
let auctionId = json["id"] as? String
|
|
328
329
|
|
|
329
|
-
// Build floor price lookup
|
|
330
|
-
let floorPrices = Dictionary(uniqueKeysWithValues: placements.map { ($0.
|
|
330
|
+
// Build floor price lookup (keyed by UUID) and UUID-to-placementId mapping
|
|
331
|
+
let floorPrices = Dictionary(uniqueKeysWithValues: placements.map { ($0.id, $0.floorPrice) })
|
|
332
|
+
let uuidToPlacementId = Dictionary(uniqueKeysWithValues: placements.map { ($0.id, $0.placementId) })
|
|
331
333
|
|
|
332
334
|
// Collect all bids grouped by impid
|
|
333
335
|
struct BidInfo {
|
|
@@ -376,8 +378,10 @@ internal class BidRequestClient {
|
|
|
376
378
|
demandChannel: "S2S"
|
|
377
379
|
)
|
|
378
380
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
+
// Re-key from UUID to placementId for internal use
|
|
382
|
+
let placementId = uuidToPlacementId[impid] ?? impid
|
|
383
|
+
results[placementId] = BidResponse(targeting: winner.targeting, auctionData: auctionData)
|
|
384
|
+
BCLogger.debug("BidRequestClient: Winner for \(placementId): $\(winner.price)")
|
|
381
385
|
}
|
|
382
386
|
|
|
383
387
|
BCLogger.info("BidRequestClient: Parsed \(results.count) winning bids")
|
|
@@ -12,6 +12,17 @@ import Foundation
|
|
|
12
12
|
*
|
|
13
13
|
* The config is fetched once at SDK initialization and cached for the app session.
|
|
14
14
|
*/
|
|
15
|
+
enum ConfigError: LocalizedError {
|
|
16
|
+
case parseError(String)
|
|
17
|
+
|
|
18
|
+
var errorDescription: String? {
|
|
19
|
+
switch self {
|
|
20
|
+
case .parseError(let message):
|
|
21
|
+
return message
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
15
26
|
internal class ConfigManager {
|
|
16
27
|
|
|
17
28
|
private let httpClient: HTTPClient
|
|
@@ -55,12 +66,14 @@ internal class ConfigManager {
|
|
|
55
66
|
refresh: RefreshConfig(enabled: true, intervalMs: 30000, maxRefreshes: 20),
|
|
56
67
|
placements: [
|
|
57
68
|
PlacementConfig(
|
|
69
|
+
id: "00000000-0000-0000-0000-000000000001",
|
|
58
70
|
placementId: "test_banner_320x50",
|
|
59
71
|
format: "banner",
|
|
60
72
|
gamAdUnit: "ca-app-pub-3940256099942544/2435281174",
|
|
61
73
|
sizes: [AdSize(width: 320, height: 50)]
|
|
62
74
|
),
|
|
63
75
|
PlacementConfig(
|
|
76
|
+
id: "00000000-0000-0000-0000-000000000002",
|
|
64
77
|
placementId: "test_mrec",
|
|
65
78
|
format: "banner",
|
|
66
79
|
gamAdUnit: "ca-app-pub-3940256099942544/2435281174",
|
|
@@ -68,18 +81,21 @@ internal class ConfigManager {
|
|
|
68
81
|
refresh: RefreshConfig(enabled: true, intervalMs: 15000, maxRefreshes: 40)
|
|
69
82
|
),
|
|
70
83
|
PlacementConfig(
|
|
84
|
+
id: "00000000-0000-0000-0000-000000000003",
|
|
71
85
|
placementId: "test_adaptive_banner",
|
|
72
86
|
format: "banner",
|
|
73
87
|
gamAdUnit: "ca-app-pub-3940256099942544/2435281174",
|
|
74
88
|
sizes: [AdSize.adaptive()]
|
|
75
89
|
),
|
|
76
90
|
PlacementConfig(
|
|
91
|
+
id: "00000000-0000-0000-0000-000000000004",
|
|
77
92
|
placementId: "test_interstitial",
|
|
78
93
|
format: "interstitial",
|
|
79
94
|
gamAdUnit: "ca-app-pub-3940256099942544/4411468910",
|
|
80
95
|
sizes: nil
|
|
81
96
|
),
|
|
82
97
|
PlacementConfig(
|
|
98
|
+
id: "00000000-0000-0000-0000-000000000005",
|
|
83
99
|
placementId: "test_rewarded",
|
|
84
100
|
format: "rewarded",
|
|
85
101
|
gamAdUnit: "ca-app-pub-3940256099942544/1712485313",
|
|
@@ -152,8 +168,9 @@ internal class ConfigManager {
|
|
|
152
168
|
BCLogger.verbose("Config JSON: \(json)")
|
|
153
169
|
return .success(config)
|
|
154
170
|
} catch {
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
let message = Self.describeDecodingError(error)
|
|
172
|
+
BCLogger.error("Failed to parse config JSON from \(url): \(message)")
|
|
173
|
+
return .failure(ConfigError.parseError(message))
|
|
157
174
|
}
|
|
158
175
|
|
|
159
176
|
case .failure(let error):
|
|
@@ -295,11 +312,51 @@ internal class ConfigManager {
|
|
|
295
312
|
do {
|
|
296
313
|
return try JSONDecoder().decode(AppConfig.self, from: data)
|
|
297
314
|
} catch {
|
|
298
|
-
BCLogger.error("Failed to load config from storage: \(error)")
|
|
315
|
+
BCLogger.error("Failed to load config from storage: \(Self.describeDecodingError(error))")
|
|
299
316
|
return nil
|
|
300
317
|
}
|
|
301
318
|
}
|
|
302
319
|
|
|
320
|
+
/**
|
|
321
|
+
* Produce a human-readable description from a DecodingError
|
|
322
|
+
*/
|
|
323
|
+
private static func describeDecodingError(_ error: Error) -> String {
|
|
324
|
+
guard let decodingError = error as? DecodingError else {
|
|
325
|
+
return error.localizedDescription
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
let path: String
|
|
329
|
+
let detail: String
|
|
330
|
+
|
|
331
|
+
switch decodingError {
|
|
332
|
+
case .keyNotFound(let key, let context):
|
|
333
|
+
path = Self.formatCodingPath(context.codingPath)
|
|
334
|
+
detail = "missing required field '\(key.stringValue)'"
|
|
335
|
+
case .typeMismatch(let type, let context):
|
|
336
|
+
path = Self.formatCodingPath(context.codingPath)
|
|
337
|
+
detail = "expected \(type)"
|
|
338
|
+
case .valueNotFound(let type, let context):
|
|
339
|
+
path = Self.formatCodingPath(context.codingPath)
|
|
340
|
+
detail = "null value for \(type)"
|
|
341
|
+
case .dataCorrupted(let context):
|
|
342
|
+
path = Self.formatCodingPath(context.codingPath)
|
|
343
|
+
detail = context.debugDescription
|
|
344
|
+
@unknown default:
|
|
345
|
+
return error.localizedDescription
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return path.isEmpty ? detail : "\(path): \(detail)"
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
private static func formatCodingPath(_ codingPath: [CodingKey]) -> String {
|
|
352
|
+
return codingPath.map { key in
|
|
353
|
+
if let index = key.intValue {
|
|
354
|
+
return "[\(index)]"
|
|
355
|
+
}
|
|
356
|
+
return key.stringValue
|
|
357
|
+
}.joined(separator: ".")
|
|
358
|
+
}
|
|
359
|
+
|
|
303
360
|
/**
|
|
304
361
|
* Save config to persistent storage
|
|
305
362
|
*/
|
|
@@ -860,6 +860,8 @@ internal struct ImpressionContext {
|
|
|
860
860
|
|
|
861
861
|
/// Placement configuration
|
|
862
862
|
let placementId: String
|
|
863
|
+
/// UUID for backend reporting (slot_id)
|
|
864
|
+
let slotId: String
|
|
863
865
|
let gamAdUnit: String
|
|
864
866
|
let format: String
|
|
865
867
|
|
|
@@ -875,6 +877,7 @@ internal struct ImpressionContext {
|
|
|
875
877
|
|
|
876
878
|
init(
|
|
877
879
|
placementId: String,
|
|
880
|
+
slotId: String,
|
|
878
881
|
gamAdUnit: String,
|
|
879
882
|
format: String,
|
|
880
883
|
width: Int? = nil,
|
|
@@ -882,6 +885,7 @@ internal struct ImpressionContext {
|
|
|
882
885
|
) {
|
|
883
886
|
self.impressionId = UUID().uuidString
|
|
884
887
|
self.placementId = placementId
|
|
888
|
+
self.slotId = slotId
|
|
885
889
|
self.gamAdUnit = gamAdUnit
|
|
886
890
|
self.format = format
|
|
887
891
|
self.width = width
|
|
@@ -8,6 +8,7 @@ import Foundation
|
|
|
8
8
|
* in the top-level `AppConfig.bidders` dictionary.
|
|
9
9
|
*/
|
|
10
10
|
public struct PlacementConfig: Codable {
|
|
11
|
+
public let id: String
|
|
11
12
|
public let placementId: String
|
|
12
13
|
public let format: String // "banner", "interstitial", "rewarded"
|
|
13
14
|
public let gamAdUnit: String
|
|
@@ -16,6 +17,7 @@ public struct PlacementConfig: Codable {
|
|
|
16
17
|
public let floorPrice: Double?
|
|
17
18
|
|
|
18
19
|
public init(
|
|
20
|
+
id: String,
|
|
19
21
|
placementId: String,
|
|
20
22
|
format: String,
|
|
21
23
|
gamAdUnit: String,
|
|
@@ -23,6 +25,7 @@ public struct PlacementConfig: Codable {
|
|
|
23
25
|
refresh: RefreshConfig? = nil,
|
|
24
26
|
floorPrice: Double? = nil
|
|
25
27
|
) {
|
|
28
|
+
self.id = id
|
|
26
29
|
self.placementId = placementId
|
|
27
30
|
self.format = format
|
|
28
31
|
self.gamAdUnit = gamAdUnit
|
package/ios/BigCrunchAdsModule.m
CHANGED
|
@@ -89,6 +89,11 @@ RCT_EXTERN_METHOD(setCoppaCompliant:(BOOL)compliant
|
|
|
89
89
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
90
90
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
91
91
|
|
|
92
|
+
// Account Type
|
|
93
|
+
RCT_EXTERN_METHOD(setAccountType:(NSString *)accountType
|
|
94
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
95
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
96
|
+
|
|
92
97
|
// Debug Settings
|
|
93
98
|
RCT_EXTERN_METHOD(setDebugMode:(BOOL)enabled
|
|
94
99
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
@@ -616,6 +616,16 @@ class BigCrunchAdsModule: RCTEventEmitter {
|
|
|
616
616
|
resolver(nil)
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
+
// MARK: - Account Type
|
|
620
|
+
|
|
621
|
+
@objc(setAccountType:resolver:rejecter:)
|
|
622
|
+
func setAccountType(accountType: String,
|
|
623
|
+
resolver: RCTPromiseResolveBlock,
|
|
624
|
+
rejecter: RCTPromiseRejectBlock) {
|
|
625
|
+
BigCrunchAds.setAccountType(accountType)
|
|
626
|
+
resolver(nil)
|
|
627
|
+
}
|
|
628
|
+
|
|
619
629
|
// MARK: - Debug & Testing
|
|
620
630
|
|
|
621
631
|
@objc(setDebugMode:resolver:rejecter:)
|
package/lib/BigCrunchAds.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* BigCrunch Mobile Ads SDK for React Native
|
|
3
3
|
* Main API class
|
|
4
4
|
*/
|
|
5
|
-
import type { InitializationOptions, Environment, SessionInfo, DeviceContext, AppConfig, EventSubscription, ScreenViewOptions } from './types';
|
|
5
|
+
import type { InitializationOptions, Environment, AccountType, SessionInfo, DeviceContext, AppConfig, EventSubscription, ScreenViewOptions } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* Main entry point for BigCrunch Mobile Ads SDK
|
|
8
8
|
*/
|
|
@@ -97,6 +97,20 @@ export declare class BigCrunchAds {
|
|
|
97
97
|
* @param isCompliant - Whether the app is COPPA compliant
|
|
98
98
|
*/
|
|
99
99
|
static setCoppaCompliant(isCompliant: boolean): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Set the account type for the current user
|
|
102
|
+
*
|
|
103
|
+
* This value is included in all analytics events (pageviews, impressions, revenue, etc.)
|
|
104
|
+
* and persists until changed. Defaults to 'guest' if not set.
|
|
105
|
+
*
|
|
106
|
+
* @param accountType - The user's account type
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* BigCrunchAds.setAccountType('subscriber');
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
static setAccountType(accountType: AccountType): Promise<void>;
|
|
100
114
|
/**
|
|
101
115
|
* Enable or disable debug mode
|
|
102
116
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BigCrunchAds.d.ts","sourceRoot":"","sources":["../src/BigCrunchAds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;IACzC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA8B;IAElE;;;;;;;;;;;;;;;OAeG;WACU,UAAU,CACrB,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,WAA0B,EACvC,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC;IA0BhB;;OAEG;WACU,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAO9C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;WACU,eAAe,CAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC;IAKhB;;;OAGG;WACU,YAAY,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAKtD;;OAEG;WACU,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3C;;OAEG;WACU,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAKnD;;OAEG;WACU,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7C;;OAEG;WACU,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;IAIvD;;;;OAIG;WACU,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D;;;;OAIG;WACU,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,C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M,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,iBAAiB;IAI1E;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,iBAAiB;IAIpF;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,iBAAiB;IAIlF;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAOjC;AAGD,eAAe,YAAY,CAAC"}
|
package/lib/BigCrunchAds.js
CHANGED
|
@@ -146,6 +146,22 @@ export class BigCrunchAds {
|
|
|
146
146
|
static async setCoppaCompliant(isCompliant) {
|
|
147
147
|
return NativeBigCrunchAds.setCoppaCompliant(isCompliant);
|
|
148
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Set the account type for the current user
|
|
151
|
+
*
|
|
152
|
+
* This value is included in all analytics events (pageviews, impressions, revenue, etc.)
|
|
153
|
+
* and persists until changed. Defaults to 'guest' if not set.
|
|
154
|
+
*
|
|
155
|
+
* @param accountType - The user's account type
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* BigCrunchAds.setAccountType('subscriber');
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
static async setAccountType(accountType) {
|
|
163
|
+
return NativeBigCrunchAds.setAccountType(accountType);
|
|
164
|
+
}
|
|
149
165
|
/**
|
|
150
166
|
* Enable or disable debug mode
|
|
151
167
|
*
|
|
@@ -24,6 +24,7 @@ export interface NativeBigCrunchAdsModule {
|
|
|
24
24
|
setGdprConsent(consent: string): Promise<void>;
|
|
25
25
|
setCcpaString(ccpaString: string): Promise<void>;
|
|
26
26
|
setCoppaCompliant(isCompliant: boolean): Promise<void>;
|
|
27
|
+
setAccountType(accountType: string): Promise<void>;
|
|
27
28
|
setDebugMode(enabled: boolean): Promise<void>;
|
|
28
29
|
addTestDevice(deviceId: string): Promise<void>;
|
|
29
30
|
removeTestDevice(deviceId: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBigCrunchAds.d.ts","sourceRoot":"","sources":["../src/NativeBigCrunchAds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAiB,kBAAkB,EAAY,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjI,MAAM,WAAW,wBAAwB;IAEvC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAGlC,YAAY,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC1C,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAG/B,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGhF,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGxD,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,g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;;;;;;;;;;;;;CAqCnB,CAAC"}
|
package/lib/types/config.d.ts
CHANGED
|
@@ -27,7 +27,9 @@ export interface AppConfig {
|
|
|
27
27
|
* Individual placement configuration
|
|
28
28
|
*/
|
|
29
29
|
export interface PlacementConfig {
|
|
30
|
-
/** Unique placement
|
|
30
|
+
/** Unique placement UUID for backend reporting */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Developer-facing placement identifier */
|
|
31
33
|
placementId: string;
|
|
32
34
|
/** Placement name for reporting */
|
|
33
35
|
placementName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,oCAAoC;IACpC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,sBAAsB;IACtB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB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BAAiB;IAChC,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uCAAuC;IACvC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0CAA0C;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export * from './ads';
|
|
|
9
9
|
* SDK Environment options
|
|
10
10
|
*/
|
|
11
11
|
export type Environment = 'production' | 'sandbox';
|
|
12
|
+
/**
|
|
13
|
+
* Account type for the current user
|
|
14
|
+
*/
|
|
15
|
+
export type AccountType = 'guest' | 'logged_in' | 'paid' | 'subscriber' | 'free';
|
|
12
16
|
/**
|
|
13
17
|
* Ad formats supported by the SDK
|
|
14
18
|
*/
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,UAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,cAAc,GACd,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,UAAU,GACV,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW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MAAM,CAAC;IACtB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,EAAE,EAAE,KAAK,GAAG,SAAS,CAAC;IACtB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigcrunch/react-native-ads",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "BigCrunch Mobile Ads SDK for React Native - Simplified in-app advertising with S2S demand and Google Ad Manager",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -92,4 +92,4 @@
|
|
|
92
92
|
"optional": false
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
}
|
|
95
|
+
}
|
package/src/BigCrunchAds.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import type {
|
|
12
12
|
InitializationOptions,
|
|
13
13
|
Environment,
|
|
14
|
+
AccountType,
|
|
14
15
|
SessionInfo,
|
|
15
16
|
DeviceContext,
|
|
16
17
|
AppConfig,
|
|
@@ -183,6 +184,23 @@ export class BigCrunchAds {
|
|
|
183
184
|
return NativeBigCrunchAds.setCoppaCompliant(isCompliant);
|
|
184
185
|
}
|
|
185
186
|
|
|
187
|
+
/**
|
|
188
|
+
* Set the account type for the current user
|
|
189
|
+
*
|
|
190
|
+
* This value is included in all analytics events (pageviews, impressions, revenue, etc.)
|
|
191
|
+
* and persists until changed. Defaults to 'guest' if not set.
|
|
192
|
+
*
|
|
193
|
+
* @param accountType - The user's account type
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* BigCrunchAds.setAccountType('subscriber');
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
static async setAccountType(accountType: AccountType): Promise<void> {
|
|
201
|
+
return NativeBigCrunchAds.setAccountType(accountType);
|
|
202
|
+
}
|
|
203
|
+
|
|
186
204
|
/**
|
|
187
205
|
* Enable or disable debug mode
|
|
188
206
|
*
|
|
@@ -43,6 +43,9 @@ export interface NativeBigCrunchAdsModule {
|
|
|
43
43
|
setCcpaString(ccpaString: string): Promise<void>;
|
|
44
44
|
setCoppaCompliant(isCompliant: boolean): Promise<void>;
|
|
45
45
|
|
|
46
|
+
// Account type
|
|
47
|
+
setAccountType(accountType: string): Promise<void>;
|
|
48
|
+
|
|
46
49
|
// Debug
|
|
47
50
|
setDebugMode(enabled: boolean): Promise<void>;
|
|
48
51
|
addTestDevice(deviceId: string): Promise<void>;
|
package/src/types/config.ts
CHANGED
|
@@ -30,7 +30,9 @@ export interface AppConfig {
|
|
|
30
30
|
* Individual placement configuration
|
|
31
31
|
*/
|
|
32
32
|
export interface PlacementConfig {
|
|
33
|
-
/** Unique placement
|
|
33
|
+
/** Unique placement UUID for backend reporting */
|
|
34
|
+
id: string;
|
|
35
|
+
/** Developer-facing placement identifier */
|
|
34
36
|
placementId: string;
|
|
35
37
|
/** Placement name for reporting */
|
|
36
38
|
placementName?: string;
|
package/src/types/index.ts
CHANGED
|
@@ -12,6 +12,11 @@ export * from './ads';
|
|
|
12
12
|
*/
|
|
13
13
|
export type Environment = 'production' | 'sandbox';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Account type for the current user
|
|
17
|
+
*/
|
|
18
|
+
export type AccountType = 'guest' | 'logged_in' | 'paid' | 'subscriber' | 'free';
|
|
19
|
+
|
|
15
20
|
/**
|
|
16
21
|
* Ad formats supported by the SDK
|
|
17
22
|
*/
|