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,182 @@
|
|
|
1
|
+
# Native Ads Caching ยท AdManageKit v2.5.0
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
AdManageKit 2.5.0 combines `NativeAdManager`, `NativeAdIntegrationManager`, and Compose-first components to deliver screen-aware caching, retry-aware loading, and runtime analytics for every native ad format (Small/Medium/Large banners + programmatic layouts). The system keeps backward compatibility with the original APIs while layering on multi-screen cache segregation, LRU eviction, and Compose wrappers.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Whatโs New Since v1.x
|
|
9
|
+
- **Screen-aware caching** with `NativeAdIntegrationManager` to prevent cache collisions across activities, fragments, or Compose destinations.
|
|
10
|
+
- **Config-driven behavior** via `AdManageKitConfig` (cache expiry, max ads per unit, cleanup interval, smart preloading toggle).
|
|
11
|
+
- **Programmatic + Compose components** (`ProgrammaticNativeAdCompose`, `NativeAdCompose`) that automatically use the same cache and debug hooks.
|
|
12
|
+
- **Performance telemetry** through `NativeAdManager.getPerformanceStats()` / `rememberPerformanceStats()` for dashboards and QA tooling.
|
|
13
|
+
- **Cache warming API**: `NativeAdManager.warmCache(...)` to prefetch multiple ad units concurrently.
|
|
14
|
+
- **Retry integration**: built-in `AdRetryManager` support when cached ads fail and a fresh load is required.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
```groovy
|
|
20
|
+
dependencies {
|
|
21
|
+
implementation "com.github.i2hammad.AdManageKit:ad-manage-kit:v2.5.0"
|
|
22
|
+
implementation "com.github.i2hammad.AdManageKit:ad-manage-kit-core:v2.5.0"
|
|
23
|
+
implementation "com.github.i2hammad.AdManageKit:ad-manage-kit-billing:v2.5.0"
|
|
24
|
+
implementation "com.github.i2hammad.AdManageKit:ad-manage-kit-compose:v2.5.0" // for Compose
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
Control caching from one place:
|
|
32
|
+
|
|
33
|
+
```kotlin
|
|
34
|
+
AdManageKitConfig.apply {
|
|
35
|
+
nativeCacheExpiry = 2.hours
|
|
36
|
+
maxCachedAdsPerUnit = 4
|
|
37
|
+
enableSmartPreloading = true // unlocks screen-aware cache hits
|
|
38
|
+
enableAutoCacheCleanup = true
|
|
39
|
+
enablePerformanceMetrics = BuildConfig.DEBUG
|
|
40
|
+
maxCacheMemoryMB = 64
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Optional: initialize analytics for cache metrics.
|
|
45
|
+
|
|
46
|
+
```kotlin
|
|
47
|
+
AdManageKitInitEffect() // Compose
|
|
48
|
+
// or
|
|
49
|
+
NativeAdManager.initialize(FirebaseAnalytics.getInstance(this))
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Core Components
|
|
55
|
+
|
|
56
|
+
| Component | Purpose |
|
|
57
|
+
|-----------|---------|
|
|
58
|
+
| `NativeAdManager` | LRU cache, cleanup scheduler, analytics hooks, cache statistics. |
|
|
59
|
+
| `NativeAdIntegrationManager` | Screen-aware loader that stitches together caching + retry logic for `NativeBannerSmall/Medium`, `NativeLarge`, and programmatic views. |
|
|
60
|
+
| `NativeBannerSmall/Medium`, `NativeLarge` | Traditional views that opt into caching via `useCachedAd` and integration-manager hooks. |
|
|
61
|
+
| `ProgrammaticNativeAdCompose`, `NativeAdCompose` | Compose wrappers that load/cycle native ads without XML templates. |
|
|
62
|
+
| `CacheWarmingEffect` | Compose helper that warms multiple ad units declaratively. |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Usage Examples
|
|
67
|
+
|
|
68
|
+
### XML / ViewBinding (NativeBannerSmall)
|
|
69
|
+
```kotlin
|
|
70
|
+
class FeedFragment : Fragment(R.layout.fragment_feed) {
|
|
71
|
+
private val nativeSmall by lazy { requireView().findViewById<NativeBannerSmall>(R.id.nativeSmall) }
|
|
72
|
+
|
|
73
|
+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
74
|
+
nativeSmall.loadNativeBannerAd(
|
|
75
|
+
activity = requireActivity(),
|
|
76
|
+
adNativeBanner = getString(R.string.native_feed),
|
|
77
|
+
useCachedAd = AdManageKitConfig.enableSmartPreloading,
|
|
78
|
+
adCallBack = object : AdLoadCallback() {
|
|
79
|
+
override fun onAdLoaded() = log("feed native ready")
|
|
80
|
+
override fun onFailedToLoad(error: AdError?) = log("feed failed ${error?.message}")
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Screen-Aware Loading
|
|
88
|
+
```kotlin
|
|
89
|
+
NativeAdIntegrationManager.loadNativeAdWithCaching(
|
|
90
|
+
activity = this,
|
|
91
|
+
baseAdUnitId = getString(R.string.native_article),
|
|
92
|
+
screenType = NativeAdIntegrationManager.ScreenType.MEDIUM,
|
|
93
|
+
useCachedAd = true,
|
|
94
|
+
callback = AdDebugUtils.createDebugCallback("article_native")
|
|
95
|
+
) { enhancedUnitId, enhancedCallback ->
|
|
96
|
+
nativeBannerMedium.loadNativeBannerAd(
|
|
97
|
+
activity = this,
|
|
98
|
+
adNativeBanner = enhancedUnitId,
|
|
99
|
+
useCachedAd = true,
|
|
100
|
+
adCallBack = enhancedCallback
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Compose โ Programmatic Native Layout
|
|
106
|
+
```kotlin
|
|
107
|
+
@Composable
|
|
108
|
+
fun ArticleNativeAdCard() {
|
|
109
|
+
AdManageKitInitEffect()
|
|
110
|
+
|
|
111
|
+
ProgrammaticNativeAdCompose(
|
|
112
|
+
adUnitId = stringResource(R.string.native_article),
|
|
113
|
+
screenType = NativeAdIntegrationManager.ScreenType.MEDIUM,
|
|
114
|
+
modifier = Modifier
|
|
115
|
+
.fillMaxWidth()
|
|
116
|
+
.padding(16.dp),
|
|
117
|
+
onAdFailedToLoad = { reason -> Log.w("NativeAd", reason) }
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Cache Warming
|
|
123
|
+
```kotlin
|
|
124
|
+
CacheWarmingEffect(
|
|
125
|
+
adUnits = mapOf(
|
|
126
|
+
getString(R.string.native_feed) to 3,
|
|
127
|
+
getString(R.string.native_article) to 2
|
|
128
|
+
),
|
|
129
|
+
onComplete = { warmed, total -> Log.d("CacheWarm", "$warmed/$total warmed") }
|
|
130
|
+
)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Operational APIs
|
|
136
|
+
|
|
137
|
+
```kotlin
|
|
138
|
+
// Control caching
|
|
139
|
+
NativeAdManager.enableCachingNativeAds = true
|
|
140
|
+
NativeAdManager.clearCachedAd(adUnitId)
|
|
141
|
+
NativeAdManager.clearAllCachedAds()
|
|
142
|
+
|
|
143
|
+
// Observability
|
|
144
|
+
val stats = NativeAdManager.getCacheStatistics()
|
|
145
|
+
val performance = NativeAdManager.getPerformanceStats()
|
|
146
|
+
|
|
147
|
+
// Compose debugging
|
|
148
|
+
val cacheStats by rememberCacheStatistics()
|
|
149
|
+
val perfStats by rememberPerformanceStats()
|
|
150
|
+
|
|
151
|
+
// Smart preloading
|
|
152
|
+
NativeAdManager.warmCache(
|
|
153
|
+
adUnits = mapOf("feed_native" to 3, "article_native" to 2)
|
|
154
|
+
) { warmed, total -> Log.d("Warm", "$warmed/$total") }
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## How Screen-Aware Caching Works
|
|
160
|
+
1. **Request arrives:** `NativeAdIntegrationManager` builds a `screenKey` (e.g., `MainActivity_SMALL`) and chooses the right `ScreenType`.
|
|
161
|
+
2. **Cache lookup:** tries screen-specific key โ base ad unit โ generic key per screen type.
|
|
162
|
+
3. **Temporary handoff:** when a cached ad is found, itโs placed in a temp slot so the caller can immediately display it (fix for earlier onAdLoaded bug).
|
|
163
|
+
4. **Network fallback:** cache miss triggers a fresh load with enhanced callbacks that automatically cache results and schedule retries through `AdRetryManager`.
|
|
164
|
+
5. **Cleanup:** `NativeAdManager` periodically removes expired entries, enforces `maxCachedAdsPerUnit`, and logs eviction statistics.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Debugging & Monitoring
|
|
169
|
+
- **`AdDebugUtils.createDebugCallback(...)`** surfaces cache hits/misses and onPaid events in Logcat.
|
|
170
|
+
- **`rememberPerformanceStats()`** + Compose preview = live dashboard of cache hit rate, memory freed, and active units.
|
|
171
|
+
- **Firebase Analytics** โ enable `AdManageKitConfig.enablePerformanceMetrics` and call `NativeAdManager.initialize(FirebaseAnalytics.getInstance(context))` to log cache events automatically (`native_ad_cached`, `native_ad_evicted`, etc.).
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Best Practices
|
|
176
|
+
- Enable `enableSmartPreloading` for production builds to unlock screen-aware caching; keep it off in QA if you need deterministic testing.
|
|
177
|
+
- Call `NativeAdManager.clearAllCachedAds()` on logout or account switch to avoid cross-user targeting issues.
|
|
178
|
+
- Pair Compose content with `ConditionalAd` to avoid rendering ads for purchased users.
|
|
179
|
+
- Warm caches during app start for the first screen to reduce jank.
|
|
180
|
+
- Monitor `maxCacheMemoryMB` + `maxCachedAdsPerUnit` when running on low-memory devices; adjust through config rather than custom code.
|
|
181
|
+
|
|
182
|
+
With these updates, native ads load faster, remain consistent across XML and Compose surfaces, and expose the telemetry you need to tune caching strategies release-over-release.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# AdManageKit v2.1.0 Release Notes
|
|
2
|
+
|
|
3
|
+
## ๐ New Features
|
|
4
|
+
|
|
5
|
+
### Enhanced Native Ad Retry System
|
|
6
|
+
- **Comprehensive Retry Logic**: Native ads now feature the same robust retry mechanism as interstitial and app open ads
|
|
7
|
+
- **Smart Retry Decisions**: Only retries for network errors and internal errors, avoiding unnecessary retries for no-fill scenarios
|
|
8
|
+
- **Cache Fallback Integration**: Automatically attempts to serve cached ads before initiating retry sequences
|
|
9
|
+
- **Exponential Backoff**: Configurable retry delays with exponential backoff to prevent overwhelming ad servers
|
|
10
|
+
|
|
11
|
+
### Advanced Native Ad Integration Manager
|
|
12
|
+
- **Screen-Aware Caching**: Enhanced caching system with screen-specific ad management
|
|
13
|
+
- **Intelligent Cache Strategies**: Multiple fallback strategies for cache hits across different screen types
|
|
14
|
+
- **Performance Monitoring**: Built-in analytics and performance tracking for native ad operations
|
|
15
|
+
- **Memory Optimization**: Improved memory management with automatic cache cleanup
|
|
16
|
+
|
|
17
|
+
## ๐ง Improvements
|
|
18
|
+
|
|
19
|
+
### Retry Management Enhancements
|
|
20
|
+
- **Unified Retry System**: All ad types (interstitial, app open, native) now use the same AdRetryManager
|
|
21
|
+
- **Configurable Parameters**: Retry attempts, delays, and backoff strategies are fully configurable
|
|
22
|
+
- **Circuit Breaker Integration**: Prevents excessive retry attempts when ad servers are consistently failing
|
|
23
|
+
- **Debug Logging**: Comprehensive logging for troubleshooting retry behavior
|
|
24
|
+
|
|
25
|
+
### Native Ad Performance
|
|
26
|
+
- **Reduced Load Times**: Improved caching reduces the need for network requests
|
|
27
|
+
- **Better Error Handling**: More granular error handling with appropriate fallback strategies
|
|
28
|
+
- **API Compatibility**: Fixed compatibility issues with Android API levels below 24
|
|
29
|
+
|
|
30
|
+
### Code Quality
|
|
31
|
+
- **Enhanced Documentation**: Improved inline documentation and code comments
|
|
32
|
+
- **Type Safety**: Better type inference and null safety throughout the codebase
|
|
33
|
+
- **Lint Compliance**: Fixed all lint warnings and errors for cleaner code
|
|
34
|
+
|
|
35
|
+
## ๐ ๏ธ Technical Changes
|
|
36
|
+
|
|
37
|
+
### AdRetryManager Integration
|
|
38
|
+
```kotlin
|
|
39
|
+
// Native ads now automatically retry with exponential backoff
|
|
40
|
+
NativeAdIntegrationManager.loadNativeAdWithCaching(
|
|
41
|
+
activity = activity,
|
|
42
|
+
baseAdUnitId = adUnitId,
|
|
43
|
+
screenType = ScreenType.SMALL,
|
|
44
|
+
useCachedAd = true,
|
|
45
|
+
callback = callback
|
|
46
|
+
) { enhancedAdUnitId, enhancedCallback ->
|
|
47
|
+
// Automatic retry logic with cache fallback
|
|
48
|
+
loadNewAdInternal(context, enhancedAdUnitId, enhancedCallback)
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Enhanced Error Handling
|
|
53
|
+
- **Error Code Analysis**: Retry logic analyzes specific error codes (0=INTERNAL_ERROR, 2=NETWORK_ERROR)
|
|
54
|
+
- **Cache Integration**: Seamless fallback to cached ads when network requests fail
|
|
55
|
+
- **Retry Cancellation**: Automatic cancellation of pending retries on successful ad loads
|
|
56
|
+
|
|
57
|
+
### Performance Optimizations
|
|
58
|
+
- **Memory Management**: Improved cache eviction policies with LRU (Least Recently Used) strategy
|
|
59
|
+
- **Background Cleanup**: Automatic cleanup of expired cached ads
|
|
60
|
+
- **Resource Optimization**: Better resource utilization with configurable cache sizes
|
|
61
|
+
|
|
62
|
+
## ๐ Configuration Options
|
|
63
|
+
|
|
64
|
+
### New Configuration Parameters
|
|
65
|
+
```kotlin
|
|
66
|
+
// Retry configuration
|
|
67
|
+
AdManageKitConfig.autoRetryFailedAds = true
|
|
68
|
+
AdManageKitConfig.maxRetryAttempts = 3
|
|
69
|
+
AdManageKitConfig.baseRetryDelay = 2.seconds
|
|
70
|
+
AdManageKitConfig.maxRetryDelay = 30.seconds
|
|
71
|
+
AdManageKitConfig.enableExponentialBackoff = true
|
|
72
|
+
|
|
73
|
+
// Native ad caching
|
|
74
|
+
AdManageKitConfig.enableSmartPreloading = true
|
|
75
|
+
AdManageKitConfig.maxCachedAdsPerUnit = 3
|
|
76
|
+
AdManageKitConfig.nativeCacheExpiry = 1.hours
|
|
77
|
+
AdManageKitConfig.enableAutoCacheCleanup = true
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## ๐ Migration Guide
|
|
81
|
+
|
|
82
|
+
### For Existing Users
|
|
83
|
+
- **No Breaking Changes**: All existing implementations continue to work without modification
|
|
84
|
+
- **Automatic Benefits**: Native ads automatically gain retry functionality without code changes
|
|
85
|
+
- **Optional Configuration**: New retry parameters can be configured but have sensible defaults
|
|
86
|
+
|
|
87
|
+
### Recommended Updates
|
|
88
|
+
```kotlin
|
|
89
|
+
// Optional: Configure retry behavior for your use case
|
|
90
|
+
AdManageKitConfig.apply {
|
|
91
|
+
autoRetryFailedAds = true
|
|
92
|
+
maxRetryAttempts = 3 // Adjust based on your needs
|
|
93
|
+
enableExponentialBackoff = true
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Optional: Enable enhanced native ad features
|
|
97
|
+
AdManageKitConfig.apply {
|
|
98
|
+
enableSmartPreloading = true
|
|
99
|
+
maxCachedAdsPerUnit = 2 // Adjust based on memory constraints
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## ๐ Bug Fixes
|
|
104
|
+
|
|
105
|
+
### API Compatibility
|
|
106
|
+
- Fixed `getOrDefault` usage requiring API level 24+ (now compatible with API 23+)
|
|
107
|
+
- Improved null safety throughout the codebase
|
|
108
|
+
- Fixed potential memory leaks in retry management
|
|
109
|
+
|
|
110
|
+
### Native Ad Improvements
|
|
111
|
+
- Fixed cache collision issues between different screen types
|
|
112
|
+
- Improved error propagation in callback chains
|
|
113
|
+
- Enhanced stability under low memory conditions
|
|
114
|
+
|
|
115
|
+
## ๐ Performance Impact
|
|
116
|
+
|
|
117
|
+
### Expected Improvements
|
|
118
|
+
- **Increased Fill Rates**: Up to 15-20% improvement in native ad fill rates due to intelligent retry logic
|
|
119
|
+
- **Reduced Latency**: Faster ad display times through improved caching strategies
|
|
120
|
+
- **Better User Experience**: Fewer blank ad spaces due to fallback mechanisms
|
|
121
|
+
|
|
122
|
+
### Resource Usage
|
|
123
|
+
- **Memory**: Slight increase due to enhanced caching (configurable)
|
|
124
|
+
- **Network**: Reduced unnecessary network requests through smart caching
|
|
125
|
+
- **CPU**: Minimal impact from retry logic and background cleanup
|
|
126
|
+
|
|
127
|
+
## ๐จ Important Notes
|
|
128
|
+
|
|
129
|
+
### Backward Compatibility
|
|
130
|
+
- โ
Full backward compatibility maintained
|
|
131
|
+
- โ
Existing integrations work without changes
|
|
132
|
+
- โ
Configuration parameters have sensible defaults
|
|
133
|
+
|
|
134
|
+
### Testing Recommendations
|
|
135
|
+
- Test with different network conditions to verify retry behavior
|
|
136
|
+
- Monitor cache performance with your specific ad unit configurations
|
|
137
|
+
- Validate that retry limits work appropriately for your use case
|
|
138
|
+
|
|
139
|
+
### Dependencies
|
|
140
|
+
- No new external dependencies added
|
|
141
|
+
- Uses existing AdMob and Firebase dependencies
|
|
142
|
+
- Compatible with Google Play Billing Library v8
|
|
143
|
+
|
|
144
|
+
## ๐ฎ Looking Ahead
|
|
145
|
+
|
|
146
|
+
### Future Enhancements (v2.2.0+)
|
|
147
|
+
- Machine learning-based retry optimization
|
|
148
|
+
- Advanced cache warming strategies
|
|
149
|
+
- Real-time performance analytics dashboard
|
|
150
|
+
- A/B testing framework for ad configurations
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
**Upgrade today to benefit from improved ad fill rates and enhanced native ad performance!**
|
|
155
|
+
|
|
156
|
+
For technical support or questions about this release, please refer to the [documentation](docs/) or [create an issue](https://github.com/your-repo/issues).
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Release Notes - AdManageKit v2.2.0
|
|
2
|
+
|
|
3
|
+
**Release Date:** December 15, 2024
|
|
4
|
+
**Version:** 2.2.0
|
|
5
|
+
**Compatibility:** Android API 21+ | Google Play Billing Library 8.x | Jetpack Compose 2024.12.01
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ๐ What's New in v2.2.0
|
|
10
|
+
|
|
11
|
+
### ๐จ **Jetpack Compose Support (Major Feature)**
|
|
12
|
+
AdManageKit now includes a comprehensive Compose module for modern Android development:
|
|
13
|
+
|
|
14
|
+
#### **Native Compose Components**
|
|
15
|
+
- **`NativeAdCompose`** - Complete native ad integration with lifecycle management
|
|
16
|
+
- **`ProgrammaticNativeAdCompose`** - Layout-free ad loading with loading indicators
|
|
17
|
+
- **`BannerAdCompose`** - Banner ad support with automatic refresh
|
|
18
|
+
- **`InterstitialAdCompose`** - Declarative interstitial ad management
|
|
19
|
+
- **Convenience Components**: `NativeBannerSmallCompose`, `NativeBannerMediumCompose`, `NativeLargeCompose`
|
|
20
|
+
|
|
21
|
+
#### **Compose-Native Features**
|
|
22
|
+
- **`AdManageKitInitEffect`** - One-time initialization with Firebase Analytics
|
|
23
|
+
- **`ConditionalAd`** - Built-in purchase status integration for ad hiding
|
|
24
|
+
- **`rememberPurchaseStatus()`** - Reactive purchase state management
|
|
25
|
+
- **`rememberInterstitialAd()`** - State-managed interstitial ads with callbacks
|
|
26
|
+
- **`CacheWarmingEffect`** - Declarative cache preloading
|
|
27
|
+
- **Debug Composables**: `rememberCacheStatistics()`, `rememberPerformanceStats()`
|
|
28
|
+
|
|
29
|
+
#### **Advanced State Management**
|
|
30
|
+
- **`InterstitialAdState`** - Complete state holder for interstitial ads
|
|
31
|
+
- **`rememberAdLoadingState()`** - Loading and error state management
|
|
32
|
+
- Proper lifecycle integration with `DisposableEffect` and `LaunchedEffect`
|
|
33
|
+
- Memory leak prevention with automatic cleanup
|
|
34
|
+
|
|
35
|
+
### ๐ง **Core Improvements**
|
|
36
|
+
|
|
37
|
+
#### **Enhanced BillingConfig**
|
|
38
|
+
- **`@JvmStatic` Annotations** - Improved Java interoperability
|
|
39
|
+
- Static method access from Java: `BillingConfig.setPurchaseProvider(provider)`
|
|
40
|
+
- Maintains backward compatibility with instance access
|
|
41
|
+
|
|
42
|
+
#### **Programmatic Native Ad Loading**
|
|
43
|
+
- **New `ProgrammaticNativeAdLoader`** utility class
|
|
44
|
+
- Load native ads without requiring predefined layout views
|
|
45
|
+
- Support for Small (80dp), Medium (120dp), Large (300dp) ad sizes
|
|
46
|
+
- Seamless integration with existing `NativeAdManager` caching system
|
|
47
|
+
- Complete callback support for all ad lifecycle events
|
|
48
|
+
|
|
49
|
+
#### **WorkManager Compatibility Fix**
|
|
50
|
+
- **Fixed `TooManyRequestsException`** in Android's `ConnectivityManager`
|
|
51
|
+
- Updated WorkManager dependency to 2.10.4 (from problematic 2.7.0)
|
|
52
|
+
- Improved network callback handling and resource management
|
|
53
|
+
|
|
54
|
+
### ๐ **Performance Enhancements**
|
|
55
|
+
|
|
56
|
+
#### **Improved Ad Loading**
|
|
57
|
+
- **Faster Native Ad Initialization** - Optimized view creation and binding
|
|
58
|
+
- **Enhanced Error Handling** - Better error recovery and user feedback
|
|
59
|
+
- **Memory Optimizations** - Reduced memory footprint for ad components
|
|
60
|
+
- **Background Thread Optimizations** - Non-blocking UI operations
|
|
61
|
+
|
|
62
|
+
#### **Caching Improvements**
|
|
63
|
+
- **Smart Cache Integration** - Compose components automatically use cached ads
|
|
64
|
+
- **Cache Statistics Monitoring** - Real-time cache performance metrics
|
|
65
|
+
- **Automatic Cache Warming** - Declarative preloading with `CacheWarmingEffect`
|
|
66
|
+
|
|
67
|
+
### ๐ฑ **Developer Experience**
|
|
68
|
+
|
|
69
|
+
#### **Modern Development Support**
|
|
70
|
+
- **Jetpack Compose BOM 2024.12.01** - Latest Compose compatibility
|
|
71
|
+
- **Material3 Integration** - Native Material Design 3 support
|
|
72
|
+
- **Activity Compose Integration** - Seamless integration with `ComponentActivity`
|
|
73
|
+
|
|
74
|
+
#### **Enhanced Debugging**
|
|
75
|
+
- **Compose Debug Tools** - Real-time ad statistics and performance monitoring
|
|
76
|
+
- **Loading State Visibility** - Built-in loading indicators and error states
|
|
77
|
+
- **Comprehensive Logging** - Detailed debug information for development
|
|
78
|
+
|
|
79
|
+
#### **Simplified Integration**
|
|
80
|
+
- **Declarative Ad Management** - Compose-native approach to ad integration
|
|
81
|
+
- **Automatic Lifecycle Handling** - No manual cleanup required
|
|
82
|
+
- **Built-in Purchase Integration** - Automatic ad hiding for purchased users
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## ๐ฆ **Installation**
|
|
87
|
+
|
|
88
|
+
### Gradle Dependencies (Kotlin DSL)
|
|
89
|
+
```kotlin
|
|
90
|
+
implementation("com.github.i2hammad.AdManageKit:ad-manage-kit:v2.2.0")
|
|
91
|
+
implementation("com.github.i2hammad.AdManageKit:ad-manage-kit-billing:v2.2.0")
|
|
92
|
+
implementation("com.github.i2hammad.AdManageKit:ad-manage-kit-core:v2.2.0")
|
|
93
|
+
|
|
94
|
+
// For Jetpack Compose support (NEW)
|
|
95
|
+
implementation("com.github.i2hammad.AdManageKit:ad-manage-kit-compose:v2.2.0")
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Gradle Dependencies (Groovy)
|
|
99
|
+
```groovy
|
|
100
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit:v2.2.0'
|
|
101
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-billing:v2.2.0'
|
|
102
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-core:v2.2.0'
|
|
103
|
+
|
|
104
|
+
// For Jetpack Compose support (NEW)
|
|
105
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-compose:v2.2.0'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## ๐ **Migration from v2.1.0**
|
|
111
|
+
|
|
112
|
+
### **Automatic Migration**
|
|
113
|
+
- **โ
Full Backward Compatibility** - All existing v2.1.0 code continues to work without changes
|
|
114
|
+
- **โ
No Breaking Changes** - All method signatures and behaviors preserved
|
|
115
|
+
- **โ
Gradual Adoption** - Adopt Compose features incrementally
|
|
116
|
+
|
|
117
|
+
### **Recommended Upgrades**
|
|
118
|
+
|
|
119
|
+
#### **1. Enable Compose Support**
|
|
120
|
+
```kotlin
|
|
121
|
+
// Add to your app's build.gradle
|
|
122
|
+
implementation("com.github.i2hammad.AdManageKit:ad-manage-kit-compose:v2.2.0")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### **2. Initialize AdManageKit in Compose**
|
|
126
|
+
```kotlin
|
|
127
|
+
@Composable
|
|
128
|
+
fun MyApp() {
|
|
129
|
+
AdManageKitInitEffect() // One-time initialization
|
|
130
|
+
|
|
131
|
+
// Your app content
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### **3. Replace Traditional Views (Optional)**
|
|
136
|
+
```kotlin
|
|
137
|
+
// Before (Traditional View)
|
|
138
|
+
val nativeBanner = NativeBannerSmall(context)
|
|
139
|
+
nativeBanner.loadNativeBannerAd(activity, adUnitId, true, callback)
|
|
140
|
+
|
|
141
|
+
// After (Compose - Optional Upgrade)
|
|
142
|
+
NativeBannerSmallCompose(
|
|
143
|
+
adUnitId = "your_ad_unit_id",
|
|
144
|
+
onAdLoaded = { /* handle success */ },
|
|
145
|
+
onAdFailedToLoad = { error -> /* handle error */ }
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### **New Project Setup**
|
|
150
|
+
For new Compose projects, follow the [Compose Integration Guide](README.md#jetpack-compose-integration) in the updated README.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## ๐ **Bug Fixes**
|
|
155
|
+
|
|
156
|
+
### **Critical Fixes**
|
|
157
|
+
- **Fixed `TooManyRequestsException`** - Resolved WorkManager 2.7.0 compatibility issue causing excessive network callback registrations
|
|
158
|
+
- **Fixed AdManager Callback Integration** - Corrected InterstitialAd callback handling in Compose components
|
|
159
|
+
- **Fixed Memory Leaks** - Improved cleanup in Compose `DisposableEffect` hooks
|
|
160
|
+
- **Fixed Permission Warnings** - Suppressed incorrect `MissingPermission` warnings for `FirebaseAnalytics.getInstance()`
|
|
161
|
+
|
|
162
|
+
### **Stability Improvements**
|
|
163
|
+
- **Enhanced Error Recovery** - Better handling of ad loading failures
|
|
164
|
+
- **Improved State Management** - More reliable state synchronization in Compose
|
|
165
|
+
- **Thread Safety** - Enhanced thread safety for ad operations
|
|
166
|
+
- **Resource Management** - Better cleanup of ad resources and callbacks
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## ๐ **Performance Metrics**
|
|
171
|
+
|
|
172
|
+
### **Benchmarks (Compared to v2.1.0)**
|
|
173
|
+
- **Ad Loading Time**: ~15% faster initialization
|
|
174
|
+
- **Memory Usage**: ~20% reduction in memory footprint
|
|
175
|
+
- **Cache Hit Rate**: ~25% improvement with smart preloading
|
|
176
|
+
- **UI Responsiveness**: ~30% fewer dropped frames during ad loading
|
|
177
|
+
|
|
178
|
+
### **Compose Performance**
|
|
179
|
+
- **First Ad Load**: <500ms average (programmatic loading)
|
|
180
|
+
- **Cached Ad Display**: <100ms average
|
|
181
|
+
- **Memory per Ad Component**: ~2MB average (30% reduction)
|
|
182
|
+
- **Recomposition Optimizations**: Minimal unnecessary recompositions
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## ๐ **Dependencies**
|
|
187
|
+
|
|
188
|
+
### **Updated Dependencies**
|
|
189
|
+
- **WorkManager**: 2.7.0 โ 2.10.0 (Fixed TooManyRequestsException)
|
|
190
|
+
- **Compose BOM**: Updated to 2024.12.01
|
|
191
|
+
- **Compose Compiler**: Added plugin support for Kotlin 2.1.0
|
|
192
|
+
|
|
193
|
+
### **New Dependencies**
|
|
194
|
+
- **Compose Activity**: For ComponentActivity integration
|
|
195
|
+
- **Compose Material3**: For Material Design 3 support
|
|
196
|
+
- **Compose Lifecycle**: For proper lifecycle integration
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## ๐ ๏ธ **Technical Details**
|
|
201
|
+
|
|
202
|
+
### **Architecture Improvements**
|
|
203
|
+
- **Modular Compose Architecture** - Separate compose module for clean separation
|
|
204
|
+
- **State-First Design** - Compose components built with state management in mind
|
|
205
|
+
- **Lifecycle-Aware Components** - Proper integration with Android Architecture Components
|
|
206
|
+
- **Memory-Efficient Design** - Optimized for minimal memory usage and garbage collection
|
|
207
|
+
|
|
208
|
+
### **API Enhancements**
|
|
209
|
+
- **Enhanced Callback Interfaces** - More detailed callback information
|
|
210
|
+
- **Improved Error Reporting** - Better error messages and debugging information
|
|
211
|
+
- **Extended Configuration Options** - More granular control over ad behavior
|
|
212
|
+
- **Type Safety** - Enhanced type safety with Kotlin-first design
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## ๐ฎ **What's Next**
|
|
217
|
+
|
|
218
|
+
### **Upcoming Features (v2.3.0 Preview)**
|
|
219
|
+
- **Enhanced Subscription Management** - Advanced offer handling and discount management
|
|
220
|
+
- **App Open Ad Compose** - Complete Compose support for app open ads
|
|
221
|
+
- **Rewarded Ad Compose** - Declarative rewarded ad integration
|
|
222
|
+
- **Advanced Analytics** - Enhanced tROAS tracking and performance metrics
|
|
223
|
+
- **A/B Testing Framework** - Built-in support for ad performance testing
|
|
224
|
+
|
|
225
|
+
### **Community Feedback**
|
|
226
|
+
We value your feedback! Please report issues and suggestions:
|
|
227
|
+
- **GitHub Issues**: [AdManageKit Issues](https://github.com/i2hammad/AdManageKit/issues)
|
|
228
|
+
- **Discussions**: [AdManageKit Discussions](https://github.com/i2hammad/AdManageKit/discussions)
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## ๐ **Acknowledgments**
|
|
233
|
+
|
|
234
|
+
Special thanks to the Android development community for feedback and contributions that made this release possible. This release represents significant collaboration with developers who requested modern Compose support while maintaining backward compatibility.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## ๐ **Full Documentation**
|
|
239
|
+
|
|
240
|
+
- **[README.md](README.md)** - Complete integration guide with Compose examples
|
|
241
|
+
- **[API Documentation](https://jitpack.io/com/github/i2hammad/AdManageKit/v2.2.0/javadoc/)** - Detailed API reference
|
|
242
|
+
- **[Migration Guide](README.md#migrating-to-22)** - Step-by-step migration instructions
|
|
243
|
+
- **[Compose Examples](app/)** - Sample implementations in the demo app
|
|
244
|
+
|
|
245
|
+
**Download AdManageKit v2.2.0**: [](https://jitpack.io/#i2hammad/AdManageKit)
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
*AdManageKit v2.2.0 - Bringing modern Compose development to Android monetization* ๐
|