@bigcrunch/react-native-ads 0.3.1 → 0.5.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 +5 -5
- package/android/bigcrunch-ads/com/bigcrunch/ads/BigCrunchAds.kt +434 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/BigCrunchBannerView.kt +484 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/BigCrunchInterstitial.kt +403 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/BigCrunchRewarded.kt +409 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/adapters/GoogleAdsAdapter.kt +592 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/AdOrchestrator.kt +623 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/AnalyticsClient.kt +719 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/BidRequestClient.kt +364 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/ConfigManager.kt +301 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/DeviceContext.kt +385 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/RewardedCallback.kt +42 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/SessionManager.kt +330 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/internal/DeviceHelper.kt +60 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/internal/HttpClient.kt +114 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/internal/Logger.kt +71 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/internal/PrivacyStore.kt +125 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/internal/Storage.kt +88 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/listeners/BannerAdListener.kt +55 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/listeners/InterstitialAdListener.kt +55 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/listeners/RewardedAdListener.kt +58 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/AdEvent.kt +880 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/AppConfig.kt +90 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/DeviceData.kt +18 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/PlacementConfig.kt +70 -0
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/SessionInfo.kt +21 -0
- package/android/build.gradle +22 -10
- package/android/settings.gradle +2 -6
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchAdsModule.kt +0 -23
- package/ios/BigCrunchAds/Sources/Adapters/GoogleAdsAdapter.swift +512 -0
- package/ios/BigCrunchAds/Sources/BigCrunchAds.swift +387 -0
- package/ios/BigCrunchAds/Sources/BigCrunchBannerView.swift +448 -0
- package/ios/BigCrunchAds/Sources/BigCrunchInterstitial.swift +412 -0
- package/ios/BigCrunchAds/Sources/BigCrunchRewarded.swift +523 -0
- package/ios/BigCrunchAds/Sources/Core/AdOrchestrator.swift +514 -0
- package/ios/BigCrunchAds/Sources/Core/AnalyticsClient.swift +874 -0
- package/ios/BigCrunchAds/Sources/Core/BidRequestClient.swift +344 -0
- package/ios/BigCrunchAds/Sources/Core/ConfigManager.swift +306 -0
- package/ios/BigCrunchAds/Sources/Core/DeviceContext.swift +284 -0
- package/ios/BigCrunchAds/Sources/Core/SessionManager.swift +392 -0
- package/ios/BigCrunchAds/Sources/Internal/HTTPClient.swift +146 -0
- package/ios/BigCrunchAds/Sources/Internal/Logger.swift +62 -0
- package/ios/BigCrunchAds/Sources/Internal/PrivacyStore.swift +129 -0
- package/ios/BigCrunchAds/Sources/Internal/Storage.swift +73 -0
- package/ios/BigCrunchAds/Sources/Models/AdEvent.swift +784 -0
- package/ios/BigCrunchAds/Sources/Models/AppConfig.swift +100 -0
- package/ios/BigCrunchAds/Sources/Models/DeviceData.swift +68 -0
- package/ios/BigCrunchAds/Sources/Models/PlacementConfig.swift +137 -0
- package/ios/BigCrunchAds/Sources/Models/SessionInfo.swift +48 -0
- package/ios/BigCrunchAdsModule.swift +5 -14
- package/ios/BigCrunchBannerViewManager.swift +0 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/types/config.d.ts +22 -9
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/events.d.ts +4 -4
- package/lib/types/events.d.ts.map +1 -1
- package/package.json +11 -4
- package/react-native-bigcrunch-ads.podspec +1 -3
- package/scripts/inject-version.js +55 -0
- package/src/index.ts +3 -2
- package/src/types/config.ts +23 -9
- package/src/types/events.ts +4 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Injects the package.json version into native SDK DeviceContext files.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* node scripts/inject-version.js --prepack # Operates on copied files inside the package
|
|
8
|
+
* node scripts/inject-version.js --sync # Operates on canonical source files in the monorepo
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
const version = require('../package.json').version;
|
|
15
|
+
const mode = process.argv[2];
|
|
16
|
+
|
|
17
|
+
const TARGETS = {
|
|
18
|
+
'--prepack': [
|
|
19
|
+
'ios/BigCrunchAds/Sources/Core/DeviceContext.swift',
|
|
20
|
+
'android/bigcrunch-ads/com/bigcrunch/ads/core/DeviceContext.kt',
|
|
21
|
+
],
|
|
22
|
+
'--sync': [
|
|
23
|
+
'../ios/BigCrunchAds/Sources/Core/DeviceContext.swift',
|
|
24
|
+
'../android/bigcrunch-ads/src/main/java/com/bigcrunch/ads/core/DeviceContext.kt',
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const files = TARGETS[mode];
|
|
29
|
+
if (!files) {
|
|
30
|
+
console.error('Usage: inject-version.js --prepack | --sync');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const SDK_VERSION_RE = /(SDK_VERSION\s*=\s*)(["']).*?\2/;
|
|
35
|
+
|
|
36
|
+
files.forEach((rel) => {
|
|
37
|
+
const filePath = path.resolve(__dirname, '..', rel);
|
|
38
|
+
if (!fs.existsSync(filePath)) {
|
|
39
|
+
console.warn(`Skipping (not found): ${rel}`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
43
|
+
const match = content.match(SDK_VERSION_RE);
|
|
44
|
+
if (!match) {
|
|
45
|
+
console.warn(`No SDK_VERSION match in: ${rel}`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const updated = content.replace(SDK_VERSION_RE, `$1"${version}"`);
|
|
49
|
+
if (content === updated) {
|
|
50
|
+
console.log(`Already v${version} in ${rel}`);
|
|
51
|
+
} else {
|
|
52
|
+
fs.writeFileSync(filePath, updated);
|
|
53
|
+
console.log(`Injected v${version} into ${rel}`);
|
|
54
|
+
}
|
|
55
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -56,8 +56,9 @@ export type {
|
|
|
56
56
|
// Export error codes enum
|
|
57
57
|
export { AdErrorCode } from './types';
|
|
58
58
|
|
|
59
|
-
// Version
|
|
60
|
-
|
|
59
|
+
// Version - read from package.json
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
61
|
+
export const SDK_VERSION: string = require('../package.json').version;
|
|
61
62
|
|
|
62
63
|
/**
|
|
63
64
|
* Default export for convenience
|
package/src/types/config.ts
CHANGED
|
@@ -12,6 +12,10 @@ export interface AppConfig {
|
|
|
12
12
|
propertyId: string;
|
|
13
13
|
/** Property name */
|
|
14
14
|
propertyName: string;
|
|
15
|
+
/** S2S auction configuration */
|
|
16
|
+
s2s?: S2SConfig;
|
|
17
|
+
/** Top-level bidder configurations (bidderName → BidderEntry) */
|
|
18
|
+
bidders?: Record<string, BidderEntry>;
|
|
15
19
|
/** List of configured placements */
|
|
16
20
|
placements: PlacementConfig[];
|
|
17
21
|
/** Global settings */
|
|
@@ -36,8 +40,6 @@ export interface PlacementConfig {
|
|
|
36
40
|
gamAdUnit: string;
|
|
37
41
|
/** Ad size configuration */
|
|
38
42
|
size?: AdSizeConfig;
|
|
39
|
-
/** Prebid bidder configurations */
|
|
40
|
-
bidders?: BidderConfig[];
|
|
41
43
|
/** Amazon APS configuration */
|
|
42
44
|
amazonConfig?: AmazonConfig;
|
|
43
45
|
/** Placement-specific settings */
|
|
@@ -59,16 +61,28 @@ export interface AdSizeConfig {
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
/**
|
|
62
|
-
*
|
|
64
|
+
* S2S (server-to-server) configuration for bid requests
|
|
65
|
+
*/
|
|
66
|
+
export interface S2SConfig {
|
|
67
|
+
/** Whether S2S is enabled */
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
/** S2S auction server URL */
|
|
70
|
+
serverUrl: string;
|
|
71
|
+
/** Timeout for S2S requests in milliseconds */
|
|
72
|
+
timeoutMs: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Configuration for a single bidder at the app level
|
|
63
77
|
*
|
|
64
|
-
* Contains
|
|
65
|
-
* to
|
|
78
|
+
* Contains shared bidder params and a map of placement-specific params.
|
|
79
|
+
* Bidder-to-placement mapping is resolved from this structure.
|
|
66
80
|
*/
|
|
67
|
-
export interface
|
|
68
|
-
/**
|
|
69
|
-
bidder: string;
|
|
70
|
-
/** Bidder-specific parameters */
|
|
81
|
+
export interface BidderEntry {
|
|
82
|
+
/** Shared bidder-level parameters */
|
|
71
83
|
params?: Record<string, any>;
|
|
84
|
+
/** Per-placement params: placementId → imp-level params */
|
|
85
|
+
placements?: Record<string, Record<string, any>>;
|
|
72
86
|
}
|
|
73
87
|
|
|
74
88
|
/**
|
package/src/types/events.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface AdImpressionEvent extends BaseAdEvent {
|
|
|
49
49
|
gamAdUnit?: string;
|
|
50
50
|
/** Ad size (e.g., "320x50") */
|
|
51
51
|
adSize?: string;
|
|
52
|
-
/** Auction ID from
|
|
52
|
+
/** Auction ID from S2S bid request */
|
|
53
53
|
auctionId?: string;
|
|
54
54
|
/** Winning bidder name */
|
|
55
55
|
bidder?: string;
|
|
@@ -65,7 +65,7 @@ export interface AdImpressionEvent extends BaseAdEvent {
|
|
|
65
65
|
creativeId?: string;
|
|
66
66
|
/** Refresh count for this placement */
|
|
67
67
|
refreshCount?: number;
|
|
68
|
-
/** Demand channel (e.g., "
|
|
68
|
+
/** Demand channel (e.g., "S2S Header", "GAM Direct") */
|
|
69
69
|
demandChannel?: string;
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -246,7 +246,7 @@ export interface ImpressionEvent extends WebSchemaCommonFields {
|
|
|
246
246
|
gamAdUnit: string;
|
|
247
247
|
/** Ad format (banner, interstitial, rewarded) */
|
|
248
248
|
format: string;
|
|
249
|
-
/** Auction ID from
|
|
249
|
+
/** Auction ID from S2S bid request */
|
|
250
250
|
auctionId?: string;
|
|
251
251
|
/** Refresh count for this placement */
|
|
252
252
|
refreshCount?: number;
|
|
@@ -274,7 +274,7 @@ export interface ImpressionEvent extends WebSchemaCommonFields {
|
|
|
274
274
|
amznPrice?: string;
|
|
275
275
|
/** Demand type (banner, video, etc.) */
|
|
276
276
|
demandType?: string;
|
|
277
|
-
/** Demand channel (e.g., "
|
|
277
|
+
/** Demand channel (e.g., "S2S Header", "GAM Direct") */
|
|
278
278
|
demandChannel?: string;
|
|
279
279
|
}
|
|
280
280
|
|