@bigcrunch/react-native-ads 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +272 -278
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,12 +4,20 @@ Simplified in-app advertising for React Native apps with Prebid and Google Ad Ma
4
4
 
5
5
  ## Features
6
6
 
7
- - 🎯 **Simple Integration**: One SDK to handle Prebid, Google Ad Manager, and Amazon demand
8
- - 📊 **Built-in Analytics**: Automatic tracking of impressions, clicks, and revenue
9
- - 💰 **Revenue Optimization**: Server-side header bidding via Prebid Server
10
- - 🔧 **Configuration-Driven**: Manage placements from BigCrunch dashboard
11
- - 📱 **Cross-Platform**: Supports both iOS and Android
12
- - 🎨 **Ad Formats**: Banner, Interstitial, and Rewarded ads
7
+ - **Simple Integration**: One SDK to handle Prebid, Google Ad Manager, and Amazon demand
8
+ - **Built-in Analytics**: Automatic tracking of screen views, impressions, clicks, and revenue
9
+ - **Revenue Optimization**: Server-side header bidding via Prebid Server
10
+ - **Configuration-Driven**: Manage placements and ad sizes from the BigCrunch dashboard
11
+ - **Cross-Platform**: Supports both iOS and Android
12
+ - **Ad Formats**: Banner, Interstitial, and Rewarded ads
13
+
14
+ ## Requirements
15
+
16
+ - React Native 0.60+
17
+ - iOS 13.0+
18
+ - Android API 21+
19
+ - **Bare React Native** project (not Expo managed workflow)
20
+ - If using Expo, you must first run `expo prebuild` to generate native directories
13
21
 
14
22
  ## Installation
15
23
 
@@ -22,248 +30,318 @@ yarn add @bigcrunch/react-native-ads
22
30
  ### iOS Setup
23
31
 
24
32
  ```bash
25
- cd ios && pod install
33
+ cd ios && pod install && cd ..
26
34
  ```
27
35
 
28
36
  Add the following to your `Info.plist`:
29
37
 
30
38
  ```xml
31
39
  <key>GADApplicationIdentifier</key>
32
- <string>YOUR_ADMOB_APP_ID</string>
33
-
34
- <key>SKAdNetworkItems</key>
35
- <array>
36
- <!-- Add SKAdNetwork identifiers -->
37
- </array>
40
+ <string>YOUR_GAM_APP_ID</string>
38
41
  ```
39
42
 
43
+ > For testing, you can use the Google test ID: `ca-app-pub-3940256099942544~1458002511`
44
+
40
45
  ### Android Setup
41
46
 
42
- Add the following to your `AndroidManifest.xml`:
47
+ Add the following inside the `<application>` tag in your `AndroidManifest.xml`:
43
48
 
44
49
  ```xml
45
50
  <meta-data
46
51
  android:name="com.google.android.gms.ads.APPLICATION_ID"
47
- android:value="YOUR_ADMOB_APP_ID"/>
52
+ android:value="YOUR_GAM_APP_ID"/>
48
53
  ```
49
54
 
55
+ > For testing, you can use: `ca-app-pub-3940256099942544~3347511713`
56
+
50
57
  ## Quick Start
51
58
 
52
59
  ### 1. Initialize the SDK
53
60
 
54
61
  ```typescript
62
+ import { useEffect } from 'react';
55
63
  import { BigCrunchAds } from '@bigcrunch/react-native-ads';
56
64
 
57
- // Initialize at app startup (e.g., in App.tsx)
58
- async function initializeAds() {
59
- try {
60
- await BigCrunchAds.initialize(
61
- 'your-property-id',
62
- 'production' // or 'sandbox'
63
- );
64
- console.log('BigCrunch Ads initialized successfully');
65
- } catch (error) {
66
- console.error('Failed to initialize BigCrunch Ads:', error);
67
- }
68
- }
65
+ const PROPERTY_ID = 'YOUR_PROPERTY_ID';
66
+
67
+ function App() {
68
+ useEffect(() => {
69
+ initializeBigCrunch();
70
+ }, []);
69
71
 
70
- // Call on app launch
71
- initializeAds();
72
+ const initializeBigCrunch = async () => {
73
+ try {
74
+ await BigCrunchAds.initialize(PROPERTY_ID, 'production');
75
+ console.log('BigCrunch SDK initialized');
76
+ } catch (error) {
77
+ console.error('BigCrunch initialization failed:', error);
78
+ }
79
+ };
80
+
81
+ return (
82
+ // Your app content
83
+ );
84
+ }
72
85
  ```
