---
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-11-20'
  keywords:
    - android
    - engage
    - engage sdk
    - play engage library
    - google play
title: engage-sdk-integration
canonical_url: https://skilld.dev/gh/android/skills/engage-sdk-integration
last_updated: 2026-11-24T09:07:15.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> 28 supporting files sit beside this SKILL.md. When the Skill refers to one, fetch https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/PATH with PATH replaced.
>
> If the user asked to install this Skill, run `npx skilld install android/skills/engage-sdk-integration`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/engage-sdk-integration`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/android/skills/engage-sdk-integration) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/engage-sdk-integration`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/engage-sdk-integration --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/engage-sdk-integration --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

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](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/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](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/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](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/requests.md) and clusters from [clusters.md](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/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](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/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](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/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](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/patterns.md).
   - For TV apps, use the TV-specific sections in [patterns.md](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/patterns.md).
   - Provide the necessary `implementation` dependencies for `build.gradle` or `build.gradle.kts` from [patterns.md](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/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**:

   - **Self-verification checklist** : Before considering your work complete, you must verify that you've implemented all of the following:
     - \[ \] Registered `EngageBroadcastReceiver` **statically** in `AndroidManifest.xml` (inside the `<application>` tag).
     - \[ \] Registered `EngageBroadcastReceiver` **dynamically** by calling `EngageBroadcastReceiver.register(context)` in the `Application` class or main `Activity` class.
     - \[ \] Implemented the `register` method in `EngageBroadcastReceiver`'s `companion object` to handle dynamic registration.
     - \[ \] Handled empty data lists in `EngageWorker` (for example, by deleting the cluster instead of publishing empty data).
   - Perform a Gradle sync.
   - If errors occur (such as import failures, namespace conflicts, or compile errors), read **[references/troubleshooting.md](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/troubleshooting.md)** to resolve them.
   - Execute a Gradle compilation (`./gradlew compileDebugUnitTestSources` or `./gradlew assembleDebug`). See **[references/troubleshooting.md](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/troubleshooting.md)** for compile rules and warnings about fast-compilation shortcuts. Repeat this step until compilation is successful.
7. **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:

   - \[ \] Verify that all the Engage-related files are created in `{ENGAGE_CODE_DIR}/`:
     - `Constants`
     - `ItemToEntityConverter`
     - `ClusterRequestFactory`
     - `EngageWorker`
     - `{cluster_type}Publisher`
     - `EngageBroadcastReceiver`
   - \[ \] Verify that app's local model is converted to Engage entity by populating the fields correctly in the model in `{ENGAGE_CODE_DIR}/ItemToEntityConverter`.
   - \[ \] Verify that all image URIs in `ItemToEntityConverter` point to images matching the strict aspect ratio requirements of the vertical (for example, 16:9, 1:1, 2:3).
   - \[ \] Verify that `{ENGAGE_CODE_DIR}/EngageWorker` uses the data source identified in Step 4.
   - \[ \] Verify that `EngageBroadcastReceiver.register(context)` is called within the `Application` class or `MainActivity` to register the receiver dynamically.
   - \[ \] Verify that `AndroidManifest.xml` contains the static `<receiver>` declaration for `EngageBroadcastReceiver` with the necessary intent actions.
   - **Important** : Explicitly instruct the developer to call `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.

## Reference materials

- **FAQ:** [Engage FAQ](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/faq.md) - Refer to this document for answers to frequently
  asked questions from developers.

- **Vertical-specific guides:**

  - [Food Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/food.md)
  - [Watch Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/watch.md)
  - [Listen Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/listen.md)
  - [Read Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/read.md)
  - [Shopping Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/shopping.md)
  - [Social Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/social.md)
  - [Travel Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/travel.md)
  - [Health and Fitness Vertical](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/healthandfitness.md)
  - [Other Verticals](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/otherverticals.md)
  - [TV Getting Started](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/tv/getting-started.md)
  - [TV Recommendations](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/tv/recommendations.md)
  - [TV Continue Watching](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/tv/continue-watching/index.md)
  - [TV Entitlements](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/android/guide/playcore/engage/tv/entitlements.md)
- **Vertical-specific schemas:**

  - [Food Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/food.md)
  - [Watch Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/watch.md)
  - [Listen Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/listen.md)
  - [Read Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/read.md)
  - [Shopping Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/shopping.md)
  - [Social Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/social.md)
  - [Travel Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/travel.md)
  - [TV Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/tv.md)
  - [Other Schema](https://skilld.dev/api/skills-raw/android/skills/engage-sdk-integration/references/schemas/other.md)
