技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
engage-sdk-integration【数据与研究】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.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: engage-sdk-integration description: 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. license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-10-03' keywords:
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.
Follow these steps to assist the developer:
Identify vertical and cluster:
{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.Context parameter. For example, AppEngageFoodClient(context).{VERTICAL}.md in the references/schemas/ directory for the specified cluster. Each method will specify the request it expects.Generate structured boilerplate code:
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.Suggest entity mapping:
{VERTICAL}.md in the references/schemas/ directory as a guide.ItemToEntityConverter pattern in patterns.md and add it to the generated {ENGAGE_CODE_DIR}/ItemToEntityConverter.Suggest data source:
{ENGAGE_CODE_DIR}/ItemToEntityConverter to convert this data to an Engage entity.{ENGAGE_CODE_DIR}/ ClusterRequestFactory to get cluster requests.{VERTICAL}.md in the references/schemas/ directory with the obtained request in previous step in {ENGAGE_CODE_DIR}/EngageWorker.Gradle and manifest updates:
build.gradle and AndroidManifest.xml.implementation dependencies for build.gradle or build.gradle.kts from patterns.md.<receiver> and <service> declarations for AndroidManifest.xml.com.google.android.engage:engage-core:1.6.0 is sufficient.Debugging and verification:
EngageBroadcastReceiver statically in AndroidManifest.xml (inside the <application> tag).EngageBroadcastReceiver dynamically by calling EngageBroadcastReceiver.register(context) in the Application class or main Activity class.register method in EngageBroadcastReceiver's companion object to handle dynamic registration.EngageWorker (for example, by deleting the cluster instead of publishing empty data).--no-daemon for all Gradle compilations../gradlew compileDebugUnitTestSources --no-daemon or ./gradlew assembleDebug --no-daemon. See references/troubleshooting.md for compile rules and warnings about fast-compilation shortcuts. Repeat this step until compilation is successful.User checklist: At the end of code generation, notify the user to go through this checklist to verify that the integration is complete and as intended:
{ENGAGE_CODE_DIR}/:
ConstantsItemToEntityConverterClusterRequestFactoryEngageWorker{cluster_type}PublisherEngageBroadcastReceiver{ENGAGE_CODE_DIR}/ItemToEntityConverter.ItemToEntityConverter point to images matching the strict aspect ratio requirements of the vertical (for example, 16:9, 1:1, 2:3).{ENGAGE_CODE_DIR}/EngageWorker uses the data source identified in Step 4.EngageBroadcastReceiver.register(context) is called within the Application class or MainActivity to register the receiver dynamically.AndroidManifest.xml contains the static <receiver> declaration for EngageBroadcastReceiver with the necessary intent actions.EngageBroadcastReceiver.register(context) inside their custom Application class onCreate() (or their main activity onCreate()) to dynamically register the receiver. Stress that both static and dynamic registrations are required for the integration to function.FAQ: Engage FAQ - Refer to this document for answers to frequently asked questions from developers.
Vertical-specific guides:
Vertical-specific schemas: