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.
Files changed (74) hide show
  1. package/content/README.md +851 -0
  2. package/content/docs/AD_FREQUENCY_CONTROL.md +450 -0
  3. package/content/docs/AD_LOADING_STRATEGIES.md +369 -0
  4. package/content/docs/API_REFERENCE.md +734 -0
  5. package/content/docs/APP_PURCHASE_GUIDE.md +704 -0
  6. package/content/docs/BANNER_AD_IMPROVEMENTS.md +325 -0
  7. package/content/docs/COMPOSE_INTEGRATION.md +477 -0
  8. package/content/docs/CONFIGURATION_USAGE.md +168 -0
  9. package/content/docs/INTERSTITIAL_BUILDER_GUIDE.md +518 -0
  10. package/content/docs/JAVA_USAGE_GUIDE.md +785 -0
  11. package/content/docs/LOADING_STRATEGY_EXAMPLES.md +463 -0
  12. package/content/docs/NATIVE_AD_MANAGER_ENHANCEMENTS.md +347 -0
  13. package/content/docs/NATIVE_AD_PRELOADING.md +467 -0
  14. package/content/docs/NATIVE_TEMPLATE_VIEW.md +413 -0
  15. package/content/docs/app-open-ads.md +412 -0
  16. package/content/docs/interstitial-ads.md +269 -0
  17. package/content/docs/native-ads-caching.md +182 -0
  18. package/content/docs/release-notes/RELEASE_NOTES_v2.1.0.md +156 -0
  19. package/content/docs/release-notes/RELEASE_NOTES_v2.2.0.md +248 -0
  20. package/content/docs/release-notes/RELEASE_NOTES_v2.3.0.md +280 -0
  21. package/content/docs/release-notes/RELEASE_NOTES_v2.5.0.md +73 -0
  22. package/content/docs/release-notes/RELEASE_NOTES_v2.6.0.md +265 -0
  23. package/content/docs/release-notes/RELEASE_NOTES_v2.7.0.md +168 -0
  24. package/content/docs/release-notes/RELEASE_NOTES_v2.8.0.md +153 -0
  25. package/content/docs/release-notes/RELEASE_NOTES_v2.9.0.md +479 -0
  26. package/content/docs/release-notes/RELEASE_NOTES_v3.0.0.md +343 -0
  27. package/content/docs/release-notes/RELEASE_NOTES_v3.1.0.md +131 -0
  28. package/content/docs/release-notes/RELEASE_NOTES_v3.3.0.md +252 -0
  29. package/content/docs/release-notes/RELEASE_NOTES_v3.3.2.md +215 -0
  30. package/content/docs/release-notes/RELEASE_NOTES_v3.3.3.md +116 -0
  31. package/content/docs/release-notes/RELEASE_NOTES_v3.3.4.md +142 -0
  32. package/content/docs/release-notes/RELEASE_NOTES_v3.3.5.md +94 -0
  33. package/content/docs/rewarded-ads.md +623 -0
  34. package/content/wiki/Ad-Loading-Strategies.md +209 -0
  35. package/content/wiki/App-Open-Ads.md +189 -0
  36. package/content/wiki/Banner-Ads.md +133 -0
  37. package/content/wiki/Billing-Integration.md +69 -0
  38. package/content/wiki/Configuration.md +252 -0
  39. package/content/wiki/Consumable-Products.md +166 -0
  40. package/content/wiki/Home.md +144 -0
  41. package/content/wiki/Interstitial-Ads.md +313 -0
  42. package/content/wiki/Jetpack-Compose.md +270 -0
  43. package/content/wiki/NativeAdManager.md +220 -0
  44. package/content/wiki/Purchase-Categories.md +94 -0
  45. package/content/wiki/Rewarded-Ads.md +420 -0
  46. package/content/wiki/Subscription-Upgrades.md +278 -0
  47. package/content/wiki/Subscriptions.md +368 -0
  48. package/content/wiki/_Footer.md +3 -0
  49. package/content/wiki/_Sidebar.md +18 -0
  50. package/dist/index.d.ts +2 -0
  51. package/dist/index.js +6 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/server.d.ts +1 -0
  54. package/dist/server.js +18 -0
  55. package/dist/server.js.map +1 -0
  56. package/dist/tools/code-generation.d.ts +2 -0
  57. package/dist/tools/code-generation.js +264 -0
  58. package/dist/tools/code-generation.js.map +1 -0
  59. package/dist/tools/documentation.d.ts +2 -0
  60. package/dist/tools/documentation.js +202 -0
  61. package/dist/tools/documentation.js.map +1 -0
  62. package/dist/types.d.ts +18 -0
  63. package/dist/types.js +83 -0
  64. package/dist/types.js.map +1 -0
  65. package/dist/utils/doc-loader.d.ts +17 -0
  66. package/dist/utils/doc-loader.js +245 -0
  67. package/dist/utils/doc-loader.js.map +1 -0
  68. package/dist/utils/search.d.ts +2 -0
  69. package/dist/utils/search.js +62 -0
  70. package/dist/utils/search.js.map +1 -0
  71. package/dist/utils/templates.d.ts +60 -0
  72. package/dist/utils/templates.js +793 -0
  73. package/dist/utils/templates.js.map +1 -0
  74. package/package.json +51 -0
