跳到正文
Skillpedia
移动应用10k · #11928

engage-sdk-integration

它能做什么

这个技能指导在 Android 应用中添加 Google Play Engage SDK。它帮助选择合适的垂直领域和实体,编写发布代码并修复 SDK 错误。适合希望自己的内容显示在 Google Play 推荐位中的 Android 开发者。

适用场景

  • ✓当你希望通过 Engage SDK 把应用内容发布到 Google Play 时。
  • ✓当你需要把应用的数据类映射到你所在垂直领域的 Engage 实体时。
  • ✓当你从 Engage SDK 收到错误,并需要帮助修复的时候。

技能链接

https://github.com/android/skills/blob/main/play/engage-sdk-integration/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/android/skills/blob/main/play/engage-sdk-integration/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把 Play Engage SDK 集成到我的美食应用中,使我的食谱可以发布到 Google Play。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能会先询问你的应用使用哪个垂直领域和集合,然后读取对应的实体和客户端类的架构。接着它会编写具有所需请求结构的发布代码,并协助调试错误。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

This skill guides you through integrating the Play Engage SDK into an Android app. It ensures that the code follows the mandatory structure and uses the required Engage entities for each vertical.

Workflow

Follow these steps to assist the developer:

  1. Identify vertical and cluster:

    • Ask the developer which vertical their app belongs to based on references/schemas/.
    • Check if the integration is for TV or mobile. If the integration is for TV, read the TV-specific sections in patterns.md as well.
    • Use {VERTICAL}.md in the references/schemas/ directory to identify the corresponding Engage entities and the client class name. The client field in the JSON provides the full class name. For example, com.google.android.engage.food.service.AppEngageFoodClient.
    • Note: Initializing the client class requires a Context parameter. For example, AppEngageFoodClient(context).
    • Always refer to common.md for common entities.
    • Ask which cluster type they want to publish from the supported cluster types for that vertical.
    • Find the method to call from {VERTICAL}.md in the references/schemas/ directory for the specified cluster. Each method will specify the request it expects.
    • Get the request structure from requests.md and clusters from clusters.md. Then suggest and use sources to fill the fields in the request structure correctly, along with the required entities and clusters.
  2. Generate structured boilerplate code:

    • Create a new directory for all Engage-related code. Name the directory to match the naming convention of the existing codebase.
    • Generate the following classes using templates in patterns.md:
      • Constants: holds constant values such as attempt counts and publish types.
      • ItemToEntityConverter: converts the app's local models to Engage's Entity models.
      • ClusterRequestFactory: constructs the publish requests.
      • EngageWorker: handles the actual publishing and publish errors using WorkManager.
      • EngagePublisher: orchestrates periodic and one-time jobs.
      • EngageBroadcastReceiver: listens for AppEngageService intents and starts a one-time publish job from EngagePublisher. Important : Implement both static registration and dynamic registration patterns, including the companion object register method inside the EngageBroadcastReceiver class.
  3. Suggest entity mapping:

    • Ask the developer to provide their local model schema (for example, a data class or a JSON snippet).
    • If they haven't provided one, share entities from {VERTICAL}.md in the references/schemas/ directory as a guide.
    • Once the local model is identified, suggest a mapping to the corresponding Engage entity.
    • Generate the conversion logic using the ItemToEntityConverter pattern in patterns.md and add it to the generated {ENGAGE_CODE_DIR}/ItemToEntityConverter.
  4. Suggest data source:

    • Ask the developer to provide the source of actual data you'll publish.
    • Once you identify the data source, use it to fetch the data in the app's local model schema.
    • Use {ENGAGE_CODE_DIR}/ItemToEntityConverter to convert this data to an Engage entity.
    • Use obtained Engage entity model data with {ENGAGE_CODE_DIR}/ ClusterRequestFactory to get cluster requests.
    • Call corresponding cluster publishing method obtained from {VERTICAL}.md in the references/schemas/ directory with the obtained request in previous step in {ENGAGE_CODE_DIR}/EngageWorker.
  5. Gradle and manifest updates:

    • Suggest updates to build.gradle and AndroidManifest.xml.
    • For mobile apps, use patterns.md.
    • For TV apps, use the TV-specific sections in patterns.md.
    • Provide the necessary implementation dependencies for build.gradle or build.gradle.kts from patterns.md.
    • Provide the <receiver> and <service> declarations for AndroidManifest.xml.
    • Note: Except for TV, there aren't any vertical-specific imports. For all other verticals, com.google.android.engage:engage-core:1.6.0 is sufficient.
  6. Debugging and verification:

    • **S
常见问题

它也涵盖电视应用吗?

涵盖。如果集成面向电视,该技能也会使用针对电视的指导。

它会先问我问题吗?

会。它会询问你的应用属于哪个垂直领域,以及你想发布哪种集合类型。

它需要我的 Google Play 账户吗?

该技能专注于代码。你自己的账户和控制台设置不在它的覆盖范围之内。

详情

作者的原始描述

Helps developers integrate, debug, and resolve Play Engage SDK implementation issues. Use when adding Engage SDK support, generating publishing code, mapping data classes to entities, or fixing SDK-related errors.

repo: android/skills

热度

GitHub 星标
10k
排名
#11928
许可证
Apache-2.0
更新时间
2026/10/29

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能