@bigcrunch/react-native-ads 0.2.0 → 0.3.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/README.md +3 -3
- package/android/build.gradle +7 -3
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchAdsModule.kt +21 -6
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchBannerViewManager.kt +21 -5
- package/ios/BigCrunchAdsModule.swift +10 -6
- package/ios/BigCrunchBannerViewManager.swift +22 -27
- package/lib/BigCrunchAds.d.ts +1 -3
- package/lib/BigCrunchAds.d.ts.map +1 -1
- package/lib/BigCrunchAds.js +1 -4
- package/lib/types/config.d.ts +24 -29
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/index.d.ts +0 -2
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-bigcrunch-ads.podspec +1 -1
- package/src/BigCrunchAds.ts +0 -4
- package/src/types/config.ts +25 -30
- package/src/types/index.ts +0 -2
package/README.md
CHANGED
|
@@ -59,7 +59,6 @@ async function initializeAds() {
|
|
|
59
59
|
try {
|
|
60
60
|
await BigCrunchAds.initialize(
|
|
61
61
|
'your-property-id',
|
|
62
|
-
'your-api-key',
|
|
63
62
|
'production' // or 'sandbox'
|
|
64
63
|
);
|
|
65
64
|
console.log('BigCrunch Ads initialized successfully');
|
|
@@ -113,7 +112,8 @@ function HomeScreen() {
|
|
|
113
112
|
- `MEDIUM_RECTANGLE` - 300x250
|
|
114
113
|
- `FULL_BANNER` - 468x60
|
|
115
114
|
- `LEADERBOARD` - 728x90
|
|
116
|
-
- `ADAPTIVE` -
|
|
115
|
+
- `ADAPTIVE` - Full-width adaptive banner (recommended). Google calculates the optimal height for the device screen width.
|
|
116
|
+
- `SMART` - Deprecated, alias for `ADAPTIVE`
|
|
117
117
|
- Custom size: `{ width: 300, height: 250 }`
|
|
118
118
|
|
|
119
119
|
### Interstitial Ads
|
|
@@ -285,7 +285,7 @@ import type {
|
|
|
285
285
|
|
|
286
286
|
| Method | Description |
|
|
287
287
|
|--------|-------------|
|
|
288
|
-
| `initialize(propertyId,
|
|
288
|
+
| `initialize(propertyId, environment)` | Initialize the SDK |
|
|
289
289
|
| `trackScreenView(screenName)` | Track a screen view |
|
|
290
290
|
| `getAppConfig()` | Get current app configuration |
|
|
291
291
|
| `getSessionInfo()` | Get current session information |
|
package/android/build.gradle
CHANGED
|
@@ -37,12 +37,12 @@ android {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
compileOptions {
|
|
40
|
-
sourceCompatibility JavaVersion.
|
|
41
|
-
targetCompatibility JavaVersion.
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
kotlinOptions {
|
|
45
|
-
jvmTarget = '
|
|
45
|
+
jvmTarget = '11'
|
|
46
46
|
freeCompilerArgs += ['-Xskip-metadata-version-check']
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -64,6 +64,10 @@ dependencies {
|
|
|
64
64
|
// as transitive dependencies, eliminating the need for duplication
|
|
65
65
|
implementation project(':bigcrunch-ads')
|
|
66
66
|
|
|
67
|
+
// Google Ads SDK - needed at compile time for AdSize reference in BigCrunchBannerViewManager
|
|
68
|
+
// (main SDK uses 'implementation' so it's not transitively available)
|
|
69
|
+
compileOnly 'com.google.android.gms:play-services-ads:22.6.0'
|
|
70
|
+
|
|
67
71
|
// Coroutines - needed by React Native bridge code
|
|
68
72
|
// (Native SDK uses 'implementation' so not automatically transitive)
|
|
69
73
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
|
|
@@ -31,8 +31,6 @@ class BigCrunchAdsModule(reactContext: ReactApplicationContext) :
|
|
|
31
31
|
try {
|
|
32
32
|
val propertyId = options.getString("propertyId")
|
|
33
33
|
?: throw IllegalArgumentException("propertyId is required")
|
|
34
|
-
val apiKey = options.getString("apiKey")
|
|
35
|
-
?: throw IllegalArgumentException("apiKey is required")
|
|
36
34
|
val environment = options.getString("environment") ?: "production"
|
|
37
35
|
val debug = if (options.hasKey("debug")) options.getBoolean("debug") else false
|
|
38
36
|
|
|
@@ -44,7 +42,6 @@ class BigCrunchAdsModule(reactContext: ReactApplicationContext) :
|
|
|
44
42
|
BigCrunchAds.initialize(
|
|
45
43
|
context = context,
|
|
46
44
|
propertyId = propertyId,
|
|
47
|
-
apiKey = apiKey,
|
|
48
45
|
env = if (environment == "staging")
|
|
49
46
|
BigCrunchAds.Environment.Staging
|
|
50
47
|
else
|
|
@@ -599,9 +596,27 @@ class BigCrunchAdsModule(reactContext: ReactApplicationContext) :
|
|
|
599
596
|
map.putArray("sizes", sizesArray)
|
|
600
597
|
}
|
|
601
598
|
|
|
602
|
-
// Add
|
|
603
|
-
config.
|
|
604
|
-
|
|
599
|
+
// Add bidders array if available
|
|
600
|
+
config.bidders?.let { bidders ->
|
|
601
|
+
val biddersArray = Arguments.createArray()
|
|
602
|
+
for (bidderConfig in bidders) {
|
|
603
|
+
val bidderMap = Arguments.createMap()
|
|
604
|
+
bidderMap.putString("bidder", bidderConfig.bidder)
|
|
605
|
+
bidderConfig.params?.let { params ->
|
|
606
|
+
val paramsMap = Arguments.createMap()
|
|
607
|
+
for ((key, value) in params) {
|
|
608
|
+
when (value) {
|
|
609
|
+
is String -> paramsMap.putString(key, value)
|
|
610
|
+
is Int -> paramsMap.putInt(key, value)
|
|
611
|
+
is Double -> paramsMap.putDouble(key, value)
|
|
612
|
+
is Boolean -> paramsMap.putBoolean(key, value)
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
bidderMap.putMap("params", paramsMap)
|
|
616
|
+
}
|
|
617
|
+
biddersArray.pushMap(bidderMap)
|
|
618
|
+
}
|
|
619
|
+
map.putArray("bidders", biddersArray)
|
|
605
620
|
}
|
|
606
621
|
|
|
607
622
|
// Add refresh config if available
|
|
@@ -83,22 +83,38 @@ class BigCrunchBannerViewManager : SimpleViewManager<BigCrunchBannerView>() {
|
|
|
83
83
|
"MEDIUM_RECTANGLE" -> AdSize(300, 250)
|
|
84
84
|
"FULL_BANNER" -> AdSize(468, 60)
|
|
85
85
|
"LEADERBOARD" -> AdSize(728, 90)
|
|
86
|
-
"ADAPTIVE" -> AdSize(
|
|
87
|
-
"SMART" -> AdSize(
|
|
86
|
+
"ADAPTIVE" -> AdSize.adaptive(0)
|
|
87
|
+
"SMART" -> AdSize.adaptive(0) // Deprecated, use ADAPTIVE
|
|
88
88
|
else -> AdSize(320, 50)
|
|
89
89
|
}
|
|
90
90
|
view.setAdSize(adSize)
|
|
91
91
|
|
|
92
|
+
// For adaptive sizes, resolve concrete dimensions for layout
|
|
93
|
+
val layoutWidth: Int
|
|
94
|
+
val layoutHeight: Int
|
|
95
|
+
if (adSize.isAdaptive) {
|
|
96
|
+
val displayMetrics = view.resources.displayMetrics
|
|
97
|
+
val widthDp = (displayMetrics.widthPixels / displayMetrics.density).toInt()
|
|
98
|
+
val googleAdSize = com.google.android.gms.ads.AdSize
|
|
99
|
+
.getCurrentOrientationAnchoredAdaptiveBannerAdSize(view.context, widthDp)
|
|
100
|
+
layoutWidth = googleAdSize.width
|
|
101
|
+
layoutHeight = googleAdSize.height
|
|
102
|
+
} else {
|
|
103
|
+
layoutWidth = adSize.width
|
|
104
|
+
layoutHeight = adSize.height
|
|
105
|
+
}
|
|
106
|
+
|
|
92
107
|
// Set minimum height based on ad size to ensure visibility
|
|
93
108
|
val density = view.resources.displayMetrics.density
|
|
94
|
-
val minHeightPx = (
|
|
95
|
-
val minWidthPx = (
|
|
109
|
+
val minHeightPx = (layoutHeight * density).toInt()
|
|
110
|
+
val minWidthPx = (layoutWidth * density).toInt()
|
|
96
111
|
view.minimumHeight = minHeightPx
|
|
97
112
|
view.minimumWidth = minWidthPx
|
|
98
113
|
|
|
99
114
|
android.util.Log.d("BigCrunchBannerViewManager", """
|
|
100
115
|
=== SIZE SET ===
|
|
101
|
-
Ad size: ${adSize.width}x${adSize.height} dp
|
|
116
|
+
Ad size: ${adSize.width}x${adSize.height} dp (adaptive=${adSize.isAdaptive})
|
|
117
|
+
Layout size: ${layoutWidth}x${layoutHeight} dp
|
|
102
118
|
Density: $density
|
|
103
119
|
Minimum pixels: ${minWidthPx}x${minHeightPx}
|
|
104
120
|
View parent: ${view.parent?.javaClass?.simpleName}
|
|
@@ -196,9 +196,8 @@ class BigCrunchAdsModule: RCTEventEmitter {
|
|
|
196
196
|
func initialize(options: NSDictionary,
|
|
197
197
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
198
198
|
rejecter: @escaping RCTPromiseRejectBlock) {
|
|
199
|
-
guard let propertyId = options["propertyId"] as? String
|
|
200
|
-
|
|
201
|
-
rejecter("INIT_ERROR", "propertyId and apiKey are required", nil)
|
|
199
|
+
guard let propertyId = options["propertyId"] as? String else {
|
|
200
|
+
rejecter("INIT_ERROR", "propertyId is required", nil)
|
|
202
201
|
return
|
|
203
202
|
}
|
|
204
203
|
|
|
@@ -212,7 +211,6 @@ class BigCrunchAdsModule: RCTEventEmitter {
|
|
|
212
211
|
|
|
213
212
|
BigCrunchAds.initialize(
|
|
214
213
|
propertyId: propertyId,
|
|
215
|
-
apiKey: apiKey,
|
|
216
214
|
env: env,
|
|
217
215
|
useMockConfig: useMockConfig
|
|
218
216
|
)
|
|
@@ -272,8 +270,14 @@ class BigCrunchAdsModule: RCTEventEmitter {
|
|
|
272
270
|
if let sizes = placement.sizes {
|
|
273
271
|
placementDict["sizes"] = sizes.map { ["width": $0.width, "height": $0.height] }
|
|
274
272
|
}
|
|
275
|
-
if let
|
|
276
|
-
placementDict["
|
|
273
|
+
if let bidders = placement.bidders {
|
|
274
|
+
placementDict["bidders"] = bidders.map { bidderConfig in
|
|
275
|
+
var bidderDict: [String: Any] = ["bidder": bidderConfig.bidder]
|
|
276
|
+
if let params = bidderConfig.params {
|
|
277
|
+
bidderDict["params"] = params.mapValues { $0.value }
|
|
278
|
+
}
|
|
279
|
+
return bidderDict
|
|
280
|
+
}
|
|
277
281
|
}
|
|
278
282
|
return placementDict
|
|
279
283
|
}
|
|
@@ -152,50 +152,45 @@ class BigCrunchBannerViewWrapper: UIView {
|
|
|
152
152
|
func updateAdSize() {
|
|
153
153
|
guard let bannerView = bannerView else { return }
|
|
154
154
|
|
|
155
|
-
var
|
|
156
|
-
var
|
|
155
|
+
var googleAdSize: GoogleMobileAds.AdSize
|
|
156
|
+
var bcAdSize: BCAdSize
|
|
157
157
|
|
|
158
158
|
if let width = _customWidth, let height = _customHeight {
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
bcAdSize = BCAdSize(width: Int(width), height: Int(height))
|
|
160
|
+
googleAdSize = GoogleMobileAds.adSizeFor(cgSize: CGSize(width: width, height: height))
|
|
161
161
|
} else {
|
|
162
162
|
switch sizeString {
|
|
163
163
|
case "BANNER":
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
bcAdSize = BCAdSize(width: 320, height: 50)
|
|
165
|
+
googleAdSize = GoogleMobileAds.AdSizeBanner
|
|
166
166
|
case "LARGE_BANNER":
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
bcAdSize = BCAdSize(width: 320, height: 100)
|
|
168
|
+
googleAdSize = GoogleMobileAds.AdSizeLargeBanner
|
|
169
169
|
case "MEDIUM_RECTANGLE":
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
bcAdSize = BCAdSize(width: 300, height: 250)
|
|
171
|
+
googleAdSize = GoogleMobileAds.AdSizeMediumRectangle
|
|
172
172
|
case "FULL_BANNER":
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
bcAdSize = BCAdSize(width: 468, height: 60)
|
|
174
|
+
googleAdSize = GoogleMobileAds.AdSizeFullBanner
|
|
175
175
|
case "LEADERBOARD":
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
case "ADAPTIVE":
|
|
176
|
+
bcAdSize = BCAdSize(width: 728, height: 90)
|
|
177
|
+
googleAdSize = GoogleMobileAds.AdSizeLeaderboard
|
|
178
|
+
case "ADAPTIVE", "SMART":
|
|
179
179
|
let frame = self.frame.width > 0 ? self.frame : UIScreen.main.bounds
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
case "SMART":
|
|
183
|
-
// Smart banner is deprecated, use adaptive
|
|
184
|
-
let frame = self.frame.width > 0 ? self.frame : UIScreen.main.bounds
|
|
185
|
-
adSize = GoogleMobileAds.currentOrientationAnchoredAdaptiveBanner(width: frame.width)
|
|
186
|
-
sizeOverride = adSize.size
|
|
180
|
+
bcAdSize = BCAdSize.adaptive(width: Int(frame.width))
|
|
181
|
+
googleAdSize = GoogleMobileAds.currentOrientationAnchoredAdaptiveBanner(width: frame.width)
|
|
187
182
|
default:
|
|
188
|
-
|
|
189
|
-
|
|
183
|
+
bcAdSize = BCAdSize(width: 320, height: 50)
|
|
184
|
+
googleAdSize = GoogleMobileAds.AdSizeBanner
|
|
190
185
|
}
|
|
191
186
|
}
|
|
192
187
|
|
|
193
188
|
// Set the size override on the native banner view
|
|
194
|
-
bannerView.adSizeOverride =
|
|
189
|
+
bannerView.adSizeOverride = bcAdSize
|
|
195
190
|
|
|
196
|
-
// Update frame constraints
|
|
191
|
+
// Update frame constraints using resolved Google size for layout
|
|
197
192
|
if _customWidth == nil && _customHeight == nil {
|
|
198
|
-
self.frame.size =
|
|
193
|
+
self.frame.size = googleAdSize.size
|
|
199
194
|
}
|
|
200
195
|
}
|
|
201
196
|
|
package/lib/BigCrunchAds.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare class BigCrunchAds {
|
|
|
14
14
|
* Must be called before using any other SDK features
|
|
15
15
|
*
|
|
16
16
|
* @param propertyId - Your BigCrunch property ID
|
|
17
|
-
* @param apiKey - Your API key for authentication
|
|
18
17
|
* @param environment - Environment to use (default: 'production')
|
|
19
18
|
* @param options - Additional initialization options
|
|
20
19
|
*
|
|
@@ -22,12 +21,11 @@ export declare class BigCrunchAds {
|
|
|
22
21
|
* ```typescript
|
|
23
22
|
* await BigCrunchAds.initialize(
|
|
24
23
|
* 'your-property-id',
|
|
25
|
-
* 'your-api-key',
|
|
26
24
|
* 'production'
|
|
27
25
|
* );
|
|
28
26
|
* ```
|
|
29
27
|
*/
|
|
30
|
-
static initialize(propertyId: string,
|
|
28
|
+
static initialize(propertyId: string, environment?: Environment, options?: Partial<InitializationOptions>): Promise<void>;
|
|
31
29
|
/**
|
|
32
30
|
* Check if the SDK is initialized
|
|
33
31
|
*/
|
|
@@ -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,EAClB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;IACzC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA8B;IAElE
|
|
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,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;;;;;;;;;O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AI,OAAO,CAAC,IAAI,CAAC;IAIhD;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAC7B,iBAAiB;IAOpB;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,GAAG,iBAAiB;IAIhF;;OAEG;IACH,MAAM,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
|
@@ -14,7 +14,6 @@ export class BigCrunchAds {
|
|
|
14
14
|
* Must be called before using any other SDK features
|
|
15
15
|
*
|
|
16
16
|
* @param propertyId - Your BigCrunch property ID
|
|
17
|
-
* @param apiKey - Your API key for authentication
|
|
18
17
|
* @param environment - Environment to use (default: 'production')
|
|
19
18
|
* @param options - Additional initialization options
|
|
20
19
|
*
|
|
@@ -22,19 +21,17 @@ export class BigCrunchAds {
|
|
|
22
21
|
* ```typescript
|
|
23
22
|
* await BigCrunchAds.initialize(
|
|
24
23
|
* 'your-property-id',
|
|
25
|
-
* 'your-api-key',
|
|
26
24
|
* 'production'
|
|
27
25
|
* );
|
|
28
26
|
* ```
|
|
29
27
|
*/
|
|
30
|
-
static async initialize(propertyId,
|
|
28
|
+
static async initialize(propertyId, environment = 'production', options) {
|
|
31
29
|
if (this.isInitializedFlag) {
|
|
32
30
|
console.warn('BigCrunchAds: SDK is already initialized');
|
|
33
31
|
return this.initializationPromise;
|
|
34
32
|
}
|
|
35
33
|
const initOptions = {
|
|
36
34
|
propertyId,
|
|
37
|
-
apiKey,
|
|
38
35
|
environment,
|
|
39
36
|
...options,
|
|
40
37
|
};
|
package/lib/types/config.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ export interface PlacementConfig {
|
|
|
33
33
|
gamAdUnit: string;
|
|
34
34
|
/** Ad size configuration */
|
|
35
35
|
size?: AdSizeConfig;
|
|
36
|
-
/** Prebid
|
|
37
|
-
|
|
36
|
+
/** Prebid bidder configurations */
|
|
37
|
+
bidders?: BidderConfig[];
|
|
38
38
|
/** Amazon APS configuration */
|
|
39
39
|
amazonConfig?: AmazonConfig;
|
|
40
40
|
/** Placement-specific settings */
|
|
@@ -54,34 +54,16 @@ export interface AdSizeConfig {
|
|
|
54
54
|
adaptive?: boolean;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Prebid
|
|
57
|
+
* Configuration for a single Prebid bidder
|
|
58
|
+
*
|
|
59
|
+
* Contains the bidder name and its params, which get passed inline
|
|
60
|
+
* to the S2S endpoint in the bid request.
|
|
58
61
|
*/
|
|
59
|
-
export interface
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
/** Timeout for prebid requests in milliseconds */
|
|
65
|
-
timeout?: number;
|
|
66
|
-
/** Enable debug mode for prebid */
|
|
67
|
-
debug?: boolean;
|
|
68
|
-
/** Custom targeting parameters */
|
|
69
|
-
customTargeting?: Record<string, string>;
|
|
70
|
-
/** Price granularity */
|
|
71
|
-
priceGranularity?: 'low' | 'medium' | 'high' | 'auto' | 'dense' | 'custom';
|
|
72
|
-
/** Custom price granularity buckets */
|
|
73
|
-
customPriceGranularity?: PriceGranularityBucket[];
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Price granularity bucket configuration
|
|
77
|
-
*/
|
|
78
|
-
export interface PriceGranularityBucket {
|
|
79
|
-
/** Minimum price */
|
|
80
|
-
min: number;
|
|
81
|
-
/** Maximum price */
|
|
82
|
-
max: number;
|
|
83
|
-
/** Increment */
|
|
84
|
-
increment: number;
|
|
62
|
+
export interface BidderConfig {
|
|
63
|
+
/** Bidder name (e.g., "appnexus", "rubicon") */
|
|
64
|
+
bidder: string;
|
|
65
|
+
/** Bidder-specific parameters */
|
|
66
|
+
params?: Record<string, any>;
|
|
85
67
|
}
|
|
86
68
|
/**
|
|
87
69
|
* Amazon APS configuration
|
|
@@ -118,6 +100,19 @@ export interface GlobalSettings {
|
|
|
118
100
|
ccpaString?: string;
|
|
119
101
|
/** COPPA compliance */
|
|
120
102
|
coppaCompliant?: boolean;
|
|
103
|
+
/** Global refresh config (defaults for all banner placements) */
|
|
104
|
+
refresh?: RefreshConfig;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Refresh configuration for banner ads
|
|
108
|
+
*/
|
|
109
|
+
export interface RefreshConfig {
|
|
110
|
+
/** Whether refresh is enabled */
|
|
111
|
+
enabled: boolean;
|
|
112
|
+
/** Refresh interval in milliseconds */
|
|
113
|
+
intervalMs: number;
|
|
114
|
+
/** Maximum number of refreshes */
|
|
115
|
+
maxRefreshes: number;
|
|
121
116
|
}
|
|
122
117
|
/**
|
|
123
118
|
* Placement-specific settings
|
|
@@ -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,oCAAoC;IACpC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,sBAAsB;IACtB,QAAQ,CAAC,EAA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AC;IACzB,iEAAiE;IACjE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;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
|
@@ -30,8 +30,6 @@ export interface CustomSize {
|
|
|
30
30
|
export interface InitializationOptions {
|
|
31
31
|
/** Your BigCrunch property ID */
|
|
32
32
|
propertyId: string;
|
|
33
|
-
/** Your API key for authentication */
|
|
34
|
-
apiKey: string;
|
|
35
33
|
/** Environment to use */
|
|
36
34
|
environment?: Environment;
|
|
37
35
|
/** Enable debug logging */
|
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,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AAC;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.3.0",
|
|
4
4
|
"description": "BigCrunch Mobile Ads SDK for React Native - Simplified in-app advertising with Prebid and Google Ad Manager",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
|
|
|
21
21
|
s.dependency "React"
|
|
22
22
|
s.dependency "BigCrunchAds", "~> 0.1.0" # Reference to main iOS SDK
|
|
23
23
|
s.dependency "Google-Mobile-Ads-SDK", ">= 10.14.0"
|
|
24
|
-
s.dependency "PrebidMobile", "~> 2.1
|
|
24
|
+
s.dependency "PrebidMobile", "~> 2.3.1"
|
|
25
25
|
|
|
26
26
|
s.swift_version = "5.9"
|
|
27
27
|
end
|
package/src/BigCrunchAds.ts
CHANGED
|
@@ -29,7 +29,6 @@ export class BigCrunchAds {
|
|
|
29
29
|
* Must be called before using any other SDK features
|
|
30
30
|
*
|
|
31
31
|
* @param propertyId - Your BigCrunch property ID
|
|
32
|
-
* @param apiKey - Your API key for authentication
|
|
33
32
|
* @param environment - Environment to use (default: 'production')
|
|
34
33
|
* @param options - Additional initialization options
|
|
35
34
|
*
|
|
@@ -37,14 +36,12 @@ export class BigCrunchAds {
|
|
|
37
36
|
* ```typescript
|
|
38
37
|
* await BigCrunchAds.initialize(
|
|
39
38
|
* 'your-property-id',
|
|
40
|
-
* 'your-api-key',
|
|
41
39
|
* 'production'
|
|
42
40
|
* );
|
|
43
41
|
* ```
|
|
44
42
|
*/
|
|
45
43
|
static async initialize(
|
|
46
44
|
propertyId: string,
|
|
47
|
-
apiKey: string,
|
|
48
45
|
environment: Environment = 'production',
|
|
49
46
|
options?: Partial<InitializationOptions>
|
|
50
47
|
): Promise<void> {
|
|
@@ -55,7 +52,6 @@ export class BigCrunchAds {
|
|
|
55
52
|
|
|
56
53
|
const initOptions: InitializationOptions = {
|
|
57
54
|
propertyId,
|
|
58
|
-
apiKey,
|
|
59
55
|
environment,
|
|
60
56
|
...options,
|
|
61
57
|
};
|
package/src/types/config.ts
CHANGED
|
@@ -36,8 +36,8 @@ export interface PlacementConfig {
|
|
|
36
36
|
gamAdUnit: string;
|
|
37
37
|
/** Ad size configuration */
|
|
38
38
|
size?: AdSizeConfig;
|
|
39
|
-
/** Prebid
|
|
40
|
-
|
|
39
|
+
/** Prebid bidder configurations */
|
|
40
|
+
bidders?: BidderConfig[];
|
|
41
41
|
/** Amazon APS configuration */
|
|
42
42
|
amazonConfig?: AmazonConfig;
|
|
43
43
|
/** Placement-specific settings */
|
|
@@ -59,35 +59,16 @@ export interface AdSizeConfig {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* Prebid
|
|
62
|
+
* Configuration for a single Prebid bidder
|
|
63
|
+
*
|
|
64
|
+
* Contains the bidder name and its params, which get passed inline
|
|
65
|
+
* to the S2S endpoint in the bid request.
|
|
63
66
|
*/
|
|
64
|
-
export interface
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
/** Timeout for prebid requests in milliseconds */
|
|
70
|
-
timeout?: number;
|
|
71
|
-
/** Enable debug mode for prebid */
|
|
72
|
-
debug?: boolean;
|
|
73
|
-
/** Custom targeting parameters */
|
|
74
|
-
customTargeting?: Record<string, string>;
|
|
75
|
-
/** Price granularity */
|
|
76
|
-
priceGranularity?: 'low' | 'medium' | 'high' | 'auto' | 'dense' | 'custom';
|
|
77
|
-
/** Custom price granularity buckets */
|
|
78
|
-
customPriceGranularity?: PriceGranularityBucket[];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Price granularity bucket configuration
|
|
83
|
-
*/
|
|
84
|
-
export interface PriceGranularityBucket {
|
|
85
|
-
/** Minimum price */
|
|
86
|
-
min: number;
|
|
87
|
-
/** Maximum price */
|
|
88
|
-
max: number;
|
|
89
|
-
/** Increment */
|
|
90
|
-
increment: number;
|
|
67
|
+
export interface BidderConfig {
|
|
68
|
+
/** Bidder name (e.g., "appnexus", "rubicon") */
|
|
69
|
+
bidder: string;
|
|
70
|
+
/** Bidder-specific parameters */
|
|
71
|
+
params?: Record<string, any>;
|
|
91
72
|
}
|
|
92
73
|
|
|
93
74
|
/**
|
|
@@ -126,6 +107,20 @@ export interface GlobalSettings {
|
|
|
126
107
|
ccpaString?: string;
|
|
127
108
|
/** COPPA compliance */
|
|
128
109
|
coppaCompliant?: boolean;
|
|
110
|
+
/** Global refresh config (defaults for all banner placements) */
|
|
111
|
+
refresh?: RefreshConfig;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Refresh configuration for banner ads
|
|
116
|
+
*/
|
|
117
|
+
export interface RefreshConfig {
|
|
118
|
+
/** Whether refresh is enabled */
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
/** Refresh interval in milliseconds */
|
|
121
|
+
intervalMs: number;
|
|
122
|
+
/** Maximum number of refreshes */
|
|
123
|
+
maxRefreshes: number;
|
|
129
124
|
}
|
|
130
125
|
|
|
131
126
|
/**
|
package/src/types/index.ts
CHANGED
|
@@ -43,8 +43,6 @@ export interface CustomSize {
|
|
|
43
43
|
export interface InitializationOptions {
|
|
44
44
|
/** Your BigCrunch property ID */
|
|
45
45
|
propertyId: string;
|
|
46
|
-
/** Your API key for authentication */
|
|
47
|
-
apiKey: string;
|
|
48
46
|
/** Environment to use */
|
|
49
47
|
environment?: Environment;
|
|
50
48
|
/** Enable debug logging */
|