Managing Inline Content
Understand how Digia Engage inline content persists once loaded, and how to clear it — for example on logout — with clearInlineContent and clearAllInlineContent.
Inline content is the campaign UI that Digia Engage renders inside your screen layout — carousels, stories, banners, and countdowns — through a DigiaSlot / DigiaSlotView placement. Unlike a nudge or a guide, it isn't an overlay the user dismisses; it lives in the page like any other widget.
Because of that, inline content has a lifecycle you sometimes need to manage from app code. This page explains how it persists and how to clear it.
The clearInlineContent and clearAllInlineContent APIs live on the Digia Engage core SDK and behave the same on every stack — React Native, Android, iOS, and Flutter. They are independent of which CEP (CleverTap, MoEngage, WebEngage) delivered the campaign.
1. How inline content persists
When an inline campaign becomes active, the SDK loads its content into the matching slot and keeps it there. It survives scrolling, widget rebuilds, and navigating away and back, so it doesn't flicker or vanish while the user moves around the app.
Loaded inline content clears only in two situations:
The server invalidates the campaign — for example it expires or is stopped.
You clear it explicitly — with the APIs below.
The important consequence: inline content does not clear on its own when the user's context changes. If a user logs out, a banner or carousel that was personalized for them stays on screen until you clear it — so the next user could see the previous user's content.
2. When to clear it
The canonical case is a logout or account switch: clear the previous user's inline content so it doesn't linger into the next session.
More generally, clear inline content whenever app state changes such that the currently loaded content is no longer valid for the current user — for example switching profiles, changing region or language, or leaving a section whose inline campaigns shouldn't persist elsewhere.
3. The API
Two methods on Digia:
clearInlineContent(...)
Inline content in the placement keys you pass
clearAllInlineContent()
Inline content across every placement
The placement keys are the same placementKey values you gave your DigiaSlot / DigiaSlotView. Both methods are safe to call anytime — clearing a placement that has no active content (or passing no keys) is a no-op.
Clearing removes the content that's currently loaded; it does not disable the slot. A new campaign can populate the same placement again later.
4. Clear on logout
The most common use. Clear everything as part of your logout / account-switch flow, next to where you reset your own user state.
5. Clear specific placements
When you only need to clear some slots — for example a personalized hero banner while leaving generic promotional slots in place — pass their placement keys.
6. Use it correctly
Wire it into logout / account switch. This is the case that matters most — a previous user's personalized inline content should not carry into the next user's session. Call it alongside your own session reset.
Match your placement keys exactly. The keys you pass are your
DigiaSlotplacementKeyvalues and are case-sensitive. A key that doesn't match an active slot is a no-op.It clears, it doesn't disable. After clearing, the slot collapses to zero height, but the placement stays live — a later campaign can render into it again.
It's inline-only. These APIs affect inline content (carousels, stories, banners, countdowns). Nudges, guides, and surveys are overlays with their own lifecycle and are not affected.
No-op safety. Calling with no active content, unknown keys, or no keys does nothing and is safe to call defensively.
Related pages
Last updated