@bigcrunch/react-native-ads 0.1.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 +417 -0
- package/android/build.gradle +70 -0
- package/android/settings.gradle +6 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchAdsModule.kt +653 -0
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchAdsPackage.kt +20 -0
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchBannerViewManager.kt +296 -0
- package/ios/BigCrunchAdsModule.swift +588 -0
- package/ios/BigCrunchBannerViewManager.swift +270 -0
- package/ios/react-native-bigcrunch-ads-Bridging-Header.h +8 -0
- package/lib/BigCrunchAds.d.ts +168 -0
- package/lib/BigCrunchAds.d.ts.map +1 -0
- package/lib/BigCrunchAds.js +241 -0
- package/lib/BigCrunchBannerView.d.ts +21 -0
- package/lib/BigCrunchBannerView.d.ts.map +1 -0
- package/lib/BigCrunchBannerView.js +176 -0
- package/lib/BigCrunchInterstitial.d.ts +66 -0
- package/lib/BigCrunchInterstitial.d.ts.map +1 -0
- package/lib/BigCrunchInterstitial.js +222 -0
- package/lib/BigCrunchRewarded.d.ts +85 -0
- package/lib/BigCrunchRewarded.d.ts.map +1 -0
- package/lib/BigCrunchRewarded.js +257 -0
- package/lib/NativeBigCrunchAds.d.ts +71 -0
- package/lib/NativeBigCrunchAds.d.ts.map +1 -0
- package/lib/NativeBigCrunchAds.js +54 -0
- package/lib/index.d.ts +28 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +32 -0
- package/lib/types/ads.d.ts +101 -0
- package/lib/types/ads.d.ts.map +1 -0
- package/lib/types/ads.js +4 -0
- package/lib/types/config.d.ts +137 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +4 -0
- package/lib/types/events.d.ts +306 -0
- package/lib/types/events.d.ts.map +1 -0
- package/lib/types/events.js +4 -0
- package/lib/types/index.d.ts +175 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +23 -0
- package/package.json +88 -0
- package/react-native-bigcrunch-ads.podspec +27 -0
- package/src/BigCrunchAds.ts +298 -0
- package/src/BigCrunchBannerView.tsx +262 -0
- package/src/BigCrunchInterstitial.ts +266 -0
- package/src/BigCrunchRewarded.ts +307 -0
- package/src/NativeBigCrunchAds.ts +120 -0
- package/src/index.ts +71 -0
- package/src/types/ads.ts +112 -0
- package/src/types/config.ts +145 -0
- package/src/types/events.ts +337 -0
- package/src/types/index.ts +193 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BigCrunch Mobile Ads SDK for React Native
|
|
3
|
+
* Type definitions
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export * from './config';
|
|
7
|
+
export * from './events';
|
|
8
|
+
export * from './ads';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* SDK Environment options
|
|
12
|
+
*/
|
|
13
|
+
export type Environment = 'production' | 'sandbox';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Ad formats supported by the SDK
|
|
17
|
+
*/
|
|
18
|
+
export type AdFormat = 'banner' | 'interstitial' | 'rewarded';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Banner ad sizes
|
|
22
|
+
*/
|
|
23
|
+
export type BannerSize =
|
|
24
|
+
| 'BANNER' // 320x50
|
|
25
|
+
| 'LARGE_BANNER' // 320x100
|
|
26
|
+
| 'MEDIUM_RECTANGLE' // 300x250
|
|
27
|
+
| 'FULL_BANNER' // 468x60
|
|
28
|
+
| 'LEADERBOARD' // 728x90
|
|
29
|
+
| 'ADAPTIVE' // Adaptive banner
|
|
30
|
+
| 'SMART'; // Smart banner (deprecated, use ADAPTIVE)
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Custom ad size
|
|
34
|
+
*/
|
|
35
|
+
export interface CustomSize {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* SDK initialization options
|
|
42
|
+
*/
|
|
43
|
+
export interface InitializationOptions {
|
|
44
|
+
/** Your BigCrunch property ID */
|
|
45
|
+
propertyId: string;
|
|
46
|
+
/** Your API key for authentication */
|
|
47
|
+
apiKey: string;
|
|
48
|
+
/** Environment to use */
|
|
49
|
+
environment?: Environment;
|
|
50
|
+
/** Enable debug logging */
|
|
51
|
+
debug?: boolean;
|
|
52
|
+
/** Use mock configuration for testing (no backend required) */
|
|
53
|
+
useMockConfig?: boolean;
|
|
54
|
+
/** Custom backend URL (optional) */
|
|
55
|
+
customBackendUrl?: string;
|
|
56
|
+
/** Session timeout in seconds (default: 1800) */
|
|
57
|
+
sessionTimeout?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Ad request options
|
|
62
|
+
*/
|
|
63
|
+
export interface AdRequestOptions {
|
|
64
|
+
/** Placement ID from BigCrunch dashboard */
|
|
65
|
+
placementId: string;
|
|
66
|
+
/** Custom targeting parameters */
|
|
67
|
+
customTargeting?: Record<string, string>;
|
|
68
|
+
/** Content URL for contextual targeting */
|
|
69
|
+
contentUrl?: string;
|
|
70
|
+
/** Publisher provided ID */
|
|
71
|
+
publisherProvidedId?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Error codes for ad loading failures
|
|
76
|
+
*/
|
|
77
|
+
export enum AdErrorCode {
|
|
78
|
+
UNKNOWN = 'UNKNOWN',
|
|
79
|
+
NETWORK_ERROR = 'NETWORK_ERROR',
|
|
80
|
+
NO_FILL = 'NO_FILL',
|
|
81
|
+
INVALID_REQUEST = 'INVALID_REQUEST',
|
|
82
|
+
INTERNAL_ERROR = 'INTERNAL_ERROR',
|
|
83
|
+
INVALID_PLACEMENT = 'INVALID_PLACEMENT',
|
|
84
|
+
NOT_INITIALIZED = 'NOT_INITIALIZED',
|
|
85
|
+
ALREADY_LOADED = 'ALREADY_LOADED',
|
|
86
|
+
NOT_LOADED = 'NOT_LOADED',
|
|
87
|
+
TIMEOUT = 'TIMEOUT'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Ad error object
|
|
92
|
+
*/
|
|
93
|
+
export interface AdError {
|
|
94
|
+
code: AdErrorCode;
|
|
95
|
+
message: string;
|
|
96
|
+
underlyingError?: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Ad revenue data from Impression-Level Revenue Data (ILRD)
|
|
101
|
+
*/
|
|
102
|
+
export interface AdRevenue {
|
|
103
|
+
/** Revenue value in micros (millionths of currency unit) */
|
|
104
|
+
valueMicros: number;
|
|
105
|
+
/** Currency code (e.g., 'USD') */
|
|
106
|
+
currencyCode: string;
|
|
107
|
+
/** Ad unit that generated the revenue */
|
|
108
|
+
adUnitId?: string;
|
|
109
|
+
/** Precision of the revenue value */
|
|
110
|
+
precision?: 'ESTIMATED' | 'PUBLISHER_PROVIDED' | 'PRECISE' | 'UNKNOWN';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Session information
|
|
115
|
+
*/
|
|
116
|
+
export interface SessionInfo {
|
|
117
|
+
/** Unique session ID (UUID) */
|
|
118
|
+
sessionId: string;
|
|
119
|
+
/** Persistent user ID (UUID, stored across app launches) */
|
|
120
|
+
userId: string;
|
|
121
|
+
/** Session start timestamp in ISO 8601 format (e.g., "2025-01-15T10:30:00Z") */
|
|
122
|
+
sessionStartTime: string;
|
|
123
|
+
/** Total number of sessions for this user (across all time) */
|
|
124
|
+
totalSessionCount: number;
|
|
125
|
+
/** True if this is the user's first session */
|
|
126
|
+
isNewUser: boolean;
|
|
127
|
+
/** Number of screens/page views in current session */
|
|
128
|
+
sessionDepth: number;
|
|
129
|
+
/** Number of screens viewed in session (deprecated, use sessionDepth) */
|
|
130
|
+
screenViewCount: number;
|
|
131
|
+
/** Number of ads requested in session */
|
|
132
|
+
adRequestCount: number;
|
|
133
|
+
/** Number of ads shown in session */
|
|
134
|
+
adImpressionCount: number;
|
|
135
|
+
/** Total revenue in session (micros) */
|
|
136
|
+
totalRevenueMicros: number;
|
|
137
|
+
/** Current page/screen ID (UUID, new per page view) */
|
|
138
|
+
currentPageId?: string;
|
|
139
|
+
/** UTM source parameter (e.g., "google", "facebook") */
|
|
140
|
+
utmSource?: string;
|
|
141
|
+
/** UTM medium parameter (e.g., "cpc", "email") */
|
|
142
|
+
utmMedium?: string;
|
|
143
|
+
/** UTM campaign parameter (e.g., "summer_sale") */
|
|
144
|
+
utmCampaign?: string;
|
|
145
|
+
/** UTM term parameter (optional keyword) */
|
|
146
|
+
utmTerm?: string;
|
|
147
|
+
/** UTM content parameter (optional content variant) */
|
|
148
|
+
utmContent?: string;
|
|
149
|
+
/** Session attribution source (derived from UTM or defaults to "direct") */
|
|
150
|
+
sessionSource: string;
|
|
151
|
+
/** Session attribution medium (derived from UTM or defaults to "none") */
|
|
152
|
+
sessionMedium: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Device context information
|
|
157
|
+
*/
|
|
158
|
+
export interface DeviceContext {
|
|
159
|
+
/** Device ID (IDFA/AAID when available) */
|
|
160
|
+
deviceId?: string;
|
|
161
|
+
/** Operating system */
|
|
162
|
+
os: 'iOS' | 'Android';
|
|
163
|
+
/** OS version */
|
|
164
|
+
osVersion: string;
|
|
165
|
+
/** Device model */
|
|
166
|
+
deviceModel: string;
|
|
167
|
+
/** Device manufacturer */
|
|
168
|
+
deviceManufacturer?: string;
|
|
169
|
+
/** Screen width in pixels */
|
|
170
|
+
screenWidth: number;
|
|
171
|
+
/** Screen height in pixels */
|
|
172
|
+
screenHeight: number;
|
|
173
|
+
/** Screen density */
|
|
174
|
+
screenDensity?: number;
|
|
175
|
+
/** App version */
|
|
176
|
+
appVersion: string;
|
|
177
|
+
/** SDK version */
|
|
178
|
+
sdkVersion: string;
|
|
179
|
+
/** Network connection type */
|
|
180
|
+
connectionType?: 'wifi' | 'cellular' | 'ethernet' | 'unknown';
|
|
181
|
+
/** User's locale */
|
|
182
|
+
locale?: string;
|
|
183
|
+
/** User's timezone */
|
|
184
|
+
timezone?: string;
|
|
185
|
+
/** Country code (ISO 3166-1 alpha-2, e.g., "US", "GB") */
|
|
186
|
+
country?: string;
|
|
187
|
+
/** Region/state code */
|
|
188
|
+
region?: string;
|
|
189
|
+
/** Browser/SDK identifier for web schema (e.g., "BigCrunch iOS SDK 1.0.0") */
|
|
190
|
+
browser?: string;
|
|
191
|
+
/** Device type for web schema (e.g., "iPhone 14", "Samsung Galaxy S21") */
|
|
192
|
+
device?: string;
|
|
193
|
+
}
|