If you want to integrate the In-App messages in your application, you can do it with several complementary formats:
- Banner. Static content that is always visible, but allows the user to continue using the application.
- PopUp. Content of a full screen that forces the user to click or discard the information.
Banner format
Next we tell you how to instantiate one or more In-App messages in banner format.
Remember that you should first have them defined in the indigitall console. See our user manual for more information.
- A single banner
Create a Container, its size must match the one you have defined in the indigitall console ( Tools> In-App Schemas / In-Web ).
Container container = new Container (width: WIDTH, height: HEIGHT);
- If a width and height size different from the one we have defined in the console is assigned, it is likely that the InApp will not display correctly.
Once the code has been created to show the InApp, it must be instantiated and called in the showInApp method that we can see below. The code of the InApp, the id of the previous Container, the same container created previously and the appropriate callback must be passed as parameters to obtain the view and the code. This callback will tell us if it has been loaded correctly or not and in relation to this result we will do one action or another.
A code example is here
IndigitallFlutterPlugin.showInApp (IndigitallParams.PARAM_INAPP_CODE: 'YOUR_INAPP_CODE', (inApp, container) => {
// DO SOMETHING
}, (error) => {
// Log error message
});
* 6.1.2. Multiple banners
If we want to have several InApp, the previous step has to be carried out for each component that we want to show.
PopUp format
Here we tell you how to instantiate an In-App message in popup format.
Remember that you should first have it defined in the indigitall console. See our user manual for more info.
IndigitallFlutterPlugin.showPopUp(IndigitallParams.PARAM_INAPP_POPUP_CODE: 'YOUR_INAPP_CODE', (inAppCode) => {
//DO SOMETHING
}, (error) => {
// Log error message
});
If you want to customize the icon to close the Popup, you can do it with the following method to which you can pass the name of the image or icon that you must attach in the native versions. In the case of android in the drawable folder and in the case of iOS in assets, if you wanted to use our icon, it would be enough to pass a null. The parameter closeIconDisabled is in case you don't want to show any icon, setting it to true to hide it or false to show it.
InApIndigitallFlutterPluginp.showPopUp(
{
IndigitallParams.PARAM_INAPP_POPUP_CODE: 'YOUR_INAPP_CODE',
IndigitallParams.PARAM_CLOSE_BUTTON: false,
IndigitallParams.PARAM_CLOSE_ICON_DISABLED: 'YOUR_ICON_BUTTON_NAME'
},
(inApp) => {
//DO SOMETHING
},
(error) => {
//DO SOMETHING
}
);