In order to integrate the v2 version of inApp, please contact the indigitall support team
InApp Utilities
In the event that you want to show the InApp scheme in a different way to how our SDK paints it, we put at your disposal some methods so that you can customize the "painting", without affecting the statistics or the InApp functionalities.
Get InApp object
InAppIndigitall.inAppGet(context, inAppId, new InAppCallback(context){
@Override
public void onFail(Error error) {
super.onFail(error);
}
@Override
public void onSuccess(InApp inApp) {
//DO SOMETHING
}
});
Check if the InApp should be displayed
Thanks to the InApp functionalities (from version 4.18.0 ), it is possible to indicate that the inApp is displayed or pressed a maximum number of times, or if in the case of the popUp, after performing an action , such as pressing the close button, is not shown again. To do this we could do the following within the inAppGet method that we have seen previously:
InAppIndigitall.showCustomInApp(
context,
inAppConfiguration,
"YOUR_BANNER_CODE",
new InAppCallback() {
@Override
public void onSuccess(@NonNull InApp inApp) {
//Show inApp
}
@Override
public void onFail(@NonNull InAppErrorModel errorModel) {
//InApp was expired
}
});
Actions to count clicks or to not show InApp anymore
For the case of what we call Dismiss Forever, once the action is performed, this method must be called:
PopUpUtils.INSTANCE.addNewInAppToDismissForever(context, inApp);
To send statistics, you have to send when an inApp was printed and when was clicked, you must add the following:
//inApp is showed
EventUtils.sendEventPrint(context, inApp);
// click inApp
EventUtils.sendEventClick(context, inApp);
InApp info errors
List of all possible errors from inApp, and messages from callbacks:
INAPP_ERROR = 2000 -> "InApp error"
INAPP_NOT_APPKEY = 2002 -> "AppKey was not configurated"
INAPP_CONTENT_MESSAGE = 2003 -> "InApp error with content"
INAPP_TOPIC_EMPTY = 2004 -> "There is no inApp topic subscription"
INAPP_CAMPAIGN_NOT_EXIST = 2403 -> "Campaign doesn't exist with the code"
INAPP_SHOW_INAPP_ERROR = 2100 -> "Show inApp error"
INAPP_POPUP_ERROR = 2200 -> "Popup error"
INAPP_SHOW_POPUP_ERROR = 2300 -> "Show popup error"
INAPP_WAS_EXPIRED = 2101 -> "InApp was cache expired"
INAPP_WAS_SHOWN_MANY_TIMES = 2102 -> "InApp was shown many times"
INAPP_WAS_CLICKED_MANY_TIMES = 2103 -> "InApp was clicked many times"
INAPP_FORM_TYPE_NOT_CORRECT = 2120 -> "Input type is not correct"
INAPP_FORM_FIELD_IS_EMPTY = 2121 -> "Field is empty"
POPUP_WAS_EXPIRED = 2301 -> "Popup was cache expired"
POPUP_WAS_SHOWN_MANY_TIMES = 2302 -> "Popup was shown many times"
POPUP_WAS_CLICKED_MANY_TIMES = 2303 -> "Popup was clicked many times"
POPUP_DISMISSED_FOREVER = 2304 -> "Popup was dismissed forever"