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,209 @@
|
|
|
1
|
+
# Ad Loading Strategies - AdManageKit v2.8.0
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
AdManageKit v2.6.0+ introduces three loading strategies that control how ads are fetched and displayed. Choose the right strategy based on your app's needs for user experience vs. ad coverage.
|
|
6
|
+
|
|
7
|
+
## Strategy Types
|
|
8
|
+
|
|
9
|
+
### 1. ON_DEMAND
|
|
10
|
+
|
|
11
|
+
**Always fetch fresh ads with loading UI**
|
|
12
|
+
|
|
13
|
+
```kotlin
|
|
14
|
+
AdManageKitConfig.interstitialLoadingStrategy = AdLoadingStrategy.ON_DEMAND
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Pros | Cons |
|
|
18
|
+
|------|------|
|
|
19
|
+
| Maximum ad coverage | May interrupt user flow |
|
|
20
|
+
| Always fresh ads | Loading dialog shown |
|
|
21
|
+
| Best for important moments | Slower on poor network |
|
|
22
|
+
|
|
23
|
+
**Best for:**
|
|
24
|
+
- Important monetization points
|
|
25
|
+
- After significant user actions
|
|
26
|
+
- When you need maximum coverage
|
|
27
|
+
|
|
28
|
+
### 2. ONLY_CACHE
|
|
29
|
+
|
|
30
|
+
**Only show ads already preloaded**
|
|
31
|
+
|
|
32
|
+
```kotlin
|
|
33
|
+
AdManageKitConfig.interstitialLoadingStrategy = AdLoadingStrategy.ONLY_CACHE
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Pros | Cons |
|
|
37
|
+
|------|------|
|
|
38
|
+
| Instant display | Lower ad coverage |
|
|
39
|
+
| Smooth UX | Skips if not cached |
|
|
40
|
+
| No loading dialogs | Requires good preloading |
|
|
41
|
+
|
|
42
|
+
**Best for:**
|
|
43
|
+
- Frequent ad opportunities
|
|
44
|
+
- During gameplay
|
|
45
|
+
- When UX is priority
|
|
46
|
+
|
|
47
|
+
### 3. HYBRID (Recommended)
|
|
48
|
+
|
|
49
|
+
**Check cache first, fetch if needed**
|
|
50
|
+
|
|
51
|
+
```kotlin
|
|
52
|
+
AdManageKitConfig.interstitialLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Pros | Cons |
|
|
56
|
+
|------|------|
|
|
57
|
+
| Instant when cached | May show dialog if not cached |
|
|
58
|
+
| Falls back to fetch | Slightly complex flow |
|
|
59
|
+
| Best of both worlds | - |
|
|
60
|
+
|
|
61
|
+
**Best for:**
|
|
62
|
+
- Most general use cases
|
|
63
|
+
- Default recommendation
|
|
64
|
+
- Balanced UX and coverage
|
|
65
|
+
|
|
66
|
+
## Strategy Availability
|
|
67
|
+
|
|
68
|
+
| Ad Type | ON_DEMAND | ONLY_CACHE | HYBRID |
|
|
69
|
+
|---------|-----------|------------|--------|
|
|
70
|
+
| Interstitial | ✅ | ✅ | ✅ |
|
|
71
|
+
| App Open | ✅ | ✅ | ✅ |
|
|
72
|
+
| Native | ✅ | ❌ | ✅ |
|
|
73
|
+
|
|
74
|
+
> **Note:** Native ads use shimmer instead of dialog, so ONLY_CACHE hides container if not cached.
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
### Global Settings
|
|
79
|
+
|
|
80
|
+
```kotlin
|
|
81
|
+
// In Application.onCreate()
|
|
82
|
+
AdManageKitConfig.apply {
|
|
83
|
+
interstitialLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
84
|
+
appOpenLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
85
|
+
nativeLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Per-Call Override
|
|
90
|
+
|
|
91
|
+
```kotlin
|
|
92
|
+
// InterstitialAdBuilder
|
|
93
|
+
InterstitialAdBuilder.with(activity)
|
|
94
|
+
.adUnit(adUnitId)
|
|
95
|
+
.loadingStrategy(AdLoadingStrategy.ONLY_CACHE)
|
|
96
|
+
.show { next() }
|
|
97
|
+
|
|
98
|
+
// NativeTemplateView
|
|
99
|
+
nativeTemplateView.loadNativeAd(activity, adUnitId, callback, AdLoadingStrategy.ON_DEMAND)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Flow Diagrams
|
|
103
|
+
|
|
104
|
+
### Interstitial ON_DEMAND
|
|
105
|
+
```
|
|
106
|
+
User triggers → Show dialog → Fetch ad →
|
|
107
|
+
Loaded: Show ad → Continue
|
|
108
|
+
Timeout: Skip → Continue
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Interstitial ONLY_CACHE
|
|
112
|
+
```
|
|
113
|
+
User triggers → Check cache →
|
|
114
|
+
Cached: Show ad → Continue
|
|
115
|
+
Not cached: Skip → Continue
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Interstitial HYBRID
|
|
119
|
+
```
|
|
120
|
+
User triggers → Check cache →
|
|
121
|
+
Cached: Show ad → Continue
|
|
122
|
+
Not cached: Show dialog → Fetch →
|
|
123
|
+
Loaded: Show ad → Continue
|
|
124
|
+
Timeout: Skip → Continue
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Native HYBRID
|
|
128
|
+
```
|
|
129
|
+
Load → Check cache →
|
|
130
|
+
Cached: Show immediately
|
|
131
|
+
Not cached: Show shimmer → Fetch →
|
|
132
|
+
Success: Show ad
|
|
133
|
+
Failure: Hide container
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Strategy Selection Guide
|
|
137
|
+
|
|
138
|
+
| Use Case | Recommended |
|
|
139
|
+
|----------|-------------|
|
|
140
|
+
| Level completion | HYBRID |
|
|
141
|
+
| During gameplay | ONLY_CACHE |
|
|
142
|
+
| Navigation | ONLY_CACHE |
|
|
143
|
+
| Long tasks | ON_DEMAND |
|
|
144
|
+
| App open/resume | HYBRID |
|
|
145
|
+
| Cold start | ON_DEMAND |
|
|
146
|
+
| Feed/list items | ONLY_CACHE |
|
|
147
|
+
| Article content | HYBRID |
|
|
148
|
+
|
|
149
|
+
## Example Configurations
|
|
150
|
+
|
|
151
|
+
### Gaming App
|
|
152
|
+
|
|
153
|
+
```kotlin
|
|
154
|
+
AdManageKitConfig.apply {
|
|
155
|
+
interstitialLoadingStrategy = AdLoadingStrategy.ONLY_CACHE
|
|
156
|
+
appOpenLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
157
|
+
nativeLoadingStrategy = AdLoadingStrategy.ONLY_CACHE
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Utility App
|
|
162
|
+
|
|
163
|
+
```kotlin
|
|
164
|
+
AdManageKitConfig.apply {
|
|
165
|
+
interstitialLoadingStrategy = AdLoadingStrategy.ON_DEMAND
|
|
166
|
+
appOpenLoadingStrategy = AdLoadingStrategy.ON_DEMAND
|
|
167
|
+
nativeLoadingStrategy = AdLoadingStrategy.ON_DEMAND
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Content App
|
|
172
|
+
|
|
173
|
+
```kotlin
|
|
174
|
+
AdManageKitConfig.apply {
|
|
175
|
+
interstitialLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
176
|
+
appOpenLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
177
|
+
nativeLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## v2.8.0 Updates
|
|
182
|
+
|
|
183
|
+
**`forceShowInterstitial()` now respects loading strategy!**
|
|
184
|
+
|
|
185
|
+
```kotlin
|
|
186
|
+
// Before v2.8.0: Always fetched fresh
|
|
187
|
+
// After v2.8.0: Respects interstitialLoadingStrategy
|
|
188
|
+
|
|
189
|
+
AdManager.getInstance().forceShowInterstitial(activity, callback)
|
|
190
|
+
|
|
191
|
+
// To always force fetch (old behavior):
|
|
192
|
+
AdManager.getInstance().forceShowInterstitialAlways(activity, callback)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Best Practices
|
|
196
|
+
|
|
197
|
+
1. **Set once** in `Application.onCreate()`
|
|
198
|
+
2. **Use HYBRID** as default
|
|
199
|
+
3. **Use ONLY_CACHE** for frequent interruptions
|
|
200
|
+
4. **Use ON_DEMAND** for critical moments
|
|
201
|
+
5. **Enable background preloading** for ONLY_CACHE/HYBRID
|
|
202
|
+
6. **Monitor coverage** and adjust based on metrics
|
|
203
|
+
|
|
204
|
+
## References
|
|
205
|
+
|
|
206
|
+
- [GitHub Repository](https://github.com/i2hammad/AdManageKit)
|
|
207
|
+
- [[Interstitial Ads]]
|
|
208
|
+
- [[App Open Ads]]
|
|
209
|
+
- [[Native Ads|NativeAdManager]]
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# App Open Ads - AdManageKit v2.8.0
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
AdManageKit provides lifecycle-aware app open ad management through `AppOpenManager`. App open ads display when users launch or return to your app, with support for loading strategies, welcome dialogs, and activity exclusion.
|
|
6
|
+
|
|
7
|
+
**Library Version**: v2.8.0
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Lifecycle-Aware**: Automatically shows ads when app moves to foreground
|
|
12
|
+
- **Loading Strategies**: ON_DEMAND, ONLY_CACHE, HYBRID support
|
|
13
|
+
- **Welcome Dialog**: Beautiful animated loading UI while fetching ads
|
|
14
|
+
- **Activity Exclusion**: Skip ads for specific activities
|
|
15
|
+
- **Purchase Check**: Automatically skips for premium users
|
|
16
|
+
- **Firebase Analytics**: Comprehensive event tracking
|
|
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-billing:v2.8.0'
|
|
24
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-core:v2.8.0'
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Configuration
|
|
29
|
+
|
|
30
|
+
### Basic Setup
|
|
31
|
+
|
|
32
|
+
```kotlin
|
|
33
|
+
class MyApp : Application() {
|
|
34
|
+
private lateinit var appOpenManager: AppOpenManager
|
|
35
|
+
|
|
36
|
+
override fun onCreate() {
|
|
37
|
+
super.onCreate()
|
|
38
|
+
|
|
39
|
+
// Set up billing first
|
|
40
|
+
BillingConfig.setPurchaseProvider(BillingPurchaseProvider())
|
|
41
|
+
|
|
42
|
+
// Configure loading strategy
|
|
43
|
+
AdManageKitConfig.apply {
|
|
44
|
+
appOpenLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
45
|
+
appOpenAdTimeout = 4.seconds
|
|
46
|
+
welcomeDialogAppIcon = R.mipmap.ic_launcher
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Initialize app open manager
|
|
50
|
+
appOpenManager = AppOpenManager(this, "ca-app-pub-xxx/yyy")
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Welcome Dialog Customization
|
|
56
|
+
|
|
57
|
+
```kotlin
|
|
58
|
+
AdManageKitConfig.apply {
|
|
59
|
+
// App icon in welcome dialog
|
|
60
|
+
welcomeDialogAppIcon = R.mipmap.ic_launcher
|
|
61
|
+
|
|
62
|
+
// Custom texts
|
|
63
|
+
welcomeDialogTitle = "Welcome Back!"
|
|
64
|
+
welcomeDialogSubtitle = "Loading your content..."
|
|
65
|
+
welcomeDialogFooter = "Just a moment..."
|
|
66
|
+
|
|
67
|
+
// Colors
|
|
68
|
+
dialogOverlayColor = 0x80000000.toInt() // 50% black
|
|
69
|
+
dialogCardBackgroundColor = Color.WHITE
|
|
70
|
+
|
|
71
|
+
// Dismiss delay after ad shows
|
|
72
|
+
welcomeDialogDismissDelay = 0.8.seconds
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
### Automatic Display
|
|
79
|
+
|
|
80
|
+
App open ads show automatically when the app comes to foreground:
|
|
81
|
+
|
|
82
|
+
```kotlin
|
|
83
|
+
// Initialize in Application.onCreate()
|
|
84
|
+
appOpenManager = AppOpenManager(this, "ca-app-pub-xxx/yyy")
|
|
85
|
+
// That's it! Ads show automatically on app foreground
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Force Show
|
|
89
|
+
|
|
90
|
+
```kotlin
|
|
91
|
+
appOpenManager.forceShowAdIfAvailable(activity, object : AdManagerCallback() {
|
|
92
|
+
override fun onNextAction() {
|
|
93
|
+
// Continue with your flow
|
|
94
|
+
navigateToMain()
|
|
95
|
+
}
|
|
96
|
+
override fun onAdLoaded() {
|
|
97
|
+
// Ad was displayed
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Excluding Activities
|
|
103
|
+
|
|
104
|
+
```kotlin
|
|
105
|
+
// Exclude splash screen from showing ads
|
|
106
|
+
appOpenManager.disableAppOpenWithActivity(SplashActivity::class.java)
|
|
107
|
+
|
|
108
|
+
// Re-enable later if needed
|
|
109
|
+
appOpenManager.includeAppOpenActivityForAds(SplashActivity::class.java)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Skip Next Ad
|
|
113
|
+
|
|
114
|
+
```kotlin
|
|
115
|
+
// Skip the next ad (e.g., after returning from in-app purchase)
|
|
116
|
+
appOpenManager.skipNextAd()
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Check Availability
|
|
120
|
+
|
|
121
|
+
```kotlin
|
|
122
|
+
if (appOpenManager.isAdAvailable()) {
|
|
123
|
+
// Ad is ready to show
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Loading Strategies
|
|
128
|
+
|
|
129
|
+
Configure via `AdManageKitConfig.appOpenLoadingStrategy`:
|
|
130
|
+
|
|
131
|
+
| Strategy | Behavior |
|
|
132
|
+
|----------|----------|
|
|
133
|
+
| ON_DEMAND | Always fetch fresh ad with welcome dialog |
|
|
134
|
+
| ONLY_CACHE | Only show if cached, skip otherwise |
|
|
135
|
+
| HYBRID | Show cached if ready, fetch with dialog otherwise |
|
|
136
|
+
|
|
137
|
+
```kotlin
|
|
138
|
+
// Set strategy
|
|
139
|
+
AdManageKitConfig.appOpenLoadingStrategy = AdLoadingStrategy.HYBRID
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## API Reference
|
|
143
|
+
|
|
144
|
+
### AppOpenManager Methods
|
|
145
|
+
|
|
146
|
+
| Method | Description |
|
|
147
|
+
|--------|-------------|
|
|
148
|
+
| `fetchAd()` | Preload ad in background |
|
|
149
|
+
| `fetchAd(callback, timeout)` | Preload with callback and timeout |
|
|
150
|
+
| `showAdIfAvailable()` | Show if cached (lifecycle triggered) |
|
|
151
|
+
| `forceShowAdIfAvailable(activity, callback)` | Force show with callback |
|
|
152
|
+
| `isAdAvailable()` | Check if ad is cached |
|
|
153
|
+
| `skipNextAd()` | Skip next ad display |
|
|
154
|
+
| `disableAppOpenWithActivity(class)` | Exclude activity |
|
|
155
|
+
| `includeAppOpenActivityForAds(class)` | Re-include activity |
|
|
156
|
+
|
|
157
|
+
### AdManageKitConfig Settings
|
|
158
|
+
|
|
159
|
+
| Setting | Description | Default |
|
|
160
|
+
|---------|-------------|---------|
|
|
161
|
+
| `appOpenLoadingStrategy` | Loading strategy | HYBRID |
|
|
162
|
+
| `appOpenAdTimeout` | Load timeout | 4 seconds |
|
|
163
|
+
| `appOpenFetchFreshAd` | Disable background prefetch | false |
|
|
164
|
+
| `welcomeDialogAppIcon` | App icon resource | 0 |
|
|
165
|
+
| `welcomeDialogTitle` | Dialog title | "Welcome Back!" |
|
|
166
|
+
| `welcomeDialogSubtitle` | Dialog subtitle | "Loading..." |
|
|
167
|
+
| `welcomeDialogFooter` | Dialog footer | "Just a moment..." |
|
|
168
|
+
| `welcomeDialogDismissDelay` | Delay before dismiss | 0.8 seconds |
|
|
169
|
+
| `dialogOverlayColor` | Overlay color | 50% black |
|
|
170
|
+
| `dialogCardBackgroundColor` | Card background | Theme default |
|
|
171
|
+
|
|
172
|
+
## Best Practices
|
|
173
|
+
|
|
174
|
+
1. **Initialize in Application** - Set up `AppOpenManager` in `Application.onCreate()`
|
|
175
|
+
2. **Exclude Splash** - Use `disableAppOpenWithActivity(SplashActivity::class.java)`
|
|
176
|
+
3. **Use HYBRID** - Best balance of UX and coverage
|
|
177
|
+
4. **Set App Icon** - Configure `welcomeDialogAppIcon` for branded experience
|
|
178
|
+
5. **Wire Billing** - Ensure `BillingConfig` is set up to skip premium users
|
|
179
|
+
|
|
180
|
+
## Troubleshooting
|
|
181
|
+
|
|
182
|
+
- **Ad Not Showing**: Check `isAdAvailable()`, exclusion list, purchase status
|
|
183
|
+
- **Welcome Dialog Issues**: Verify `welcomeDialogAppIcon` is set
|
|
184
|
+
- **Strategy Not Working**: Ensure v2.8.0+ and check `appOpenLoadingStrategy`
|
|
185
|
+
|
|
186
|
+
## References
|
|
187
|
+
|
|
188
|
+
- [AdMob App Open Ads](https://developers.google.com/admob/android/app-open-ads)
|
|
189
|
+
- [GitHub Repository](https://github.com/i2hammad/AdManageKit)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Banner Ads - AdManageKit v2.8.0
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
AdManageKit provides `BannerAdView` for easy banner ad integration with features like auto-refresh, collapsible banners, and smart retry logic.
|
|
6
|
+
|
|
7
|
+
**Library Version**: v2.8.0
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Auto-Refresh**: Configurable refresh intervals
|
|
12
|
+
- **Collapsible Banners**: Expandable/collapsible banner support
|
|
13
|
+
- **Smart Retry**: Automatic retry with exponential backoff
|
|
14
|
+
- **Purchase Check**: Auto-hide for premium users
|
|
15
|
+
- **Firebase Analytics**: Event tracking integration
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```groovy
|
|
20
|
+
dependencies {
|
|
21
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit:v2.8.0'
|
|
22
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-core:v2.8.0'
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### XML Layout
|
|
29
|
+
|
|
30
|
+
```xml
|
|
31
|
+
<com.i2hammad.admanagekit.admob.BannerAdView
|
|
32
|
+
android:id="@+id/bannerAdView"
|
|
33
|
+
android:layout_width="match_parent"
|
|
34
|
+
android:layout_height="wrap_content" />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Load Banner
|
|
38
|
+
|
|
39
|
+
```kotlin
|
|
40
|
+
// Standard banner
|
|
41
|
+
bannerAdView.loadBanner(activity, "ca-app-pub-xxx/yyy")
|
|
42
|
+
|
|
43
|
+
// With callback
|
|
44
|
+
bannerAdView.loadBanner(activity, "ca-app-pub-xxx/yyy", object : AdLoadCallback() {
|
|
45
|
+
override fun onAdLoaded() { /* success */ }
|
|
46
|
+
override fun onFailedToLoad(error: AdError?) { /* error */ }
|
|
47
|
+
override fun onAdImpression() { /* impression */ }
|
|
48
|
+
override fun onAdClicked() { /* clicked */ }
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Collapsible Banner
|
|
53
|
+
|
|
54
|
+
```kotlin
|
|
55
|
+
// Load collapsible banner at bottom
|
|
56
|
+
bannerAdView.loadCollapsibleBanner(activity, "ca-app-pub-xxx/yyy", isBottom = true)
|
|
57
|
+
|
|
58
|
+
// Load collapsible banner at top
|
|
59
|
+
bannerAdView.loadCollapsibleBanner(activity, "ca-app-pub-xxx/yyy", isBottom = false)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Configuration
|
|
63
|
+
|
|
64
|
+
### Global Settings
|
|
65
|
+
|
|
66
|
+
```kotlin
|
|
67
|
+
AdManageKitConfig.apply {
|
|
68
|
+
// Auto-refresh interval (minimum 30 seconds per AdMob policy)
|
|
69
|
+
defaultBannerRefreshInterval = 60.seconds
|
|
70
|
+
|
|
71
|
+
// Enable collapsible by default
|
|
72
|
+
enableCollapsibleBannersByDefault = false
|
|
73
|
+
|
|
74
|
+
// Default collapsible placement
|
|
75
|
+
defaultCollapsiblePlacement = CollapsibleBannerPlacement.BOTTOM
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Collapsible Placement Options
|
|
80
|
+
|
|
81
|
+
```kotlin
|
|
82
|
+
// Available placements
|
|
83
|
+
CollapsibleBannerPlacement.TOP
|
|
84
|
+
CollapsibleBannerPlacement.BOTTOM
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Jetpack Compose
|
|
88
|
+
|
|
89
|
+
```kotlin
|
|
90
|
+
@Composable
|
|
91
|
+
fun MyScreen() {
|
|
92
|
+
BannerAdCompose(
|
|
93
|
+
adUnitId = "ca-app-pub-xxx/yyy",
|
|
94
|
+
modifier = Modifier.fillMaxWidth()
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## API Reference
|
|
100
|
+
|
|
101
|
+
### BannerAdView Methods
|
|
102
|
+
|
|
103
|
+
| Method | Description |
|
|
104
|
+
|--------|-------------|
|
|
105
|
+
| `loadBanner(activity, adUnitId)` | Load standard banner |
|
|
106
|
+
| `loadBanner(activity, adUnitId, callback)` | Load with callback |
|
|
107
|
+
| `loadCollapsibleBanner(activity, adUnitId, isBottom)` | Load collapsible |
|
|
108
|
+
|
|
109
|
+
### AdManageKitConfig Settings
|
|
110
|
+
|
|
111
|
+
| Setting | Description | Default |
|
|
112
|
+
|---------|-------------|---------|
|
|
113
|
+
| `defaultBannerRefreshInterval` | Refresh interval | 60 seconds |
|
|
114
|
+
| `enableCollapsibleBannersByDefault` | Enable collapsible | false |
|
|
115
|
+
| `defaultCollapsiblePlacement` | Collapsible position | BOTTOM |
|
|
116
|
+
|
|
117
|
+
## Best Practices
|
|
118
|
+
|
|
119
|
+
1. **Place wisely** - Don't cover important content
|
|
120
|
+
2. **Respect refresh** - Minimum 30 seconds per AdMob policy
|
|
121
|
+
3. **Test placements** - Try different positions for best performance
|
|
122
|
+
4. **Use collapsible** - Better UX for tall banners
|
|
123
|
+
|
|
124
|
+
## Troubleshooting
|
|
125
|
+
|
|
126
|
+
- **Banner Not Showing**: Check adUnitId, network, purchase status
|
|
127
|
+
- **Refresh Issues**: Ensure interval is 30+ seconds
|
|
128
|
+
- **Sizing Issues**: Use `wrap_content` for height
|
|
129
|
+
|
|
130
|
+
## References
|
|
131
|
+
|
|
132
|
+
- [AdMob Banner Ads](https://developers.google.com/admob/android/banner)
|
|
133
|
+
- [GitHub Repository](https://github.com/i2hammad/AdManageKit)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Billing Integration
|
|
2
|
+
|
|
3
|
+
AdManageKit provides a comprehensive billing integration module (`admanagekit-billing`) that simplifies Google Play Billing Library v8 implementation.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Add Dependency
|
|
8
|
+
|
|
9
|
+
```groovy
|
|
10
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-billing:v2.9.0'
|
|
11
|
+
implementation 'com.github.i2hammad.AdManageKit:ad-manage-kit-core:v2.9.0'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### 2. Define Products
|
|
15
|
+
|
|
16
|
+
```kotlin
|
|
17
|
+
val products = listOf(
|
|
18
|
+
// Consumable (coins, gems)
|
|
19
|
+
PurchaseItem("coins_100", TYPE_IAP.PURCHASE, PurchaseCategory.CONSUMABLE),
|
|
20
|
+
|
|
21
|
+
// Lifetime premium (disables ads)
|
|
22
|
+
PurchaseItem("lifetime", TYPE_IAP.PURCHASE, PurchaseCategory.LIFETIME_PREMIUM),
|
|
23
|
+
|
|
24
|
+
// Remove ads only
|
|
25
|
+
PurchaseItem("remove_ads", TYPE_IAP.PURCHASE, PurchaseCategory.REMOVE_ADS),
|
|
26
|
+
|
|
27
|
+
// Subscription with trial
|
|
28
|
+
PurchaseItem("premium_monthly", "free_trial", TYPE_IAP.SUBSCRIPTION)
|
|
29
|
+
)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Initialize
|
|
33
|
+
|
|
34
|
+
```kotlin
|
|
35
|
+
class MyApp : Application() {
|
|
36
|
+
override fun onCreate() {
|
|
37
|
+
super.onCreate()
|
|
38
|
+
AppPurchase.getInstance().initBilling(this, products)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 4. Make Purchases
|
|
44
|
+
|
|
45
|
+
```kotlin
|
|
46
|
+
// In-app purchase
|
|
47
|
+
AppPurchase.getInstance().purchase(activity, "remove_ads")
|
|
48
|
+
|
|
49
|
+
// Subscription
|
|
50
|
+
AppPurchase.getInstance().subscribe(activity, "premium_monthly")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 5. Check Purchase Status
|
|
54
|
+
|
|
55
|
+
```kotlin
|
|
56
|
+
if (AppPurchase.getInstance().isPurchased()) {
|
|
57
|
+
// User has premium (subscription, lifetime, or remove_ads)
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Pages
|
|
62
|
+
|
|
63
|
+
- [[Purchase Categories]] - Product classification system
|
|
64
|
+
- [[Consumable Products]] - Handling consumables with manual consumption
|
|
65
|
+
- [[Subscriptions]] - Subscription lifecycle management
|
|
66
|
+
- [[Subscription Upgrades]] - Upgrade/downgrade handling
|
|
67
|
+
- [[Purchase History]] - Tracking purchases with PurchaseHistoryListener
|
|
68
|
+
- [[PurchaseResult API]] - Full API reference for PurchaseResult
|
|
69
|
+
- [[Server Verification]] - Server-side purchase verification
|