JKBaseLib/README.md

51 lines
1.9 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 广告模块集成指南
## 基础配置(必填项)
.addSlot(AD_CODE_SPLASH, "splash_id") // 开屏广告位
.addSlot(AD_CODE_REWARD, "reward_id") // 激励视频广告位
.addSlot(AD_CODE_FEED, "feed_id") // 信息流广告位
.addSlot(AD_CODE_BANNER, "banner_id") // Banner广告位
.addSlot(AD_APPID, "app_id") // APPID
.addSlot(AD_CSJID, "csj_id") // CSJID
.addSlot(AD_CODE_SPLASH, "splash_id") // 添加横幅广告位
.addSlot(AD_CODE_REWARD, "reward_id") // 激励视频广告位
.addSlot(AD_CODE_FEED1, "feed1_id") // 信息流1广告位
.addSlot(AD_CODE_FEED2, "feed2_id") // 信息流2广告位
.addSlot(AD_CODE_FEED3, "feed3_id") // 信息流3广告位
.addSlot(AD_CODE_BANNER, "banner_id") // banner广告位
.addSlot(AD_CODE_Draw, "draw_id") // draw广告位
| 参数 | 类型 | 必填 | 说明 |
|-----------|---------|------|----------|
| context | Context | ✓ | 应用上下文 |
| APP_NAME | String | ✓ | 应用名称 |
| CHANNEL | String | ✓ | 渠道 |
| AppSplash | int | ✓ | 启动页id |
| APPID | String | ✕ | appid |
| CSJID | String | ✕ | csjid |
| AD_CODE_* | String | ✕ | 各类型广告位id |
## 调试模式
// 开发阶段开启(正式环境需关闭)
LogAd.setDebug(true);
## 最佳实践
初始化时机在Application.onCreate()中完成初始化
‌隐私合规‌:确保用户已同意隐私政策
版本兼容最低支持Android 7.0(API 24)
## 初始化失败监听-->重新请求广告开关
ADStateUtils.setSwitchRequestListener(new ADStateUtils.SwitchRequestListener() {
@Override
public void onSwitchRequestChanged() {
AdUtils.getAdvFlag();
}
});
## 注意事项
#### ⚠️ 正式发布前确认:
已关闭调试日志6
所有广告位ID已测试通过
符合广告平台政策要求