
Installing Android Dependency
Requirements for displaying images and GIFs in InApp
Starting InApp version 7.0.0, SDK requires Glide to show images and GIFs in the in-apps. You need to add the below dependency in your build.gradle file.Additional dependency installation is not required for iOS.
Show InApp
Call the below API to show an inApp campaign on a screen. You will have to handle the redirection of the user when they click on the inApps unless it’s a rich landing navigation.Display Nudges
Starting with moengage_flutter version 7.0.0 MoEngage InApp SDK supports displaying Non-Intrusive nudges. This API is supported only in Android & IOS. You will have to handle the redirection of the user when they click on the inApps unless it’s a rich landing navigation. To show a Nudge InApp Campaign callshowNudge()
InApp/Nudge Redirection default behavior
On clicking an Inapp or Nudge, MoEngage SDKs will handle only rich landing navigation redirection. For the screen name and deep link redirection, your app code should redirect the user to the right screen or deep link. To handle the screen name and deep link redirection, you must implement inapp click callback methods. MoEngage SDK will just pass the inapp payload to this call back code. Implementation steps are mentioned in the InApp callback section of the Integration.Self Handled InApps
Self-handled In Apps are messages that are delivered by the SDK to the application, and the application builds the UI using the delivered payload by the SDK. To get the self-handled in-app, use the below API.Multiple Self-Handled InApps
- This feature requires a minimum moengage_flutter version 9.0.0
- Event-triggered multiple self-handled inapps are not supported.
Tracking Statistics for Multiple Self-Handled In-Apps
The onCampaignsAvailable() callback method returns SelfHandledCampaignsData**,**which contains a list of SelfHandledCampaignData objects. The statistics for each SelfHandledCampaignData object must be tracked individually below APIs.Fetching Contextual Multiple Self-Handled InApps
To fetch contextual multiple self-handled inapps, set the inapp contexts using setCurrentContext() before calling *getSelfHandledInApps().*This will return a list of contextual and non-contextual inapps(in the order of campaign priority set at the time of campaign creation).Tracking Statistics for Self-Handled In-Apps
The application must notify MoEngage SDK whenever the In-App messages are displayed, clicked on, or dismissed, as the application controls these actions. The following methods are called to notify the SDK. The data object provided to the application in the callback for self-handled in-app should be passed as a parameter to the following APIs.InApp Callbacks
We provide callbacks for in-app shown, in-app clicked, in-app dismissed, and self-Handled in-app available events. You can register for the same as shown below.Contextual InApp
You can restrict the in-apps based on the user’s context in the application apart from restricting InApp campaigns on a specific screen. To set the user’s context in the application use setCurrentContext() API as shown below.Set Context
Call the below method to set the context in the initState() method of the widget before calling showInApp().Reset Context
Once the user is moving out of the context use the resetCurrentContext() API to reset/clear the existing context.InApp Payload
InApp Data will be received in the below format:Handling Orientation Change
This is only for the Android platform
4.1.0 in-apps are supported in both portrait and landscape modes.SDK has to be notified when the device orientation changes for SDK to handle in-app display. There are two ways to do it:
- Add the API call in the Android native part of your app
- Call MoEngage plugin’s
onOrientationChanged()