For the complete documentation index, see llms.txt. This page is also available as Markdown.

Campaign Actions

How the Digia Engage SDK handles campaign button taps and URL navigation — and how to intercept them.

When a user taps a button or card in any Digia campaign (Nudge, Guide, Inline, Survey), the SDK fires an action. This reference applies to all CEP integrations — CleverTap, MoEngage, WebEngage, and any custom plugin.


Action Types

Every interactive element produces one of the following action types:

Action type
When it fires
Default SDK behaviour

deep_link

Button configured with a custom-scheme URL

Calls Linking.canOpenURL(url) → opens if the OS can handle it → tries fallback_url if primary fails → dismisses the experience

open_url

Button configured with an HTTP/HTTPS URL

Opens in an in-app browser (presentation: 'in_app') or via Linking.openURL (presentation: 'external')

dismiss

Close button or scrim tap

Dismisses the current experience (scope: 'self') or all active experiences (scope: 'all')

next / back

Guide step navigation buttons

Advances or rewinds the guide step

fire_event

Button configured to emit an analytics event

Forwards the event to the registered CEP plugin's track() method

copy_to_clipboard

Button configured to copy text

Copies the configured text value to the system clipboard

share

Button configured to share text

Opens the native OS share sheet with the configured text value


Deep links use a custom URL scheme registered with your app:

yourapp://path/subpath?param1=value1&param2=value2

For example: medihub://home/offers?coupon=SAVE20

The scheme (medihub://, myapp://, etc.) must be registered in:

  • Android: AndroidManifest.xml intent filter

  • iOS: Info.plist URL scheme entry

Configure a fallback_url (e.g. an App Store link) in the Digia dashboard for cases where the app is not installed or the scheme cannot be opened.


Intercepting Actions with onAction (React Native)

onAction is called before the SDK runs its default behaviour for every action. Return true to suppress the default; return false or void to let the SDK proceed.

Note: onAction has a 2-second timeout. If your handler returns a promise that does not resolve in time, the SDK falls back to its default behaviour.

context object

The second argument provides campaign metadata useful for analytics or conditional logic:


In-App Browser (React Native)

Required when any campaign uses open_url with presentation: 'in_app'. Without it, the SDK falls back to Linking.openURL (opens the device browser) and emits an inapp_browser_unavailable health warning.

Pass inAppBrowser inside the linking config:

defaultInAppBrowser is the built-in system-browser adapter shipped with @digia-engage/core. To use a custom in-app browser (e.g. react-native-inappbrowser-reborn), supply any object matching:

Last updated