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 GetInAppcallback() {
@Override
public void didClickOut(@NonNull InApp inApp, @NonNull InAppErrorModel errorModel) {
// InApp click many times
}
@Override
public void didShowManyTimes(@NonNull InApp inApp, @NonNull InAppErrorModel errorModel) {
//InApp did show many times
}
@Override
public void didDismissForever(@NonNull InApp inApp, @NonNull InAppErrorModel errorModel) {
//InApp was dismiss forever
}
@Override
public void notFound() {
InAppIndigitall.inAppGet(
context,
inAppCode,
object : InAppCallback(context) {
override fun onSuccess(inApp: InApp) {
//showw inApp
}
override fun onFail(errorModel: ErrorModel) {
//log error
}
})
}
@Override
public void didFound(@NonNull InApp inApp) {
//Show inApp
}
@Override
public void didExpired(@NonNull InApp inApp, @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);
In the event that you want to show an inApp only if you make 'x' clicks or clicks on it, you must add the following:
boolean isAppAction = inApp.getProperties().getAction().getType() == InAppAction.Type.APP;
Boolean result = InAppUtils.INSTANCE.inAppWasClicked(context, inApp, intent, isAppAction);
- In this method the statistics of the click are sent, not just the click counter, so it returns a boolean just to confirm that everything has gone correctly.