In-App Messaging

To make your app support in-app messaging, install SDK v.2.4.0 for iOS or SDK v.2.3.0 for Android and set up how you navigate: what happens if you click an in-app message or close it.

Note that only native apps support in-app messaging features.

iOS:

  1. Adding the SDK to Your App
  2. Initializing the SDK
  3. Setting up navigation

Once you have initialized your SDK, add the following:

Mindbox.shared.inAppMessagesDelegate = inAppMessagesDelegate

The inAppMessagesDelegate object type should launch the InAppMessagesDelegate protocol.

Make sure the protocol supports these two methods:

func inAppMessageTapAction(id: String, url: URL?, payload: String) to process an in-app click

func inAppMessageDismissed(id: String) to process an in-app closure.

Android

  1. Adding the SDK to Your App
  2. Initializing the SDK
  3. Setting up navigation

Once you initialize the SDK, call the registerInAppCallback(obj: InAppCallback) method to pass the object that implements the InAppCallback UI.

The UI should support these two methods:

fun onInAppClick(id: String, url: String, payload: String) to process an in-app click

fun onInAppDismissed(id: String) to process an in-app closure.


Leave the closure method empty if no additional actions are necessary. Leave the onInAppClick empty if an in-app message does not redirect anywhere when clicked. Thus, in-app messages will not entail any actions when clicked if you have their URLs and payloads blank in the admin panel. Or it will get closed if one or both of them are filled.

If clicks on in-app messages imply actions or redirections, like a deep link redirect, you need to enter them manually in the onInAppClick method as the only alternative in the current SDK version.

The SDK transmits the URL and payload in-app message fields only, which can be filled in in the settings.