Documentation Index
Fetch the complete documentation index at: https://docs.kontext.so/llms.txt
Use this file to discover all available pages before exploring further.
你需要一个 发布方账号 来获取
publisherToken 与 placement code。1. 添加 SDK
SDK 发布在 Maven Central,坐标是so.kontext:ads。先确认你的项目仓库配置里包含 mavenCentral():
build.gradle.kts 中加入依赖:
2. Google Advertising ID(GAID)
SDK 会在每次广告请求时自动读取并上送 Google Advertising ID。com.google.android.gms.permission.AD_ID 权限会通过 SDK 的清单贡献自动并入你的 AndroidManifest.xml——无需修改清单文件。GAID 属于安装时权限,运行时不会弹窗。
如果你的 app 面向 Android 13+(API 33+),并且在清单的某处对
AD_ID 权限显式声明了 tools:node="remove",请移除该覆盖,否则运行时无法访问广告标识符。SessionOptions.advertisingId 直接传入——这个值会优先于 SDK 的自动收集。