diff --git a/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt b/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt index 4c43a35c9..b0eae903c 100644 --- a/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt +++ b/iterableapi/src/main/java/com/iterable/iterableapi/IterableEmbeddedManager.kt @@ -123,7 +123,31 @@ public class IterableEmbeddedManager : IterableActivityMonitor.AppStateCallback } fun handleEmbeddedClick(message: IterableEmbeddedMessage, buttonIdentifier: String?, clickedUrl: String?) { - IterableActionRunner.executeAction(context, IterableAction.actionOpenUrl(clickedUrl), IterableActionSource.EMBEDDED) + if ((clickedUrl != null) && clickedUrl.toString().isNotEmpty()) { + if (clickedUrl.startsWith(IterableConstants.URL_SCHEME_ACTION)) { + // This is an action:// URL, pass that to the custom action handler + val actionName: String = clickedUrl.replace(IterableConstants.URL_SCHEME_ACTION, "") + IterableActionRunner.executeAction( + context, + IterableAction.actionCustomAction(actionName), + IterableActionSource.EMBEDDED + ) + } else if (clickedUrl.startsWith(IterableConstants.URL_SCHEME_ITBL)) { + // Handle itbl:// URLs, pass that to the custom action handler for compatibility + val actionName: String = clickedUrl.replace(IterableConstants.URL_SCHEME_ITBL, "") + IterableActionRunner.executeAction( + context, + IterableAction.actionCustomAction(actionName), + IterableActionSource.EMBEDDED + ) + } else { + IterableActionRunner.executeAction( + context, + IterableAction.actionOpenUrl(clickedUrl), + IterableActionSource.EMBEDDED + ) + } + } } private fun broadcastSubscriptionInactive() {