@@ -0,0 +1,220 @@
1
+ # Native Ads - AdManageKit v2.8.0
2
+
3
+ ## Overview
4
+
5
+ AdManageKit provides comprehensive native ad support with caching, multiple formats, and the new `NativeTemplateView` (v2.6.0+). Native ads blend seamlessly with your app's content while maximizing engagement.
6
+
7
+ **Library Version**: v2.8.0
8
+
9
+ ## Features
10
+
11
+ - **Multiple Formats**: Small, Medium, Large, and 17+ template styles
12
+ - **Smart Caching**: Per-unit caching with 1-hour expiration
13
+ - **Loading Strategies**: ON_DEMAND, ONLY_CACHE, HYBRID
14
+ - **Shimmer Loading**: Beautiful loading placeholders
15
+ - **NativeTemplateView**: Unified component with 17 templates (v2.6.0+)
16
+ - **Video Support**: All templates support video ads
17
+
18
+ ## Installation
19
+
20
+ ```groovy
21
+ dependencies {
22
+ implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit:v2.8.0'
23
+ implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-core:v2.8.0'
24
+ }
25
+ ```
26
+
27
+ ## Native Ad Formats
28
+
29
+ ### Traditional Views
30
+
31
+ | Class | Best For |
32
+ |-------|----------|
33
+ | `NativeBannerSmall` | Compact spaces, lists |
34
+ | `NativeBannerMedium` | General content areas |
35
+ | `NativeLarge` | Featured placements |
36
+
37
+ ### NativeTemplateView (v2.6.0+)
38
+
39
+ 17 template styles in one unified component:
40
+
41
+ | Template | Best For |
42
+ |----------|----------|
43
+ | `card_modern` | General use |
44
+ | `material3` | Material 3 apps |
45
+ | `minimal` | Content-focused |
46
+ | `compact_horizontal` | Lists |
47
+ | `list_item` | RecyclerView items |
48
+ | `magazine` | News/blog apps |
49
+ | `video_small/medium/large` | Video content |
50
+ | `video_square/vertical/fullscreen` | Social feeds |
51
+ | `featured`, `grid_card`, `overlay_dark`, `story_style` | Various layouts |
52
+
53
+ ## Usage
54
+
55
+ ### NativeTemplateView (Recommended)
56
+
57
+ **XML:**
58
+ ```xml
59
+ <com.i2hammad.admanagekit.admob.NativeTemplateView
60
+ android:id="@+id/nativeTemplateView"
61
+ android:layout_width="match_parent"
62
+ android:layout_height="wrap_content"
63
+ app:adTemplate="material3" />
64
+ ```
65
+
66
+ **Kotlin:**
67
+ ```kotlin
68
+ // Load with default template
69
+ nativeTemplateView.loadNativeAd(activity, "ca-app-pub-xxx/yyy")
70
+
71
+ // Change template
72
+ nativeTemplateView.setTemplate(NativeAdTemplate.MAGAZINE)
73
+ nativeTemplateView.loadNativeAd(activity, "ca-app-pub-xxx/yyy")
74
+
75
+ // With callback
76
+ nativeTemplateView.loadNativeAd(activity, adUnitId, object : AdLoadCallback() {
77
+ override fun onAdLoaded() { /* success */ }
78
+ override fun onFailedToLoad(error: AdError?) { /* error */ }
79
+ })
80
+
81
+ // With strategy override
82
+ nativeTemplateView.loadNativeAd(activity, adUnitId, callback, AdLoadingStrategy.ONLY_CACHE)
83
+ ```
84
+
85
+ ### Traditional Views
86
+
87
+ ```kotlin
88
+ // NativeBannerSmall
89
+ val nativeBannerSmall = NativeBannerSmall(context)
90
+ nativeBannerSmall.loadNativeBannerAd(activity, "ca-app-pub-xxx/yyy")
91
+
92
+ // NativeBannerMedium
93
+ val nativeBannerMedium = NativeBannerMedium(context)
94
+ nativeBannerMedium.loadNativeBannerAd(activity, "ca-app-pub-xxx/yyy", useCachedAd = true)
95
+
96
+ // NativeLarge
97
+ val nativeLarge = NativeLarge(context)
98
+ nativeLarge.loadNativeAds(activity, "ca-app-pub-xxx/yyy")
99
+ ```
100
+
101
+ ## Caching System
102
+
103
+ ### Configuration
104
+
105
+ ```kotlin
106
+ AdManageKitConfig.apply {
107
+ nativeLoadingStrategy = AdLoadingStrategy.HYBRID
108
+ nativeCacheExpiry = 1.hours
109
+ maxCachedAdsPerUnit = 3
110
+ enableLRUEviction = true
111
+ maxCacheMemoryMB = 200
112
+ }
113
+ ```
114
+
115
+ ### NativeAdManager API
116
+
117
+ ```kotlin
118
+ // Enable/disable caching globally
119
+ NativeAdManager.enableCachingNativeAds = true
120
+
121
+ // Clear cache for specific unit
122
+ NativeAdManager.clearCachedAd("ad-unit-id")
123
+
124
+ // Clear all cached ads
125
+ NativeAdManager.clearAllCachedAds()
126
+
127
+ // Get cached ad
128
+ val cachedAd = NativeAdManager.getCachedNativeAd("ad-unit-id")
129
+ ```
130
+
131
+ ### Cache Behavior
132
+
133
+ - **Per-Unit Caching**: Each ad unit has its own cache
134
+ - **1-Hour Expiration**: Cached ads expire after 1 hour
135
+ - **Automatic Cleanup**: Expired ads are automatically destroyed
136
+ - **Memory Management**: LRU eviction when cache is full
137
+
138
+ ## Loading Strategies
139
+
140
+ | Strategy | Behavior |
141
+ |----------|----------|
142
+ | ON_DEMAND | Show shimmer, fetch fresh ad |
143
+ | ONLY_CACHE | Show cached or hide container |
144
+ | HYBRID | Show cached if ready, fetch with shimmer otherwise |
145
+
146
+ ```kotlin
147
+ // Global strategy
148
+ AdManageKitConfig.nativeLoadingStrategy = AdLoadingStrategy.HYBRID
149
+
150
+ // Per-call override
151
+ nativeTemplateView.loadNativeAd(activity, adUnitId, callback, AdLoadingStrategy.ONLY_CACHE)
152
+ ```
153
+
154
+ ### Strategy Flow
155
+
156
+ **ON_DEMAND/HYBRID (not cached):**
157
+ ```
158
+ Load → Show shimmer → Fetch ad →
159
+ Success: Show ad, hide shimmer
160
+ Failure: Hide container
161
+ ```
162
+
163
+ **ONLY_CACHE:**
164
+ ```
165
+ Load → Check cache →
166
+ Cached: Show immediately
167
+ Not cached: Hide container
168
+ ```
169
+
170
+ ## API Reference
171
+
172
+ ### NativeTemplateView Methods
173
+
174
+ | Method | Description |
175
+ |--------|-------------|
176
+ | `setTemplate(template)` | Set template style |
177
+ | `loadNativeAd(activity, adUnitId)` | Load with defaults |
178
+ | `loadNativeAd(activity, adUnitId, callback)` | Load with callback |
179
+ | `loadNativeAd(activity, adUnitId, callback, strategy)` | Load with strategy |
180
+
181
+ ### NativeAdManager Methods
182
+
183
+ | Method | Description |
184
+ |--------|-------------|
185
+ | `enableCachingNativeAds` | Enable/disable caching |
186
+ | `getCachedNativeAd(adUnitId)` | Get cached ad |
187
+ | `setCachedNativeAd(adUnitId, ad)` | Store ad in cache |
188
+ | `clearCachedAd(adUnitId)` | Clear specific cache |
189
+ | `clearAllCachedAds()` | Clear all caches |
190
+
191
+ ### AdManageKitConfig Settings
192
+
193
+ | Setting | Description | Default |
194
+ |---------|-------------|---------|
195
+ | `nativeLoadingStrategy` | Loading strategy | HYBRID |
196
+ | `nativeCacheExpiry` | Cache expiration | 1 hour |
197
+ | `maxCachedAdsPerUnit` | Ads per unit | 3 |
198
+ | `maxCacheMemoryMB` | Max cache memory | 200 MB |
199
+ | `enableLRUEviction` | LRU eviction | true |
200
+ | `enableAutoCacheCleanup` | Auto cleanup | true |
201
+
202
+ ## Best Practices
203
+
204
+ 1. **Use NativeTemplateView** - Unified API with 17 templates
205
+ 2. **Enable Caching** - Improves load times and reduces requests
206
+ 3. **Use HYBRID Strategy** - Best balance for most cases
207
+ 4. **Clear on Destroy** - Call `clearAllCachedAds()` in `onDestroy()`
208
+ 5. **Match Template to Context** - Use appropriate template for placement
209
+
210
+ ## Troubleshooting
211
+
212
+ - **Ad Not Showing**: Check cache status, strategy, network
213
+ - **Shimmer Forever**: Verify adUnitId and network connectivity
214
+ - **Memory Issues**: Enable `enableLRUEviction` and set `maxCacheMemoryMB`
215
+
216
+ ## References
217
+
218
+ - [AdMob Native Ads](https://developers.google.com/admob/android/native/start)
219
+ - [NativeTemplateView Guide](https://github.com/i2hammad/AdManageKit/blob/main/docs/NATIVE_TEMPLATE_VIEW.md)
220
+ - [GitHub Repository](https://github.com/i2hammad/AdManageKit)
@@ -0,0 +1,94 @@
1
+ # Purchase Categories
2
+
3
+ AdManageKit v2.9.0 introduces a category system for classifying in-app products.
4
+
5
+ ## Categories
6
+
7
+ | Category | Description | Disables Ads | Re-purchasable |
8
+ |----------|-------------|--------------|----------------|
9
+ | `CONSUMABLE` | Virtual currency, power-ups | No | Yes (after consume) |
10
+ | `FEATURE_UNLOCK` | Level packs, themes | No | No |
11
+ | `LIFETIME_PREMIUM` | Permanent premium access | Yes | No |
12
+ | `REMOVE_ADS` | Ad removal only | Yes | No |
13
+
14
+ ## Usage
15
+
16
+ ```kotlin
17
+ // Consumable - coins, gems, credits
18
+ PurchaseItem("coins_100", TYPE_IAP.PURCHASE, PurchaseCategory.CONSUMABLE)
19
+
20
+ // Feature unlock - doesn't disable ads
21
+ PurchaseItem("dark_theme", TYPE_IAP.PURCHASE, PurchaseCategory.FEATURE_UNLOCK)
22
+
23
+ // Lifetime premium - disables ads, grants all features
24
+ PurchaseItem("lifetime", TYPE_IAP.PURCHASE, PurchaseCategory.LIFETIME_PREMIUM)
25
+
26
+ // Remove ads only - just removes ads
27
+ PurchaseItem("remove_ads", TYPE_IAP.PURCHASE, PurchaseCategory.REMOVE_ADS)
28
+
29
+ // Subscription (category not applicable)
30
+ PurchaseItem("premium_monthly", "trial_offer", TYPE_IAP.SUBSCRIPTION)
31
+ ```
32
+
33
+ ## How Categories Affect `isPurchased()`
34
+
35
+ Only certain categories cause `isPurchased()` to return `true`:
36
+
37
+ ```kotlin
38
+ // isPurchased() returns true for:
39
+ // - Any active subscription
40
+ // - LIFETIME_PREMIUM purchases
41
+ // - REMOVE_ADS purchases
42
+
43
+ // isPurchased() returns false for:
44
+ // - CONSUMABLE purchases
45
+ // - FEATURE_UNLOCK purchases
46
+ // - No purchases
47
+ ```
48
+
49
+ ## Checking Specific Categories
50
+
51
+ ```kotlin
52
+ // Check by purchase type
53
+ when (AppPurchase.getInstance().getActivePurchaseType()) {
54
+ PurchaseType.SUBSCRIPTION -> showSubscriberUI()
55
+ PurchaseType.LIFETIME_PREMIUM -> showLifetimeUI()
56
+ PurchaseType.REMOVE_ADS -> hideAdsOnly()
57
+ PurchaseType.NONE -> showPurchaseOptions()
58
+ }
59
+
60
+ // Check specific categories
61
+ AppPurchase.getInstance().hasLifetimePremium() // LIFETIME_PREMIUM
62
+ AppPurchase.getInstance().hasRemoveAdsPurchase() // REMOVE_ADS
63
+ AppPurchase.getInstance().hasLifetimePurchase() // Any lifetime (LIFETIME_PREMIUM or REMOVE_ADS)
64
+ ```
65
+
66
+ ## PurchaseItem Helper Methods
67
+
68
+ ```kotlin
69
+ val item = PurchaseItem("product", TYPE_IAP.PURCHASE, PurchaseCategory.LIFETIME_PREMIUM)
70
+
71
+ item.shouldDisableAds() // true - LIFETIME_PREMIUM disables ads
72
+ item.isLifetimePurchase() // true - one-time purchase (not subscription)
73
+ item.isConsumable // false - not a consumable
74
+ ```
75
+
76
+ ## Default Category
77
+
78
+ When creating a `PurchaseItem` without specifying a category:
79
+
80
+ ```kotlin
81
+ // Default is LIFETIME_PREMIUM (v2.9.0+)
82
+ PurchaseItem("product", TYPE_IAP.PURCHASE)
83
+
84
+ // Equivalent to:
85
+ PurchaseItem("product", TYPE_IAP.PURCHASE, PurchaseCategory.LIFETIME_PREMIUM)
86
+ ```
87
+
88
+ ## Best Practices
89
+
90
+ 1. **Always specify category explicitly** for clarity
91
+ 2. **Use CONSUMABLE** for any product users can buy multiple times
92
+ 3. **Use FEATURE_UNLOCK** for one-time unlocks that don't affect ads
93
+ 4. **Use LIFETIME_PREMIUM** for permanent "premium" access
94
+ 5. **Use REMOVE_ADS** when you have separate ad removal and premium tiers