admanagekit-mcp-server 1.0.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/content/README.md +851 -0
- package/content/docs/AD_FREQUENCY_CONTROL.md +450 -0
- package/content/docs/AD_LOADING_STRATEGIES.md +369 -0
- package/content/docs/API_REFERENCE.md +734 -0
- package/content/docs/APP_PURCHASE_GUIDE.md +704 -0
- package/content/docs/BANNER_AD_IMPROVEMENTS.md +325 -0
- package/content/docs/COMPOSE_INTEGRATION.md +477 -0
- package/content/docs/CONFIGURATION_USAGE.md +168 -0
- package/content/docs/INTERSTITIAL_BUILDER_GUIDE.md +518 -0
- package/content/docs/JAVA_USAGE_GUIDE.md +785 -0
- package/content/docs/LOADING_STRATEGY_EXAMPLES.md +463 -0
- package/content/docs/NATIVE_AD_MANAGER_ENHANCEMENTS.md +347 -0
- package/content/docs/NATIVE_AD_PRELOADING.md +467 -0
- package/content/docs/NATIVE_TEMPLATE_VIEW.md +413 -0
- package/content/docs/app-open-ads.md +412 -0
- package/content/docs/interstitial-ads.md +269 -0
- package/content/docs/native-ads-caching.md +182 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.1.0.md +156 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.2.0.md +248 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.3.0.md +280 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.5.0.md +73 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.6.0.md +265 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.7.0.md +168 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.8.0.md +153 -0
- package/content/docs/release-notes/RELEASE_NOTES_v2.9.0.md +479 -0
- package/content/docs/release-notes/RELEASE_NOTES_v3.0.0.md +343 -0
- package/content/docs/release-notes/RELEASE_NOTES_v3.1.0.md +131 -0
- package/content/docs/release-notes/RELEASE_NOTES_v3.3.0.md +252 -0
- package/content/docs/release-notes/RELEASE_NOTES_v3.3.2.md +215 -0
- package/content/docs/release-notes/RELEASE_NOTES_v3.3.3.md +116 -0
- package/content/docs/release-notes/RELEASE_NOTES_v3.3.4.md +142 -0
- package/content/docs/release-notes/RELEASE_NOTES_v3.3.5.md +94 -0
- package/content/docs/rewarded-ads.md +623 -0
- package/content/wiki/Ad-Loading-Strategies.md +209 -0
- package/content/wiki/App-Open-Ads.md +189 -0
- package/content/wiki/Banner-Ads.md +133 -0
- package/content/wiki/Billing-Integration.md +69 -0
- package/content/wiki/Configuration.md +252 -0
- package/content/wiki/Consumable-Products.md +166 -0
- package/content/wiki/Home.md +144 -0
- package/content/wiki/Interstitial-Ads.md +313 -0
- package/content/wiki/Jetpack-Compose.md +270 -0
- package/content/wiki/NativeAdManager.md +220 -0
- package/content/wiki/Purchase-Categories.md +94 -0
- package/content/wiki/Rewarded-Ads.md +420 -0
- package/content/wiki/Subscription-Upgrades.md +278 -0
- package/content/wiki/Subscriptions.md +368 -0
- package/content/wiki/_Footer.md +3 -0
- package/content/wiki/_Sidebar.md +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +18 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/code-generation.d.ts +2 -0
- package/dist/tools/code-generation.js +264 -0
- package/dist/tools/code-generation.js.map +1 -0
- package/dist/tools/documentation.d.ts +2 -0
- package/dist/tools/documentation.js +202 -0
- package/dist/tools/documentation.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.js +83 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/doc-loader.d.ts +17 -0
- package/dist/utils/doc-loader.js +245 -0
- package/dist/utils/doc-loader.js.map +1 -0
- package/dist/utils/search.d.ts +2 -0
- package/dist/utils/search.js +62 -0
- package/dist/utils/search.js.map +1 -0
- package/dist/utils/templates.d.ts +60 -0
- package/dist/utils/templates.js +793 -0
- package/dist/utils/templates.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
# Ad Frequency Control Guide
|
|
2
|
+
|
|
3
|
+
## ✨ Overview
|
|
4
|
+
|
|
5
|
+
InterstitialAdBuilder now provides **three powerful ways** to control when and how often ads are shown:
|
|
6
|
+
|
|
7
|
+
1. **📊 everyNthTime** - Show every Nth time method is called
|
|
8
|
+
2. **🔢 maxShows** - Limit total number of times ad is shown
|
|
9
|
+
3. **⏱️ minInterval** - Enforce minimum time between shows
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🎯 Configuration Methods
|
|
14
|
+
|
|
15
|
+
### 1. `everyNthTime(n)` - Show Every Nth Call
|
|
16
|
+
|
|
17
|
+
Show ad only on specific call intervals (3rd, 6th, 9th, etc.)
|
|
18
|
+
|
|
19
|
+
```kotlin
|
|
20
|
+
InterstitialAdBuilder.with(this)
|
|
21
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
22
|
+
.everyNthTime(3) // Show on 3rd, 6th, 9th... call
|
|
23
|
+
.show { next() }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**When to use:**
|
|
27
|
+
- ✅ Show ad every 3 level completions
|
|
28
|
+
- ✅ Show after every 5 button clicks
|
|
29
|
+
- ✅ Show every Nth game over
|
|
30
|
+
|
|
31
|
+
**Example - Every 3rd Level:**
|
|
32
|
+
```kotlin
|
|
33
|
+
class GameActivity : AppCompatActivity() {
|
|
34
|
+
|
|
35
|
+
private val adBuilder = InterstitialAdBuilder.with(this)
|
|
36
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
37
|
+
.everyNthTime(3) // Only every 3rd time
|
|
38
|
+
.debug()
|
|
39
|
+
|
|
40
|
+
fun onLevelComplete() {
|
|
41
|
+
// Called every level
|
|
42
|
+
// Ad shows only on levels 3, 6, 9, 12, etc.
|
|
43
|
+
adBuilder.show {
|
|
44
|
+
loadNextLevel()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Behavior:**
|
|
51
|
+
```
|
|
52
|
+
Call 1: ❌ Skip (not 3rd)
|
|
53
|
+
Call 2: ❌ Skip (not 3rd)
|
|
54
|
+
Call 3: ✅ SHOW AD (3rd call)
|
|
55
|
+
Call 4: ❌ Skip (not 3rd)
|
|
56
|
+
Call 5: ❌ Skip (not 3rd)
|
|
57
|
+
Call 6: ✅ SHOW AD (6th call)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### 2. `maxShows(n)` - Limit Total Shows
|
|
63
|
+
|
|
64
|
+
Limit maximum number of times ad can be shown **globally** (across entire app lifecycle).
|
|
65
|
+
|
|
66
|
+
```kotlin
|
|
67
|
+
InterstitialAdBuilder.with(this)
|
|
68
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
69
|
+
.maxShows(10) // Max 10 times total
|
|
70
|
+
.show { next() }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**When to use:**
|
|
74
|
+
- ✅ Show ad maximum 5 times per session
|
|
75
|
+
- ✅ Limit annoying ads for power users
|
|
76
|
+
- ✅ Gradually reduce ads as user progresses
|
|
77
|
+
|
|
78
|
+
**Example - First 5 Times Only:**
|
|
79
|
+
```kotlin
|
|
80
|
+
InterstitialAdBuilder.with(this)
|
|
81
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
82
|
+
.maxShows(5) // Only first 5 times
|
|
83
|
+
.show { next() }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Behavior:**
|
|
87
|
+
```
|
|
88
|
+
Show 1: ✅ SHOW AD (1/5)
|
|
89
|
+
Show 2: ✅ SHOW AD (2/5)
|
|
90
|
+
Show 3: ✅ SHOW AD (3/5)
|
|
91
|
+
Show 4: ✅ SHOW AD (4/5)
|
|
92
|
+
Show 5: ✅ SHOW AD (5/5)
|
|
93
|
+
Show 6: ❌ Skip (limit reached)
|
|
94
|
+
Show 7: ❌ Skip (limit reached)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### 3. `minInterval(millis)` - Time-Based Control
|
|
100
|
+
|
|
101
|
+
Enforce minimum time between ad shows. Ad won't show if insufficient time has passed.
|
|
102
|
+
|
|
103
|
+
```kotlin
|
|
104
|
+
InterstitialAdBuilder.with(this)
|
|
105
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
106
|
+
.minInterval(60000) // 60 seconds minimum
|
|
107
|
+
.show { next() }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Convenience method:**
|
|
111
|
+
```kotlin
|
|
112
|
+
.minIntervalSeconds(60) // Same as minInterval(60000)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**When to use:**
|
|
116
|
+
- ✅ Prevent ad spam
|
|
117
|
+
- ✅ Ensure smooth user experience
|
|
118
|
+
- ✅ Respect user's time
|
|
119
|
+
|
|
120
|
+
**Example - 30 Second Intervals:**
|
|
121
|
+
```kotlin
|
|
122
|
+
InterstitialAdBuilder.with(this)
|
|
123
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
124
|
+
.minIntervalSeconds(30) // 30 seconds minimum
|
|
125
|
+
.show { next() }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Behavior:**
|
|
129
|
+
```
|
|
130
|
+
Time 0s: ✅ SHOW AD (first show)
|
|
131
|
+
Time 10s: ❌ Skip (only 10s passed, need 30s)
|
|
132
|
+
Time 20s: ❌ Skip (only 20s passed, need 30s)
|
|
133
|
+
Time 35s: ✅ SHOW AD (30s+ passed)
|
|
134
|
+
Time 40s: ❌ Skip (only 5s since last show)
|
|
135
|
+
Time 70s: ✅ SHOW AD (30s+ passed)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Override with `.force()`:**
|
|
139
|
+
```kotlin
|
|
140
|
+
InterstitialAdBuilder.with(this)
|
|
141
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
142
|
+
.minIntervalSeconds(60)
|
|
143
|
+
.force() // Ignore time interval
|
|
144
|
+
.show { next() }
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🎨 Complete Examples
|
|
150
|
+
|
|
151
|
+
### Example 1: Game - Every 3 Levels
|
|
152
|
+
```kotlin
|
|
153
|
+
class GameActivity : AppCompatActivity() {
|
|
154
|
+
|
|
155
|
+
private val levelCompleteAd = InterstitialAdBuilder.with(this)
|
|
156
|
+
.adUnit(getString(R.string.interstitial_game))
|
|
157
|
+
.everyNthTime(3) // Every 3rd level
|
|
158
|
+
.debug()
|
|
159
|
+
|
|
160
|
+
fun onLevelComplete() {
|
|
161
|
+
levelCompleteAd.show {
|
|
162
|
+
loadNextLevel()
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Example 2: Limited Ad Exposure
|
|
169
|
+
```kotlin
|
|
170
|
+
class MainActivity : AppCompatActivity() {
|
|
171
|
+
|
|
172
|
+
private fun showWelcomeAd() {
|
|
173
|
+
InterstitialAdBuilder.with(this)
|
|
174
|
+
.adUnit(getString(R.string.interstitial_welcome))
|
|
175
|
+
.maxShows(3) // Only first 3 times
|
|
176
|
+
.show {
|
|
177
|
+
showMainContent()
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Example 3: Time-Controlled Ads
|
|
184
|
+
```kotlin
|
|
185
|
+
class ArticleActivity : AppCompatActivity() {
|
|
186
|
+
|
|
187
|
+
private fun showArticleAd() {
|
|
188
|
+
InterstitialAdBuilder.with(this)
|
|
189
|
+
.adUnit(getString(R.string.interstitial_article))
|
|
190
|
+
.minIntervalSeconds(120) // 2 minutes minimum
|
|
191
|
+
.show {
|
|
192
|
+
loadNextArticle()
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Example 4: Combined Controls (Recommended!)
|
|
199
|
+
```kotlin
|
|
200
|
+
class AppActivity : AppCompatActivity() {
|
|
201
|
+
|
|
202
|
+
private fun showSmartAd() {
|
|
203
|
+
InterstitialAdBuilder.with(this)
|
|
204
|
+
.adUnit("ca-app-pub-xxxxx/yyyyy")
|
|
205
|
+
.everyNthTime(2) // Every 2nd call
|
|
206
|
+
.maxShows(10) // Max 10 times total
|
|
207
|
+
.minIntervalSeconds(30) // 30s minimum between
|
|
208
|
+
.debug()
|
|
209
|
+
.show {
|
|
210
|
+
continueFlow()
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Combined behavior:**
|
|
217
|
+
- ✅ Must be Nth call
|
|
218
|
+
- ✅ AND haven't reached maxShows
|
|
219
|
+
- ✅ AND minimum time has passed
|
|
220
|
+
- ✅ Only then show ad
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 📊 Configuration Combinations
|
|
225
|
+
|
|
226
|
+
### Combination 1: Gentle Introduction
|
|
227
|
+
```kotlin
|
|
228
|
+
// Show ad 3 times in first session, then stop
|
|
229
|
+
InterstitialAdBuilder.with(this)
|
|
230
|
+
.adUnit("ad-unit")
|
|
231
|
+
.maxShows(3)
|
|
232
|
+
.minIntervalSeconds(60) // But space them out
|
|
233
|
+
.show { next() }
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Combination 2: Frequent But Fair
|
|
237
|
+
```kotlin
|
|
238
|
+
// Show every time, but respect intervals
|
|
239
|
+
InterstitialAdBuilder.with(this)
|
|
240
|
+
.adUnit("ad-unit")
|
|
241
|
+
.minIntervalSeconds(45) // 45 second minimum
|
|
242
|
+
.show { next() }
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Combination 3: Occasional Ads
|
|
246
|
+
```kotlin
|
|
247
|
+
// Show every 5th action, max 20 times
|
|
248
|
+
InterstitialAdBuilder.with(this)
|
|
249
|
+
.adUnit("ad-unit")
|
|
250
|
+
.everyNthTime(5)
|
|
251
|
+
.maxShows(20)
|
|
252
|
+
.show { next() }
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Combination 4: Conservative Approach
|
|
256
|
+
```kotlin
|
|
257
|
+
// Rare, time-spaced ads
|
|
258
|
+
InterstitialAdBuilder.with(this)
|
|
259
|
+
.adUnit("ad-unit")
|
|
260
|
+
.everyNthTime(3)
|
|
261
|
+
.maxShows(5)
|
|
262
|
+
.minIntervalSeconds(120) // 2 minutes
|
|
263
|
+
.show { next() }
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 🔧 Advanced Usage
|
|
269
|
+
|
|
270
|
+
### Reset Counter Strategy
|
|
271
|
+
```kotlin
|
|
272
|
+
class MyApplication : Application() {
|
|
273
|
+
|
|
274
|
+
override fun onCreate() {
|
|
275
|
+
super.onCreate()
|
|
276
|
+
|
|
277
|
+
// Reset counters on app restart
|
|
278
|
+
if (isNewSession()) {
|
|
279
|
+
AdManager.getInstance().resetAdThrottling()
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Per-Screen Configuration
|
|
286
|
+
```kotlin
|
|
287
|
+
class ScreenManager {
|
|
288
|
+
|
|
289
|
+
fun getAdForScreen(activity: Activity, screenType: String): InterstitialAdBuilder {
|
|
290
|
+
return when (screenType) {
|
|
291
|
+
"game_over" -> InterstitialAdBuilder.with(activity)
|
|
292
|
+
.adUnit("ca-app-pub-xxx/game")
|
|
293
|
+
.everyNthTime(2) // Every other time
|
|
294
|
+
.minIntervalSeconds(30)
|
|
295
|
+
|
|
296
|
+
"level_complete" -> InterstitialAdBuilder.with(activity)
|
|
297
|
+
.adUnit("ca-app-pub-xxx/level")
|
|
298
|
+
.everyNthTime(3) // Every 3rd level
|
|
299
|
+
.maxShows(10)
|
|
300
|
+
|
|
301
|
+
"menu" -> InterstitialAdBuilder.with(activity)
|
|
302
|
+
.adUnit("ca-app-pub-xxx/menu")
|
|
303
|
+
.minIntervalSeconds(120) // Rare
|
|
304
|
+
|
|
305
|
+
else -> InterstitialAdBuilder.with(activity)
|
|
306
|
+
.adUnit("ca-app-pub-xxx/default")
|
|
307
|
+
.minIntervalSeconds(60)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Debug Monitoring
|
|
314
|
+
```kotlin
|
|
315
|
+
// See detailed logs of all checks
|
|
316
|
+
InterstitialAdBuilder.with(this)
|
|
317
|
+
.adUnit("ad-unit")
|
|
318
|
+
.everyNthTime(3)
|
|
319
|
+
.maxShows(10)
|
|
320
|
+
.minIntervalSeconds(30)
|
|
321
|
+
.debug() // See all skip reasons in logcat
|
|
322
|
+
.show { next() }
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Debug output:**
|
|
326
|
+
```
|
|
327
|
+
D/InterstitialBuilder: Not Nth time (call #1, showing every 3rd), skipping ad
|
|
328
|
+
D/InterstitialBuilder: Not Nth time (call #2, showing every 3rd), skipping ad
|
|
329
|
+
D/InterstitialBuilder: Ad shown successfully
|
|
330
|
+
D/InterstitialBuilder: Min interval not met (15000ms < 30000ms, 15000ms remaining), skipping ad
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 📈 Best Practices
|
|
336
|
+
|
|
337
|
+
### 1. Always Combine Methods
|
|
338
|
+
```kotlin
|
|
339
|
+
// ✅ GOOD: Multiple controls
|
|
340
|
+
InterstitialAdBuilder.with(this)
|
|
341
|
+
.adUnit("ad-unit")
|
|
342
|
+
.everyNthTime(2)
|
|
343
|
+
.maxShows(15)
|
|
344
|
+
.minIntervalSeconds(45)
|
|
345
|
+
.show { next() }
|
|
346
|
+
|
|
347
|
+
// ❌ BAD: No frequency control
|
|
348
|
+
InterstitialAdBuilder.with(this)
|
|
349
|
+
.adUnit("ad-unit")
|
|
350
|
+
.show { next() } // Shows every time!
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### 2. Use Debug Mode in Development
|
|
354
|
+
```kotlin
|
|
355
|
+
if (BuildConfig.DEBUG) {
|
|
356
|
+
builder.debug() // See why ads are skipped
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### 3. Different Strategies Per Context
|
|
361
|
+
```kotlin
|
|
362
|
+
// Game over: More frequent
|
|
363
|
+
.everyNthTime(2).minIntervalSeconds(30)
|
|
364
|
+
|
|
365
|
+
// Menu: Less frequent
|
|
366
|
+
.everyNthTime(5).minIntervalSeconds(120)
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### 4. Respect User Experience
|
|
370
|
+
```kotlin
|
|
371
|
+
// ✅ GOOD: Balanced
|
|
372
|
+
.everyNthTime(3)
|
|
373
|
+
.maxShows(10)
|
|
374
|
+
.minIntervalSeconds(60)
|
|
375
|
+
|
|
376
|
+
// ❌ BAD: Too aggressive
|
|
377
|
+
.everyNthTime(1) // Every time
|
|
378
|
+
.minIntervalSeconds(5) // Every 5 seconds
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## 🎯 Recommended Configurations
|
|
384
|
+
|
|
385
|
+
### For Games:
|
|
386
|
+
```kotlin
|
|
387
|
+
InterstitialAdBuilder.with(this)
|
|
388
|
+
.adUnit("ad-unit")
|
|
389
|
+
.everyNthTime(3) // Every 3rd game over
|
|
390
|
+
.maxShows(20) // Reasonable limit
|
|
391
|
+
.minIntervalSeconds(45) // 45s between
|
|
392
|
+
.show { restart() }
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### For News/Content Apps:
|
|
396
|
+
```kotlin
|
|
397
|
+
InterstitialAdBuilder.with(this)
|
|
398
|
+
.adUnit("ad-unit")
|
|
399
|
+
.everyNthTime(2) // Every other article
|
|
400
|
+
.minIntervalSeconds(90) // 90s minimum
|
|
401
|
+
.show { nextArticle() }
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### For Utility Apps:
|
|
405
|
+
```kotlin
|
|
406
|
+
InterstitialAdBuilder.with(this)
|
|
407
|
+
.adUnit("ad-unit")
|
|
408
|
+
.everyNthTime(5) // Every 5th action
|
|
409
|
+
.maxShows(10) // Limited exposure
|
|
410
|
+
.minIntervalSeconds(120) // 2 minutes
|
|
411
|
+
.show { next() }
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## 🐛 Troubleshooting
|
|
417
|
+
|
|
418
|
+
### Ad Not Showing?
|
|
419
|
+
|
|
420
|
+
Enable debug mode:
|
|
421
|
+
```kotlin
|
|
422
|
+
.debug() // See exact reason in logcat
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Common reasons:
|
|
426
|
+
- ❌ "Not Nth time" - Increase everyNthTime or remove
|
|
427
|
+
- ❌ "Max shows reached" - Increase maxShows or reset counter
|
|
428
|
+
- ❌ "Min interval not met" - Reduce minInterval or wait longer
|
|
429
|
+
|
|
430
|
+
### Reset Counters:
|
|
431
|
+
```kotlin
|
|
432
|
+
AdManager.getInstance().resetAdThrottling()
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## 📊 Summary Table
|
|
438
|
+
|
|
439
|
+
| Method | Purpose | Example | Use When |
|
|
440
|
+
|--------|---------|---------|----------|
|
|
441
|
+
| `everyNthTime(n)` | Show every Nth call | `.everyNthTime(3)` | Spacing out ad frequency |
|
|
442
|
+
| `maxShows(n)` | Limit total shows | `.maxShows(10)` | Capping ad exposure |
|
|
443
|
+
| `minInterval(ms)` | Time between shows | `.minInterval(60000)` | Preventing ad spam |
|
|
444
|
+
| `minIntervalSeconds(s)` | Time (convenience) | `.minIntervalSeconds(60)` | Same as above, easier |
|
|
445
|
+
| `.force()` | Override all | `.force()` | Critical moments only |
|
|
446
|
+
| `.debug()` | See logs | `.debug()` | Development/testing |
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
**With these controls, you can create a perfect ad experience that maximizes revenue while respecting users!** 🚀
|