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,252 @@
|
|
|
1
|
+
# Release Notes - v3.3.0
|
|
2
|
+
|
|
3
|
+
## Highlights
|
|
4
|
+
|
|
5
|
+
- **Single-Activity App Support**: Screen and fragment tag-based exclusions for app open ads
|
|
6
|
+
- **Background-Aware Ad Display**: Ads no longer show when app is in background
|
|
7
|
+
- **Dialog Stability Fixes**: Prevents duplicate dialogs and threading issues
|
|
8
|
+
- **New onAdShowed() Callback**: Know when interstitial ad covers the screen
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## New Features
|
|
13
|
+
|
|
14
|
+
### Single-Activity App Support for App Open Ads
|
|
15
|
+
|
|
16
|
+
For apps using a single activity with multiple fragments (Navigation Component, Jetpack Compose Navigation), you can now control app open ads per screen:
|
|
17
|
+
|
|
18
|
+
#### Screen Tag Exclusions
|
|
19
|
+
|
|
20
|
+
```kotlin
|
|
21
|
+
// In Application class
|
|
22
|
+
appOpenManager = AppOpenManager(this, "ca-app-pub-xxxxx/yyyyy").apply {
|
|
23
|
+
excludeScreenTags("Payment", "Onboarding", "Checkout")
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// In MainActivity - track current screen on navigation
|
|
27
|
+
navController.addOnDestinationChangedListener { _, destination, _ ->
|
|
28
|
+
(application as MyApp).appOpenManager.setCurrentScreenTag(
|
|
29
|
+
destination.label?.toString()
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Fragment Tag Exclusions
|
|
35
|
+
|
|
36
|
+
```kotlin
|
|
37
|
+
// Set provider for automatic fragment detection
|
|
38
|
+
appOpenManager.setFragmentTagProvider {
|
|
39
|
+
supportFragmentManager.fragments.lastOrNull()?.tag
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Exclude specific fragment tags
|
|
43
|
+
appOpenManager.excludeFragmentTags("PaymentFragment", "OnboardingFragment")
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### Temporary Disable/Enable
|
|
47
|
+
|
|
48
|
+
```kotlin
|
|
49
|
+
// Disable during critical flows
|
|
50
|
+
appOpenManager.disableAppOpenAdsTemporarily()
|
|
51
|
+
|
|
52
|
+
// ... perform operation ...
|
|
53
|
+
|
|
54
|
+
// Re-enable when done
|
|
55
|
+
appOpenManager.enableAppOpenAds()
|
|
56
|
+
|
|
57
|
+
// Check current state
|
|
58
|
+
if (appOpenManager.areAppOpenAdsEnabled()) { }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Background-Aware Ad Display
|
|
62
|
+
|
|
63
|
+
App open ads now intelligently handle background/foreground transitions:
|
|
64
|
+
|
|
65
|
+
- **No Background Ads**: Ads won't try to show when app is in background
|
|
66
|
+
- **Pending Ad Queue**: If ad loads while app is in background, it's saved for when user returns
|
|
67
|
+
- **Welcome Dialog on Return**: When user returns, a welcome dialog appears briefly before showing the saved ad
|
|
68
|
+
|
|
69
|
+
```kotlin
|
|
70
|
+
// This is automatic - no code changes needed!
|
|
71
|
+
// When user switches apps during ad loading:
|
|
72
|
+
// 1. Ad loads in background -> saved as pending
|
|
73
|
+
// 2. Dialog dismisses automatically
|
|
74
|
+
// 3. User returns to app
|
|
75
|
+
// 4. Welcome dialog appears
|
|
76
|
+
// 5. Pending ad shows smoothly
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### New onAdShowed() Callback
|
|
80
|
+
|
|
81
|
+
Know exactly when an interstitial ad is displayed on screen:
|
|
82
|
+
|
|
83
|
+
```kotlin
|
|
84
|
+
AdManager.getInstance().forceShowInterstitial(activity, object : AdManagerCallback() {
|
|
85
|
+
override fun onAdShowed() {
|
|
86
|
+
// Ad is now covering the screen
|
|
87
|
+
// Pause game, mute audio, track analytics
|
|
88
|
+
gameEngine.pause()
|
|
89
|
+
audioManager.mute()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
override fun onNextAction() {
|
|
93
|
+
// Ad dismissed - resume normal operation
|
|
94
|
+
gameEngine.resume()
|
|
95
|
+
audioManager.unmute()
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Bug Fixes
|
|
103
|
+
|
|
104
|
+
### Dialog Duplication Fix
|
|
105
|
+
|
|
106
|
+
**Issue**: When app was paused and resumed during ad loading dialog, a new dialog would appear without dismissing the old one, causing multiple overlapping dialogs.
|
|
107
|
+
|
|
108
|
+
**Fix**:
|
|
109
|
+
- Track current dialog instance to prevent duplicates
|
|
110
|
+
- Dismiss existing dialog before showing new one
|
|
111
|
+
- Added `isFetchingWithDialog` flag to prevent concurrent fetch requests
|
|
112
|
+
|
|
113
|
+
### Threading Issues Fix
|
|
114
|
+
|
|
115
|
+
**Issue**: Ad SDK callbacks could be called from background threads, causing crashes:
|
|
116
|
+
- `Animators may only be run on Looper threads`
|
|
117
|
+
- `Can't toast on a thread that has not called Looper.prepare()`
|
|
118
|
+
|
|
119
|
+
**Fix**: All ad callbacks in both `AdManager` and `AppOpenManager` now properly dispatch to main thread using `Handler(Looper.getMainLooper()).post { }`.
|
|
120
|
+
|
|
121
|
+
### Interstitial Priority Fix
|
|
122
|
+
|
|
123
|
+
**Issue**: App open ads would show on top of interstitial loading dialogs when user switched apps and came back.
|
|
124
|
+
|
|
125
|
+
**Fix**:
|
|
126
|
+
- `onStart` now checks `isAdOrDialogShowing()` instead of just `isDisplayingAd()`
|
|
127
|
+
- If interstitial dialog is showing, app open ad is skipped
|
|
128
|
+
- Pending app open ads are cleared when interstitial has priority
|
|
129
|
+
|
|
130
|
+
### Race Condition Fix
|
|
131
|
+
|
|
132
|
+
**Issue**: Multiple ads could show in rapid succession due to flag being set after `show()` instead of before.
|
|
133
|
+
|
|
134
|
+
**Fix**: `isShowingAd` flag is now set synchronously before calling `show()` to prevent concurrent show attempts.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## New API Methods
|
|
139
|
+
|
|
140
|
+
### AdManagerCallback
|
|
141
|
+
|
|
142
|
+
```kotlin
|
|
143
|
+
// NEW - Called when ad covers the full screen
|
|
144
|
+
open fun onAdShowed() { }
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### AdManager
|
|
148
|
+
|
|
149
|
+
```kotlin
|
|
150
|
+
// NEW - Check if loading dialog is showing
|
|
151
|
+
fun isLoadingDialogShowing(): Boolean
|
|
152
|
+
|
|
153
|
+
// NEW - Check if ad OR loading dialog is showing
|
|
154
|
+
fun isAdOrDialogShowing(): Boolean
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### AppOpenManager
|
|
158
|
+
|
|
159
|
+
#### Screen Tag Exclusions
|
|
160
|
+
```kotlin
|
|
161
|
+
fun setCurrentScreenTag(tag: String?)
|
|
162
|
+
fun getCurrentScreenTag(): String?
|
|
163
|
+
fun excludeScreenTag(tag: String)
|
|
164
|
+
fun excludeScreenTags(vararg tags: String)
|
|
165
|
+
fun includeScreenTag(tag: String)
|
|
166
|
+
fun clearScreenTagExclusions()
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
#### Fragment Tag Exclusions
|
|
170
|
+
```kotlin
|
|
171
|
+
fun setFragmentTagProvider(provider: (() -> String?)?)
|
|
172
|
+
fun excludeFragmentTag(tag: String)
|
|
173
|
+
fun excludeFragmentTags(vararg tags: String)
|
|
174
|
+
fun includeFragmentTag(tag: String)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### Temporary Control
|
|
178
|
+
```kotlin
|
|
179
|
+
fun disableAppOpenAdsTemporarily()
|
|
180
|
+
fun enableAppOpenAds()
|
|
181
|
+
fun areAppOpenAdsEnabled(): Boolean
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Migration Guide
|
|
187
|
+
|
|
188
|
+
### From v3.2.0 to v3.3.0
|
|
189
|
+
|
|
190
|
+
This is a **backward-compatible** release. No code changes are required.
|
|
191
|
+
|
|
192
|
+
**Optional Enhancements**:
|
|
193
|
+
|
|
194
|
+
#### 1. Use onAdShowed() for better app state management
|
|
195
|
+
|
|
196
|
+
```kotlin
|
|
197
|
+
// Before (v3.1.0)
|
|
198
|
+
AdManager.getInstance().forceShowInterstitial(activity, object : AdManagerCallback() {
|
|
199
|
+
override fun onNextAction() { navigateNext() }
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
// After (v3.2.0) - Know when ad is actually showing
|
|
203
|
+
AdManager.getInstance().forceShowInterstitial(activity, object : AdManagerCallback() {
|
|
204
|
+
override fun onAdShowed() {
|
|
205
|
+
pauseAppContent() // Ad is now visible
|
|
206
|
+
}
|
|
207
|
+
override fun onNextAction() {
|
|
208
|
+
resumeAppContent()
|
|
209
|
+
navigateNext()
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### 2. Single-Activity App Support
|
|
215
|
+
|
|
216
|
+
```kotlin
|
|
217
|
+
// Before (v3.1.0) - No way to exclude specific screens in single-activity apps
|
|
218
|
+
|
|
219
|
+
// After (v3.2.0) - Exclude specific screens
|
|
220
|
+
appOpenManager.excludeScreenTags("Payment", "Onboarding")
|
|
221
|
+
navController.addOnDestinationChangedListener { _, destination, _ ->
|
|
222
|
+
appOpenManager.setCurrentScreenTag(destination.label?.toString())
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Full Changelog
|
|
229
|
+
|
|
230
|
+
### New Features
|
|
231
|
+
- Added screen tag exclusions (`setCurrentScreenTag`, `excludeScreenTags`, `includeScreenTag`)
|
|
232
|
+
- Added fragment tag exclusions (`setFragmentTagProvider`, `excludeFragmentTags`, `includeFragmentTag`)
|
|
233
|
+
- Added temporary disable/enable (`disableAppOpenAdsTemporarily`, `enableAppOpenAds`, `areAppOpenAdsEnabled`)
|
|
234
|
+
- Added `onAdShowed()` callback to `AdManagerCallback`
|
|
235
|
+
- Added `isLoadingDialogShowing()` and `isAdOrDialogShowing()` to `AdManager`
|
|
236
|
+
- Added background/foreground detection for app open ads
|
|
237
|
+
- Added pending ad queue for ads loaded while in background
|
|
238
|
+
|
|
239
|
+
### Bug Fixes
|
|
240
|
+
- Fixed duplicate dialog display when app is paused/resumed during ad loading
|
|
241
|
+
- Fixed threading crashes ("Animators may only be run on Looper threads")
|
|
242
|
+
- Fixed app open ads showing on top of interstitial loading dialogs
|
|
243
|
+
- Fixed race condition allowing multiple concurrent ad shows
|
|
244
|
+
- Fixed `currentWelcomeDialog` not being cleared properly after dismissal
|
|
245
|
+
|
|
246
|
+
### Internal Improvements
|
|
247
|
+
- Added `currentLoadingDialog` tracking in `AdManager`
|
|
248
|
+
- Added `isFetchingWithDialog` flag to prevent duplicate fetch requests
|
|
249
|
+
- Added `isAppInForeground` tracking in `AppOpenManager`
|
|
250
|
+
- Added `onStop` lifecycle callback for background detection
|
|
251
|
+
- Wrapped all ad SDK callbacks in main thread handlers
|
|
252
|
+
- Updated `cleanup()` to clear new exclusion collections
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Release Notes - v3.3.2
|
|
2
|
+
|
|
3
|
+
## Highlights
|
|
4
|
+
|
|
5
|
+
- **InterstitialAdBuilder Fix**: Ad unit now properly assigned to AdManager on first HYBRID fetch
|
|
6
|
+
- **everyNthTime Fix**: Call counter persists across builder instances
|
|
7
|
+
- **New Native Templates**: `flexible`, `icon_left`, and `top_icon_media` for GridView display
|
|
8
|
+
- **Call Counter API**: Manage everyNthTime counters via AdManager
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Bug Fixes
|
|
13
|
+
|
|
14
|
+
### InterstitialAdBuilder Ad Unit Assignment
|
|
15
|
+
|
|
16
|
+
**Issue**: When using `InterstitialAdBuilder` with HYBRID strategy and no cached ad available, the first "force fetch" path would fail because the ad unit was only stored in `primaryAdUnit` but never assigned to `AdManager.adUnitId`.
|
|
17
|
+
|
|
18
|
+
**Fix**: The `adUnit()` method now immediately sets the ad unit on AdManager:
|
|
19
|
+
|
|
20
|
+
```kotlin
|
|
21
|
+
// Before (v3.3.1) - Ad unit not available in AdManager
|
|
22
|
+
InterstitialAdBuilder.with(activity)
|
|
23
|
+
.adUnit("ca-app-pub-xxx/yyy") // Only stored in builder
|
|
24
|
+
.strategy(AdLoadingStrategy.HYBRID)
|
|
25
|
+
.showWithDialog { navigateNext() }
|
|
26
|
+
// First call with empty cache would fail!
|
|
27
|
+
|
|
28
|
+
// After (v3.3.2) - Ad unit immediately available
|
|
29
|
+
InterstitialAdBuilder.with(activity)
|
|
30
|
+
.adUnit("ca-app-pub-xxx/yyy") // Now also sets AdManager.adUnitId
|
|
31
|
+
.strategy(AdLoadingStrategy.HYBRID)
|
|
32
|
+
.showWithDialog { navigateNext() }
|
|
33
|
+
// Works correctly on first call
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### everyNthTime Counter Persistence
|
|
37
|
+
|
|
38
|
+
**Issue**: The `everyNthTime()` feature would not work correctly because the call counter was stored as an instance variable in `InterstitialAdBuilder`. Since a new builder is created for each call, the counter would always reset to 0.
|
|
39
|
+
|
|
40
|
+
**Fix**: Call counters are now stored in `AdManager` singleton and persist across builder instances:
|
|
41
|
+
|
|
42
|
+
```kotlin
|
|
43
|
+
// Before (v3.3.1) - Counter reset each call
|
|
44
|
+
InterstitialAdBuilder.with(activity)
|
|
45
|
+
.adUnit(adUnitId)
|
|
46
|
+
.everyNthTime(3) // Counter always starts at 0
|
|
47
|
+
.show { }
|
|
48
|
+
// Ads shown on EVERY call (counter never reaches 3)
|
|
49
|
+
|
|
50
|
+
// After (v3.3.2) - Counter persists
|
|
51
|
+
InterstitialAdBuilder.with(activity)
|
|
52
|
+
.adUnit(adUnitId)
|
|
53
|
+
.everyNthTime(3) // Counter increments: 1, 2, 3, 1, 2, 3...
|
|
54
|
+
.show { }
|
|
55
|
+
// Ads shown on 3rd, 6th, 9th calls, etc.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## New Features
|
|
61
|
+
|
|
62
|
+
### New Native Templates for GridView
|
|
63
|
+
|
|
64
|
+
Three new templates designed for displaying native ads in GridView or similar layouts:
|
|
65
|
+
|
|
66
|
+
#### flexible Template
|
|
67
|
+
- Adaptive layout that adjusts to available space
|
|
68
|
+
- MediaView support for video content
|
|
69
|
+
- Responsive design for various screen sizes
|
|
70
|
+
|
|
71
|
+
#### icon_left Template
|
|
72
|
+
- Icon positioned on the left side
|
|
73
|
+
- MediaView at top for video content support
|
|
74
|
+
- Headline and CTA in content section
|
|
75
|
+
- Matches `grid_item` styling
|
|
76
|
+
|
|
77
|
+
#### top_icon_media Template
|
|
78
|
+
- Icon and text at top
|
|
79
|
+
- MediaView in the middle section
|
|
80
|
+
- CTA button at bottom
|
|
81
|
+
|
|
82
|
+
```kotlin
|
|
83
|
+
nativeTemplateView.setTemplate(NativeAdTemplate.FLEXIBLE)
|
|
84
|
+
nativeTemplateView.loadNativeAd(activity, adUnitId)
|
|
85
|
+
|
|
86
|
+
nativeTemplateView.setTemplate(NativeAdTemplate.ICON_LEFT)
|
|
87
|
+
nativeTemplateView.loadNativeAd(activity, adUnitId)
|
|
88
|
+
|
|
89
|
+
nativeTemplateView.setTemplate(NativeAdTemplate.TOP_ICON_MEDIA)
|
|
90
|
+
nativeTemplateView.loadNativeAd(activity, adUnitId)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### AdManager Call Counter API
|
|
94
|
+
|
|
95
|
+
New methods for managing `everyNthTime` counters programmatically:
|
|
96
|
+
|
|
97
|
+
```kotlin
|
|
98
|
+
// Get current counter value for an ad unit
|
|
99
|
+
val count = AdManager.getInstance().getCallCount("ca-app-pub-xxx/yyy")
|
|
100
|
+
|
|
101
|
+
// Manually increment counter
|
|
102
|
+
val newCount = AdManager.getInstance().incrementCallCount("ca-app-pub-xxx/yyy")
|
|
103
|
+
|
|
104
|
+
// Reset counter for specific ad unit
|
|
105
|
+
AdManager.getInstance().resetCallCount("ca-app-pub-xxx/yyy")
|
|
106
|
+
|
|
107
|
+
// Reset all counters (useful when user upgrades to premium)
|
|
108
|
+
AdManager.getInstance().resetAllCallCounts()
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### AdManager.setAdUnitId()
|
|
112
|
+
|
|
113
|
+
New method to set ad unit ID directly:
|
|
114
|
+
|
|
115
|
+
```kotlin
|
|
116
|
+
// Useful when you need to configure AdManager before using builder
|
|
117
|
+
AdManager.getInstance().setAdUnitId("ca-app-pub-xxx/yyy")
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## New API Methods
|
|
123
|
+
|
|
124
|
+
### AdManager
|
|
125
|
+
|
|
126
|
+
```kotlin
|
|
127
|
+
// Set ad unit ID directly
|
|
128
|
+
fun setAdUnitId(adUnitId: String?)
|
|
129
|
+
|
|
130
|
+
// Increment and return call counter
|
|
131
|
+
fun incrementCallCount(adUnitId: String): Int
|
|
132
|
+
|
|
133
|
+
// Get current call counter value
|
|
134
|
+
fun getCallCount(adUnitId: String): Int
|
|
135
|
+
|
|
136
|
+
// Reset counter for specific ad unit
|
|
137
|
+
fun resetCallCount(adUnitId: String)
|
|
138
|
+
|
|
139
|
+
// Reset all call counters
|
|
140
|
+
fun resetAllCallCounts()
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### NativeAdTemplate (Enum)
|
|
144
|
+
|
|
145
|
+
```kotlin
|
|
146
|
+
FLEXIBLE // Adaptive layout for various screen sizes
|
|
147
|
+
ICON_LEFT // Icon on left, MediaView at top
|
|
148
|
+
TOP_ICON_MEDIA // Icon at top, MediaView in middle
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Sample App
|
|
154
|
+
|
|
155
|
+
Added comprehensive **Interstitial Test Suite** activity with tests for:
|
|
156
|
+
|
|
157
|
+
- **Loading**: Preload, Load with callback, isReady check
|
|
158
|
+
- **Strategies**: ON_DEMAND, ONLY_CACHE, HYBRID, FRESH_WITH_FALLBACK
|
|
159
|
+
- **Builder Options**: Basic show, force show, timeout, callbacks, everyNthTime, maxShows, minInterval, autoReload
|
|
160
|
+
- **AdManager Direct**: forceShowWithDialog, showIfReady, showByTime, showByCount
|
|
161
|
+
- **Edge Cases**: Show before load, rapid clicks (duplicate prevention), builder without preload
|
|
162
|
+
|
|
163
|
+
Access via `InterstitialActivity` > "Interstitial Test Suite" button.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Migration Guide
|
|
168
|
+
|
|
169
|
+
### From v3.3.1 to v3.3.2
|
|
170
|
+
|
|
171
|
+
This is a **backward-compatible** release. No code changes required.
|
|
172
|
+
|
|
173
|
+
**Optional Enhancements**:
|
|
174
|
+
|
|
175
|
+
#### 1. Use Counter API for everyNthTime Reset
|
|
176
|
+
|
|
177
|
+
```kotlin
|
|
178
|
+
// Reset ad counter when user purchases premium
|
|
179
|
+
fun onPremiumPurchased() {
|
|
180
|
+
AdManager.getInstance().resetAllCallCounts()
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### 2. Use New Native Templates
|
|
185
|
+
|
|
186
|
+
```kotlin
|
|
187
|
+
// Adaptive layout for various screen sizes
|
|
188
|
+
nativeTemplateView.setTemplate(NativeAdTemplate.FLEXIBLE)
|
|
189
|
+
|
|
190
|
+
// For GridView/RecyclerView grid layouts
|
|
191
|
+
nativeTemplateView.setTemplate(NativeAdTemplate.ICON_LEFT)
|
|
192
|
+
|
|
193
|
+
// For vertical scrolling lists
|
|
194
|
+
nativeTemplateView.setTemplate(NativeAdTemplate.TOP_ICON_MEDIA)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Full Changelog
|
|
200
|
+
|
|
201
|
+
### Bug Fixes
|
|
202
|
+
- Fixed InterstitialAdBuilder not assigning ad unit to AdManager on first HYBRID fetch
|
|
203
|
+
- Fixed everyNthTime counter resetting on each builder instance
|
|
204
|
+
|
|
205
|
+
### New Features
|
|
206
|
+
- Added `flexible` native template with adaptive layout
|
|
207
|
+
- Added `icon_left` native template with MediaView for GridView
|
|
208
|
+
- Added `top_icon_media` native template with MediaView
|
|
209
|
+
- Added `setAdUnitId()` to AdManager
|
|
210
|
+
- Added call counter API: `incrementCallCount()`, `getCallCount()`, `resetCallCount()`, `resetAllCallCounts()`
|
|
211
|
+
- Added Interstitial Test Suite activity to sample app
|
|
212
|
+
|
|
213
|
+
### Internal Changes
|
|
214
|
+
- Call counters moved from InterstitialAdBuilder instance to AdManager singleton
|
|
215
|
+
- `InterstitialAdBuilder.adUnit()` now calls `AdManager.getInstance().setAdUnitId()`
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Release Notes - v3.3.3
|
|
2
|
+
|
|
3
|
+
## Highlights
|
|
4
|
+
|
|
5
|
+
- **SDK-Agnostic Type Aliases**: Callbacks now use type aliases for migration compatibility between GMS SDK and Next-Gen SDK versions
|
|
6
|
+
- **Migration Ready**: Same callback signatures work on both `main` and `nextgen` branches
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## New Features
|
|
11
|
+
|
|
12
|
+
### SDK-Agnostic Type Aliases
|
|
13
|
+
|
|
14
|
+
Added type aliases that abstract SDK-specific types, enabling seamless migration between the legacy GMS SDK (main branch) and the Next-Gen GMA SDK (nextgen branch).
|
|
15
|
+
|
|
16
|
+
#### TypeAliases.kt
|
|
17
|
+
|
|
18
|
+
```kotlin
|
|
19
|
+
// Main branch (GMS SDK)
|
|
20
|
+
typealias AdKitError = com.google.android.gms.ads.AdError
|
|
21
|
+
typealias AdKitLoadError = com.google.android.gms.ads.LoadAdError
|
|
22
|
+
typealias AdKitValue = com.google.android.gms.ads.AdValue
|
|
23
|
+
|
|
24
|
+
// Nextgen branch (Next-Gen GMA SDK)
|
|
25
|
+
typealias AdKitError = com.google.android.libraries.ads.mobile.sdk.common.LoadAdError
|
|
26
|
+
typealias AdKitValue = com.google.android.libraries.ads.mobile.sdk.common.AdValue
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### Updated Callbacks
|
|
30
|
+
|
|
31
|
+
All callback interfaces now use type aliases:
|
|
32
|
+
|
|
33
|
+
```kotlin
|
|
34
|
+
// AdLoadCallback
|
|
35
|
+
open fun onFailedToLoad(error: AdKitError?) { }
|
|
36
|
+
open fun onPaidEvent(adValue: AdKitValue) { }
|
|
37
|
+
|
|
38
|
+
// AdManagerCallback
|
|
39
|
+
open fun onFailedToLoad(error: AdKitError?) { }
|
|
40
|
+
|
|
41
|
+
// OnAdFailedListener / InterstitialAdCallback
|
|
42
|
+
fun onAdFailed(error: AdKitError)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Usage
|
|
46
|
+
|
|
47
|
+
Your callback implementations work identically on both branches:
|
|
48
|
+
|
|
49
|
+
```kotlin
|
|
50
|
+
nativeTemplateView.loadNativeAd(activity, adUnitId, object : AdLoadCallback() {
|
|
51
|
+
override fun onAdLoaded() {
|
|
52
|
+
Log.d("Ads", "Ad loaded successfully")
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override fun onFailedToLoad(error: AdKitError?) { // Same on both branches
|
|
56
|
+
Log.e("Ads", "Failed to load: ${error?.message}")
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override fun onPaidEvent(adValue: AdKitValue) { // Same on both branches
|
|
60
|
+
trackRevenue(adValue.valueMicros)
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Migration Guide
|
|
68
|
+
|
|
69
|
+
### From v3.3.2 to v3.3.3
|
|
70
|
+
|
|
71
|
+
This is a **backward-compatible** release. No code changes required.
|
|
72
|
+
|
|
73
|
+
**Optional Migration**:
|
|
74
|
+
|
|
75
|
+
If you're preparing to migrate to the Next-Gen SDK version:
|
|
76
|
+
|
|
77
|
+
1. Update your callback implementations to use type aliases
|
|
78
|
+
2. Avoid direct references to SDK-specific types in your callbacks
|
|
79
|
+
3. When ready, switch to `nextgen` branch artifacts
|
|
80
|
+
|
|
81
|
+
```groovy
|
|
82
|
+
// Main branch (current)
|
|
83
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit:v3.3.3'
|
|
84
|
+
|
|
85
|
+
// Next-Gen branch (when ready to migrate)
|
|
86
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-nextgen:v4.1.1'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Next-Gen SDK Information
|
|
92
|
+
|
|
93
|
+
The `nextgen` branch offers additional features:
|
|
94
|
+
|
|
95
|
+
| Feature | Main Branch | Next-Gen Branch |
|
|
96
|
+
|---------|-------------|-----------------|
|
|
97
|
+
| SDK | GMS play-services-ads | GMA Next-Gen SDK |
|
|
98
|
+
| Ad Loading | Traditional load/show | Preloader-based |
|
|
99
|
+
| Threading | Manual dispatch | Automatic |
|
|
100
|
+
| Buffer System | N/A | Configurable |
|
|
101
|
+
|
|
102
|
+
See the [README](../../README.md#next-gen-gma-sdk-version) for more details.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Full Changelog
|
|
107
|
+
|
|
108
|
+
### New Features
|
|
109
|
+
- Added `TypeAliases.kt` with SDK-agnostic type aliases
|
|
110
|
+
- Updated `AdLoadCallback` to use `AdKitError` and `AdKitValue`
|
|
111
|
+
- Updated `AdManagerCallback` to use `AdKitError`
|
|
112
|
+
- Updated `AdCallback` interfaces to use `AdKitError`
|
|
113
|
+
|
|
114
|
+
### Documentation
|
|
115
|
+
- Added Next-Gen SDK section to README
|
|
116
|
+
- Added migration compatibility information
|