73
86
 
87
+ | Parameter | Description |
88
+ |-----------|-------------|
89
+ | `PROPERTY_ID` | Unique identifier for your app, provided by BigCrunch |
90
+ | `environment` | `'production'` for live apps, `'sandbox'` for testing |
91
+
74
92
  ### 2. Track Screen Views
75
93
 
76
94
  ```typescript
95
+ import { useEffect } from 'react';
77
96
  import { BigCrunchAds } from '@bigcrunch/react-native-ads';
78
97
 
79
- // Track screen views for analytics
80
- BigCrunchAds.trackScreenView('HomeScreen');
98
+ function HomeScreen() {
99
+ useEffect(() => {
100
+ BigCrunchAds.trackScreenView('HomeScreen');
101
+ }, []);
102
+
103
+ return (
104
+ // Screen content
105
+ );
106
+ }
81
107
  ```
82
108
 
109
+ > For automatic tracking with React Navigation, see the [Tracking-Only Integration Guide](./docs/TRACKING_ONLY_INTEGRATION.md#option-b-automatic-tracking-with-react-navigation-recommended).
110
+
83
111
  ## Ad Formats
84
112
 
85
113
  ### Banner Ads
86
114
 
115
+ Ad sizes are configured per placement in the BigCrunch dashboard. You only need to pass the `placementId` — the SDK handles the rest.
116
+
87
117
  ```tsx
88
118
  import { BigCrunchBannerView } from '@bigcrunch/react-native-ads';
89
119
 
90
- function HomeScreen() {
120
+ function ArticleScreen() {
91
121
  return (
92
- <View>
93
- {/* Your content */}
122
+ <View style={{ flex: 1 }}>
123
+ <Text>Article content...</Text>
94
124
 
95
125
  <BigCrunchBannerView
96
- placementId="banner-home"
97
- size="BANNER" // or "MEDIUM_RECTANGLE", "ADAPTIVE", etc.
98
- style={{ alignSelf: 'center' }}
126
+ placementId="your-banner-placement"
99
127
  onAdLoaded={() => console.log('Banner loaded')}
100
- onAdFailedToLoad={(error) => console.error('Banner failed:', error)}
101
- onAdRevenue={(revenue) => console.log('Revenue:', revenue)}
128
+ onAdFailedToLoad={(error) => console.error('Banner failed:', error.message)}
102
129
  />
103
130
  </View>
104
131
  );
105
132
  }
106
133
  ```
107
134
 
135
+ #### Props
136
+
137
+ | Prop | Type | Default | Description |
138
+ |------|------|---------|-------------|
139
+ | `placementId` | `string` | *required* | Placement ID from the BigCrunch dashboard |
140
+ | `size` | `BannerSize \| { width, height }` | *from config* | Optional size override. If omitted, uses the size from placement config. |
141
+ | `autoLoad` | `boolean` | `true` | Automatically load ad on mount |
142
+ | `refreshInterval` | `number` | `0` | Auto-refresh interval in seconds (0 = disabled) |
143
+ | `customTargeting` | `Record<string, string>` | — | Custom key-value targeting |
144
+ | `style` | `ViewStyle` | — | Container style |
145
+
146
+ #### Callbacks
147
+
148
+ | Callback | Description |
149
+ |----------|-------------|
150
+ | `onAdLoaded` | Ad loaded successfully |
151
+ | `onAdFailedToLoad` | Ad failed to load. Receives `AdError` with `code` and `message`. |
152
+ | `onAdImpression` | Ad impression recorded |
153
+ | `onAdClicked` | User tapped the ad |
154
+ | `onAdOpened` | Ad opened an overlay |
155
+ | `onAdClosed` | Ad overlay closed |
156
+ | `onAdRevenue` | Revenue event received (ILRD). Receives `AdRevenue` with `valueMicros` and `currencyCode`. |
157
+
108
158
  #### Available Banner Sizes
109
159
 
110
- - `BANNER` - 320x50
111
- - `LARGE_BANNER` - 320x100
112
- - `MEDIUM_RECTANGLE` - 300x250
113
- - `FULL_BANNER` - 468x60
114
- - `LEADERBOARD` - 728x90
115
- - `ADAPTIVE` - Full-width adaptive banner (recommended). Google calculates the optimal height for the device screen width.
116
- - `SMART` - Deprecated, alias for `ADAPTIVE`
117
- - Custom size: `{ width: 300, height: 250 }`
160
+ | Size | Dimensions | Description |
161
+ |------|-----------|-------------|
162
+ | `'BANNER'` | 320x50 | Standard banner |
163
+ | `'LARGE_BANNER'` | 320x100 | Large banner |
164
+ | `'MEDIUM_RECTANGLE'` | 300x250 | Medium rectangle (MREC) |
165
+ | `'FULL_BANNER'` | 468x60 | Full-size banner |
166
+ | `'LEADERBOARD'` | 728x90 | Leaderboard (tablets) |
167
+ | `'ADAPTIVE'` | Full width, auto height | Adaptive banner (recommended) |
118
168
 
119
169
  ### Interstitial Ads
120
170
 
171
+ Full-screen ads shown at natural transition points. Preload ahead of time, then show when ready.
172
+
121
173
  ```typescript
174
+ import { useEffect, useRef } from 'react';
122
175
  import { BigCrunchInterstitial } from '@bigcrunch/react-native-ads';
176
+ import type { EventSubscription } from '@bigcrunch/react-native-ads';
177
+
178
+ const PLACEMENT_ID = 'interstitial-level-complete';
179
+
180
+ function GameScreen() {
181
+ const subscriptions = useRef<EventSubscription[]>([]);
182
+
183
+ useEffect(() => {
184
+ // Preload on mount
185
+ BigCrunchInterstitial.load({ placementId: PLACEMENT_ID });
186
+
187
+ // Set up listeners
188
+ subscriptions.current.push(
189
+ BigCrunchInterstitial.addEventListener(PLACEMENT_ID, 'adClosed', () => {
190
+ // Preload the next interstitial
191
+ BigCrunchInterstitial.load({ placementId: PLACEMENT_ID });
192
+ }),
193
+ BigCrunchInterstitial.addEventListener(PLACEMENT_ID, 'adFailedToLoad', (event) => {
194
+ console.error('Interstitial failed:', event.error.message);
195
+ })
196
+ );
123
197
 
124
- // Load an interstitial
125
- async function loadInterstitial() {
126
- try {
127
- await BigCrunchInterstitial.load({
128
- placementId: 'interstitial-level-complete'
129
- });
130
- console.log('Interstitial loaded');
131
- } catch (error) {
132
- console.error('Failed to load interstitial:', error);
133
- }
134
- }
198
+ return () => {
199
+ subscriptions.current.forEach((sub) => sub.remove());
200
+ BigCrunchInterstitial.destroy(PLACEMENT_ID);
201
+ };
202
+ }, []);
135
203
 
136
- // Show the interstitial
137
- async function showInterstitial() {
138
- const isLoaded = await BigCrunchInterstitial.isLoaded('interstitial-level-complete');
204
+ const handleLevelComplete = async () => {
205
+ if (await BigCrunchInterstitial.isLoaded(PLACEMENT_ID)) {
206
+ await BigCrunchInterstitial.show(PLACEMENT_ID);
207
+ }
208
+ };
139
209
 
140
- if (isLoaded) {
141
- await BigCrunchInterstitial.show('interstitial-level-complete');
142
- }
210
+ return (
211
+ <Button title="Complete Level" onPress={handleLevelComplete} />
212
+ );
143
213
  }
144
-
145
- // Listen for events
146
- BigCrunchInterstitial.addEventListener(
147
- 'interstitial-level-complete',
148
- 'adClosed',
149
- () => {
150
- console.log('Interstitial closed');
151
- // Load next ad or continue game
152
- }
153
- );
154
214
  ```
155
215
 
216
+ #### Methods
217
+
218
+ | Method | Description |
219
+ |--------|-------------|
220
+ | `load(options)` | Load an interstitial ad |
221
+ | `show(placementId)` | Show a loaded interstitial |
222
+ | `isLoaded(placementId)` | Check if an ad is loaded |
223
+ | `destroy(placementId)` | Destroy an interstitial instance |
224
+ | `addEventListener(placementId, event, listener)` | Add an event listener |
225
+
226
+ #### Events
227
+
228
+ | Event | Description |
229
+ |-------|-------------|
230
+ | `'adLoaded'` | Ad loaded and ready to show |
231
+ | `'adFailedToLoad'` | Loading failed |
232
+ | `'adImpression'` | Impression recorded |
233
+ | `'adClicked'` | User tapped the ad |
234
+ | `'adOpened'` | Full-screen ad presented |
235
+ | `'adClosed'` | User dismissed the ad |
236
+ | `'adRevenue'` | Revenue event (ILRD) |
237
+
156
238
  ### Rewarded Ads
157
239
 
240
+ Full-screen ads that offer the user an in-app reward in exchange for watching. The API is identical to interstitials, with the addition of the `rewardEarned` event.
241
+
158
242
  ```typescript
243
+ import { useEffect, useRef, useState } from 'react';
244
+ import { Button, Alert } from 'react-native';
159
245
  import { BigCrunchRewarded } from '@bigcrunch/react-native-ads';
246
+ import type { EventSubscription } from '@bigcrunch/react-native-ads';
247
+
248
+ const PLACEMENT_ID = 'rewarded-extra-life';
249
+
250
+ function GameOverScreen() {
251
+ const [adReady, setAdReady] = useState(false);
252
+ const subscriptions = useRef<EventSubscription[]>([]);
253
+
254
+ useEffect(() => {
255
+ BigCrunchRewarded.load({ placementId: PLACEMENT_ID });
256
+
257
+ subscriptions.current.push(
258
+ BigCrunchRewarded.addEventListener(PLACEMENT_ID, 'adLoaded', () => {
259
+ setAdReady(true);
260
+ }),
261
+ BigCrunchRewarded.addEventListener(PLACEMENT_ID, 'adClosed', () => {
262
+ setAdReady(false);
263
+ BigCrunchRewarded.load({ placementId: PLACEMENT_ID });
264
+ }),
265
+ BigCrunchRewarded.addEventListener(PLACEMENT_ID, 'rewardEarned', (event) => {
266
+ Alert.alert('Reward!', `You earned ${event.rewardAmount} ${event.rewardType}`);
267
+ })
268
+ );
160
269
 
161
- // Load a rewarded ad
162
- async function loadRewardedAd() {
163
- try {
164
- await BigCrunchRewarded.load({
165
- placementId: 'rewarded-extra-life'
166
- });
167
- console.log('Rewarded ad loaded');
168
- } catch (error) {
169
- console.error('Failed to load rewarded ad:', error);
170
- }
171
- }
270
+ return () => {
271
+ subscriptions.current.forEach((sub) => sub.remove());
272
+ BigCrunchRewarded.destroy(PLACEMENT_ID);
273
+ };
274
+ }, []);
275
+
276
+ const handleWatchAd = async () => {
277
+ if (await BigCrunchRewarded.isLoaded(PLACEMENT_ID)) {
278
+ await BigCrunchRewarded.show(PLACEMENT_ID);
279
+ }
280
+ };
172
281
 
173
- // Set up reward listener
174
- BigCrunchRewarded.addEventListener(
175
- 'rewarded-extra-life',
176
- 'rewardEarned',
177
- (event) => {
178
- console.log(`User earned ${event.rewardAmount} ${event.rewardType}`);
179
- // Grant reward to user
180
- }
181
- );
182
-
183
- // Show the rewarded ad
184
- async function showRewardedAd() {
185
- const isLoaded = await BigCrunchRewarded.isLoaded('rewarded-extra-life');
186
-
187
- if (isLoaded) {
188
- await BigCrunchRewarded.show('rewarded-extra-life');
189
- } else {
190
- console.log('Rewarded ad not ready');
191
- }
282
+ return (
283
+ <Button title="Watch Ad for Extra Life" onPress={handleWatchAd} disabled={!adReady} />
284
+ );
192
285
  }
193
286
  ```
194
287
 
195
- ## Advanced Features
288
+ #### Additional Events
196
289
 
197
- ### Custom Targeting
290
+ All interstitial events plus:
198
291
 
199
- ```typescript
200
- // Banner with custom targeting
201
- <BigCrunchBannerView
202
- placementId="banner-home"
203
- customTargeting={{
204
- 'user_level': '5',
205
- 'game_mode': 'survival'
206
- }}
207
- />
208
-
209
- // Interstitial with custom targeting
210
- await BigCrunchInterstitial.load({
211
- placementId: 'interstitial-level-complete',
212
- customTargeting: {
213
- 'level': '10',
214
- 'score': 'high'
215
- }
216
- });
217
- ```
292
+ | Event | Description |
293
+ |-------|-------------|
294
+ | `'rewardEarned'` | User completed the ad and earned a reward. Includes `rewardType` (string) and `rewardAmount` (number). |
218
295
 
219
- ### Privacy Settings
296
+ ## Privacy & Compliance
220
297
 
221
298
  ```typescript
222
- // GDPR Consent
223
- await BigCrunchAds.setGdprConsent('consent_string_here');
299
+ // GDPR — pass IAB TCF consent string
300
+ await BigCrunchAds.setGdprConsent('consent-string-here');
224
301
 
225
- // CCPA Compliance
302
+ // CCPA — pass IAB US Privacy string
226
303
  await BigCrunchAds.setCcpaString('1YNN');
227
304
 
228
- // COPPA Compliance
305
+ // COPPA — for apps directed at children
229
306
  await BigCrunchAds.setCoppaCompliant(true);
230
307
  ```
231
308
 
232
- ### Debug Mode & Test Devices
309
+ ## Verifying Your Integration
233
310
 
234
311
  ```typescript
235
- // Enable debug mode
312
+ // Check if SDK is initialized
313
+ const isReady = await BigCrunchAds.isInitialized();
314
+ console.log('SDK initialized:', isReady);
315
+
316
+ // Get session information
317
+ const session = await BigCrunchAds.getSessionInfo();
318
+ console.log('Session ID:', session.sessionId);
319
+ console.log('Screen views:', session.screenViewCount);
320
+
321
+ // Enable debug logging during development
236
322
  await BigCrunchAds.setDebugMode(true);
237
323
 
238
- // Add test devices
324
+ // Register test devices to receive test ads
239
325
  await BigCrunchAds.addTestDevice('YOUR_DEVICE_ID');
240
326
  ```
241
327
 
242
- ### Event Listeners
328
+ > **Finding your device ID:** Run your app with debug mode enabled, load an ad, and check the console output. The Google Mobile Ads SDK will log your device ID.
243
329
 
244
- ```typescript
245
- // Global configuration events
246
- BigCrunchAds.onConfigUpdated((config) => {
247
- console.log('Config updated:', config);
248
- });
249
-
250
- // Session events
251
- BigCrunchAds.onSessionStarted((session) => {
252
- console.log('New session started:', session.sessionId);
253
- });
254
-
255
- // Ad-specific events
256
- const subscription = BigCrunchInterstitial.addEventListener(
257
- 'interstitial-main',
258
- 'adRevenue',
259
- (event) => {
260
- console.log('Revenue received:', event.revenue);
261
- }
262
- );
263
-
264
- // Remove listener when done
265
- subscription.remove();
266
- ```
330
+ ## Error Codes
331
+
332
+ When an ad fails to load, the `AdError` object contains a `code` and `message`:
333
+
334
+ | Code | Description |
335
+ |------|-------------|
336
+ | `NETWORK_ERROR` | No network connectivity |
337
+ | `NO_FILL` | No ad available for this request |
338
+ | `INVALID_REQUEST` | Malformed ad request |
339
+ | `INTERNAL_ERROR` | Internal SDK error |
340
+ | `INVALID_PLACEMENT` | Placement ID not found in config |
341
+ | `NOT_INITIALIZED` | SDK not yet initialized |
342
+ | `ALREADY_LOADED` | An ad is already loaded for this placement |
343
+ | `NOT_LOADED` | Attempted to show an ad that isn't loaded |
344
+ | `TIMEOUT` | Ad request timed out |
267
345
 
268
346
  ## TypeScript Support
269
347
 
@@ -274,137 +352,53 @@ import type {
274
352
  AdError,
275
353
  AdRevenue,
276
354
  BannerSize,
355
+ CustomSize,
277
356
  PlacementConfig,
278
- SessionInfo
357
+ AppConfig,
358
+ SessionInfo,
359
+ EventSubscription,
360
+ AdErrorCode,
279
361
  } from '@bigcrunch/react-native-ads';
280
362
  ```
281
363
 
282
- ## API Reference
283
-
284
- ### BigCrunchAds
285
-
286
- | Method | Description |
287
- |--------|-------------|
288
- | `initialize(propertyId, environment)` | Initialize the SDK |
289
- | `trackScreenView(screenName)` | Track a screen view |
290
- | `getAppConfig()` | Get current app configuration |
291
- | `getSessionInfo()` | Get current session information |
292
- | `setGdprConsent(consent)` | Set GDPR consent string |
293
- | `setCcpaString(ccpaString)` | Set CCPA compliance string |
294
- | `setCoppaCompliant(isCompliant)` | Set COPPA compliance |
295
- | `setDebugMode(enabled)` | Enable/disable debug mode |
296
-
297
- ### BigCrunchBannerView Props
298
-
299
- | Prop | Type | Description |
300
- |------|------|-------------|
301
- | `placementId` | string | Required. Placement ID from dashboard |
302
- | `size` | BannerSize \| CustomSize | Banner size (default: BANNER) |
303
- | `autoLoad` | boolean | Auto-load ad on mount (default: true) |
304
- | `refreshInterval` | number | Auto-refresh interval in seconds |
305
- | `customTargeting` | object | Custom targeting parameters |
306
- | `onAdLoaded` | function | Called when ad loads |
307
- | `onAdFailedToLoad` | function | Called on load failure |
308
- | `onAdImpression` | function | Called on impression |
309
- | `onAdClicked` | function | Called on click |
310
- | `onAdRevenue` | function | Called on revenue (ILRD) |
311
-
312
- ### BigCrunchInterstitial
313
-
314
- | Method | Description |
315
- |--------|-------------|
316
- | `load(options)` | Load an interstitial ad |
317
- | `show(placementId)` | Show a loaded interstitial |
318
- | `isLoaded(placementId)` | Check if ad is loaded |
319
- | `destroy(placementId)` | Destroy an interstitial instance |
320
- | `addEventListener(placementId, event, listener)` | Add event listener |
321
-
322
- ### BigCrunchRewarded
323
-
324
- | Method | Description |
325
- |--------|-------------|
326
- | `load(options)` | Load a rewarded ad |
327
- | `show(placementId)` | Show a loaded rewarded ad |
328
- | `isLoaded(placementId)` | Check if ad is loaded |
329
- | `destroy(placementId)` | Destroy a rewarded instance |
330
- | `addEventListener(placementId, event, listener)` | Add event listener |
331
- | `onRewardEarned(placementId, listener)` | Listen for rewards |
332
-
333
- ## Error Handling
334
-
335
- ```typescript
336
- import { AdErrorCode } from '@bigcrunch/react-native-ads';
337
-
338
- // Handle banner errors
339
- <BigCrunchBannerView
340
- placementId="banner-home"
341
- onAdFailedToLoad={(error) => {
342
- switch (error.code) {
343
- case AdErrorCode.NO_FILL:
344
- console.log('No ads available');
345
- break;
346
- case AdErrorCode.NETWORK_ERROR:
347
- console.log('Network error');
348
- break;
349
- case AdErrorCode.INVALID_PLACEMENT:
350
- console.log('Invalid placement ID');
351
- break;
352
- default:
353
- console.error('Ad error:', error.message);
354
- }
355
- }}
356
- />
357
- ```
364
+ ## Full Documentation
358
365
 
359
- ## Example App
366
+ - [Full Integration Guide (Tracking + Ads)](./docs/FULL_INTEGRATION.md)
367
+ - [Tracking-Only Integration Guide](./docs/TRACKING_ONLY_INTEGRATION.md)
368
+ - [Google Ad Manager Setup](./docs/GOOGLE_SETUP.md)
369
+ - [Testing Guide](./docs/TESTING_GUIDE.md)
370
+ - [Example App](./example)
360
371
 
361
- Check out the [example app](./example) for a complete implementation:
372
+ ## Troubleshooting
362
373
 
374
+ ### iOS: Pod install fails
363
375
  ```bash
364
- cd react-native/example
365
- npm install
366
- npm run ios # or npm run android
376
+ cd ios
377
+ pod deintegrate
378
+ pod cache clean --all
379
+ pod install
367
380
  ```
368
381
 
369
- ## Troubleshooting
370
-
371
- ### iOS Issues
372
-
373
- 1. **Module not found**: Run `cd ios && pod install`
374
- 2. **Build failures**: Clean build folder and rebuild
375
- 3. **App crashes on launch**: Verify GADApplicationIdentifier in Info.plist
376
-
377
- ### Android Issues
378
-
379
- 1. **Manifest merger failed**: Check APPLICATION_ID in AndroidManifest.xml
380
- 2. **Build failures**: Sync project with Gradle files
381
- 3. **MultiDex issues**: Enable multidex in your app
382
-
383
- ### Common Issues
384
-
385
- 1. **Ads not loading**:
386
- - Verify initialization is complete
387
- - Check placement IDs match dashboard
388
- - Ensure test mode is disabled in production
389
-
390
- 2. **Revenue not tracking**:
391
- - Verify ILRD is enabled in Google Ad Manager
392
- - Check revenue event listeners are set up
393
-
394
- 3. **TypeScript errors**:
395
- - Update to latest version
396
- - Rebuild TypeScript definitions: `npm run typescript`
397
-
398
- ## Requirements
399
-
400
- - React Native 0.60+
401
- - iOS 13.0+
402
- - Android API 21+
403
- - TypeScript 4.0+ (optional)
382
+ ### Android: Build fails with duplicate classes
383
+ Add to `android/app/build.gradle`:
384
+ ```gradle
385
+ android {
386
+ packagingOptions {
387
+ pickFirst 'META-INF/*'
388
+ }
389
+ }
390
+ ```
404
391
 
405
- ## License
392
+ ### Ads not loading ("No Fill")
393
+ - Normal during testing — ad inventory varies by region and time
394
+ - Register your device as a test device to receive test ads
395
+ - Verify placement IDs match the BigCrunch dashboard
396
+ - Check the GAM App ID in `Info.plist` / `AndroidManifest.xml`
406
397
 
407
- MIT
398
+ ### Interstitial/Rewarded not showing
399
+ - Call `load()` before `show()`
400
+ - Check `isLoaded()` before calling `show()`
401
+ - Listen for `adFailedToLoad` events to diagnose issues
408
402
 
409
403
  ## Support
410
404
 
@@ -412,6 +406,6 @@ MIT
412
406
  - Issues: https://github.com/bigcrunch/mobile-ads-sdk/issues
413
407
  - Email: support@bigcrunch.com
414
408
 
415
- ## Contributing
409
+ ## License
416
410
 
417
- See [CONTRIBUTING.md](../CONTRIBUTING.md) for details.
411
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigcrunch/react-native-ads",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
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",