Integration

🚧

InApp v2

v2 tab in the code blocks is only for the latest versions of the SDK, which are in the testing phase. It will be availabe soon.

Banner format

Below 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 info.

Create a WebView view in your layouts. The size must match what you have defined in the indigitall console. Remember to translate the units from PX to DP.

If it is configured in the console that the banner is hidden for X seconds, you have to add to the call the activity in which the inApp is located and add the callback didDismissed where it will indicate that the established time has elapsed, returning the web the inApp code so that you can, for example, hide it.

One single banner

You can follow the example below:

<WebView
    android:id="@+id/myBanner"
    android:layout_width="230dp"
    android:layout_height="33.33dp"
/>

Instantiate the In-App message using the showInApp method.

WebView view = findViewById(R.id.myBanner);

Indigitall.showInApp(getContext(), "myBanner_CODE", view, new ShowInAppCallback() {
    @Override
    public void onLoad(String inAppCode, WebView webView) {
        Log.d("In-App loaded: ", inAppCode);
    }
    @Override
    public void onSuccess(InApp inApp) {
        Log.d("In-App: ", inApp);
    }
    @Override
    public void onFail(String inAppCode, WebView webView, String message) {}
});

// If it is configured in the campaign so that the banner is hidden at X seconds:

Indigitall.showInApp(getContext(), "myBanner_CODE", view, new InAppCallback() {
    @Override
    public void onLoad(String inAppCode, WebView webView) {
        Log.d("InApp loaded: ", inAppCode);
    }
    @Override
        public void onSuccess(InApp inApp) {
            Log.d("In-App: ", inApp);
        }
    @Override
    public void onFail(String inAppCode, WebView webView, String error) {

    }

    @Override
    public void onShowTimeFinished(String inAppCode, WebView webView, int showTime) {
        super.onShowTimeFinished(inAppCode, webView, showTime);        
    }
});
InAppIndigitall.showInApp(
  context, 
  "myBanner_CODE", 
  view,
  null)


InAppConfiguration.Builder inAppConfig = new InAppConfiguration.Builder("YOUR_APP_KEY");
inAppConfig.setUrlInAppApi("URL_INAPP_V2");
inAppConfig.build();

InAppIndigitall.showInApp(
  context,
  inAppConfig,
  "myBanner_CODE", 
  view,
  new ShowInAppCallback() {
    @Override
    public void onLoad(String s, WebView webView) {
      log.d("InApp Loaded ").writeLog();
    }

    @Override
    public void onFail(String s, WebView webView, String s1) {
      log.d("InApp onFail " + s1).writeLog();
    }

    @Override
    public void onShowTimeFinished(String s, WebView webView, int i) {
      log.d("InApp onShowTimeFinished ").writeLog();
    }

    @Override
    public void didClicked() {
      super.didClicked();
      log.d("InApp didClicked ").writeLog();
    }

    @Override
    public void didClosed() {
      super.didClosed();
      log.d("InApp didClosed ").writeLog();
    }

    @Override
    public void didExpired(InApp inApp, InAppErrorModel errorModel) {
      super.didExpired(inApp, errorModel);
      log.d("InApp didExpired ").writeLog();
    }

    @Override
    public void didClickOut(InApp inApp, InAppErrorModel errorModel) {
      super.didClickOut(inApp, errorModel);
      log.d("InApp didClickOut " ).writeLog();
    }

    @Override
    public void didShowManyTimes(InApp inApp, InAppErrorModel errorModel) {
      super.didShowManyTimes(inApp, errorModel);
      log.d("InApp didShowManyTimes ").writeLog();
    }

    @Override
    public void didDismissed() {
      super.didDismissed();
      log.d("InApp didDismissed ").writeLog();
    }

    @Override
    public void didDismissForever(InApp inApp, InAppErrorModel errorModel) {
      super.didDismissForever(inApp, errorModel);
      log.d("InApp didDismissForever ").writeLog();
    }

    @Override
    public void onSuccess(InApp inapp) {
      super.onSuccess(inapp);
      log.d("InApp onSuccess ").writeLog();
    }
  }

Multiple banner

You can follow the example below:

<WebView
    android:id="@+id/myBanner"
    android:layout_width="230dp"
    android:layout_height="33.33dp"
/>
<WebView
    android:id="@+id/otherBanner"
    android:layout_width="250dp"
    android:layout_height="36dp"
/>

Instantiate In-App messages using the showInApp method.

ArrayList<WebView> views = new ArrayList<>();
views.add(findViewById(R.id.myBanner));
views.add(findViewById(R.id.otherBanner));

ArrayList<String> codes = new ArrayList<>();
codes.add("myBanner_CODE");
codes.add("otherBanner_CODE");

Indigitall.showMultipleInApp(getContext(), codes, views, new ShowInAppCallback() {
    @Override
    public void onLoad(String inAppCode, WebView webView) {
        Log.d("In-App loaded: ", inAppCode);
    }
    @Override
    public void onSuccess(InApp inApp) {
        Log.d("In-App: ", inApp);
    }
    @Override
    public void onFail(String inAppCode, WebView webView, String message) {}
});

// If it is configured in the campaign so that the banner is hidden at X seconds:
Indigitall.showMultipleInApp(getContext(), inAppCodeList, webViewList, new InAppCallback() {
    @Override
    public void onLoad(String inAppCode, WebView webView) {
        Log.d("InApp loaded: ", inAppCode);
    }
    @Override
    public void onSuccess(InApp inApp) {
        Log.d("In-App: ", inApp);
    }

    @Override
    public void onFail(String inAppCode, WebView webView, String error) {}

    @Override
    public void onShowTimeFinished(String inAppCode, WebView webView, int showTime) {
        super.onShowTimeFinished(inAppCode, webView, showTime);
        Log.d("InApp onShowTimeFinished " + inAppCode);
    }
});
InAppIndigitall.showMultipleInApp(
  context, 
  codeList, 
  viewList,
  null)


InAppConfiguration.Builder inAppConfig = new InAppConfiguration.Builder("YOUR_APP_KEY");
inAppConfig.setUrlInAppApi("URL_INAPP_V2");
inAppConfig.build();

InAppIndigitall.showMultipleInApp(
  context,
  inAppConfig,
  codeList, 
  viewList,
  new ShowInAppCallback() {
    @Override
    public void onLoad(String s, WebView webView) {
      log.d("InApp Loaded ").writeLog();
    }

    @Override
    public void onFail(String s, WebView webView, String s1) {
      log.d("InApp onFail " + s1).writeLog();
    }

    @Override
    public void onShowTimeFinished(String s, WebView webView, int i) {
      log.d("InApp onShowTimeFinished ").writeLog();
    }

    @Override
    public void didClicked() {
      super.didClicked();
      log.d("InApp didClicked ").writeLog();
    }

    @Override
    public void didClosed() {
      super.didClosed();
      log.d("InApp didClosed ").writeLog();
    }

    @Override
    public void didExpired(InApp inApp, InAppErrorModel errorModel) {
      super.didExpired(inApp, errorModel);
      log.d("InApp didExpired ").writeLog();
    }

    @Override
    public void didClickOut(InApp inApp, InAppErrorModel errorModel) {
      super.didClickOut(inApp, errorModel);
      log.d("InApp didClickOut " ).writeLog();
    }

    @Override
    public void didShowManyTimes(InApp inApp, InAppErrorModel errorModel) {
      super.didShowManyTimes(inApp, errorModel);
      log.d("InApp didShowManyTimes ").writeLog();
    }

    @Override
    public void didDismissed() {
      super.didDismissed();
      log.d("InApp didDismissed ").writeLog();
    }

    @Override
    public void didDismissForever(InApp inApp, InAppErrorModel errorModel) {
      super.didDismissForever(inApp, errorModel);
      log.d("InApp didDismissForever ").writeLog();
    }

    @Override
    public void onSuccess(InApp inapp) {
      super.onSuccess(inapp);
      log.d("InApp onSuccess ").writeLog();
    }
  }

Popup Format

Next 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.

Create a WebView view in your layouts. The size must match what you have defined in the indigitall console. Remember to translate the units from PX to DP.

ConstraintLayout view = findViewById(R.id.myPopupParentLayout)

Indigitall.showPopUp(view, getContext(), "myPopup_CODE", new ShowInAppCallback() {
    @Override
    public void onLoad(String inAppCode, WebView webView) {
        Log.d("In-App loaded: ", inAppCode);
    }
    @Override
    public void onSuccess(InApp inApp) {
        Log.d("In-App: ", inApp);
    }
    @Override
    public void onFail(String inAppCode, WebView webView, String message) {}

    @Override
    public void didClicked() {
        Log.d("popUp","didClicked")
    }

    @Override
    public void  didClosed() {
        Log.d("popUp","didClosed")
    }
    @Override
    public void  didDismissed() {
        Log.d("popUp","didDismissed")
    }
    @Override
    public void onShowTimeFinished(
        String inAppCode,
        WebView webView,
        int showTime
    ) {
        Log.d("popUp", "onShowTimeFinished")
    }
    @Override
    public void didDismissForever(InApp inApp, Error error) {
        Log.d("Popup", "didDismissForever ")
    }
});
InAppIndigitall.showPopUp(
  context, 
  "myBanner_CODE", 
  view,
  null)


InAppConfiguration.Builder inAppConfig = new InAppConfiguration.Builder("YOUR_APP_KEY");
inAppConfig.setUrlInAppApi("URL_INAPP_V2");
inAppConfig.build();

InAppIndigitall.showPopUp(
  context,
  inAppConfig,
  "myBanner_CODE", 
  view,
  new ShowInAppCallback() {
    @Override
    public void onLoad(String s, WebView webView) {
      log.d("InApp Loaded ").writeLog();
    }

    @Override
    public void onFail(String s, WebView webView, String s1) {
      log.d("InApp onFail " + s1).writeLog();
    }

    @Override
    public void onShowTimeFinished(String s, WebView webView, int i) {
      log.d("InApp onShowTimeFinished ").writeLog();
    }

    @Override
    public void didClicked() {
      super.didClicked();
      log.d("InApp didClicked ").writeLog();
    }

    @Override
    public void didClosed() {
      super.didClosed();
      log.d("InApp didClosed ").writeLog();
    }

    @Override
    public void didExpired(InApp inApp, InAppErrorModel errorModel) {
      super.didExpired(inApp, errorModel);
      log.d("InApp didExpired ").writeLog();
    }

    @Override
    public void didClickOut(InApp inApp, InAppErrorModel errorModel) {
      super.didClickOut(inApp, errorModel);
      log.d("InApp didClickOut " ).writeLog();
    }

    @Override
    public void didShowManyTimes(InApp inApp, InAppErrorModel errorModel) {
      super.didShowManyTimes(inApp, errorModel);
      log.d("InApp didShowManyTimes ").writeLog();
    }

    @Override
    public void didDismissed() {
      super.didDismissed();
      log.d("InApp didDismissed ").writeLog();
    }

    @Override
    public void didDismissForever(InApp inApp, InAppErrorModel errorModel) {
      super.didDismissForever(inApp, errorModel);
      log.d("InApp didDismissForever ").writeLog();
    }

    @Override
    public void onSuccess(InApp inapp) {
      super.onSuccess(inapp);
      log.d("InApp onSuccess ").writeLog();
    }
  }

If you want to customize the icon to close the Popup, you can do it with the following method to which you can pass a custom ImageButton , if you wanted to use our icon, just pass a null. The closeIconDisabled parameter is in case you don't want to show any icon, setting it to true to hide it or false to show it.

ConstraintLayout view = findViewById(R.id.myPopupParentLayout)

ImageButton myImageButton = ImageButton(context);
.
.//set ImageButton params
.
boolean closeIconDisabled = false

Indigitall.showPopUp(view, getContext(), "myPopup_CODE", myImageButton, closeIcon, new ShowInAppCallback() {
    @Override
    public void onLoad(String inAppCode, WebView webView) {
        Log.d("In-App loaded: ", inAppCode);
    }
    @Override
    public void onSuccess(InApp inApp) {
        Log.d("In-App: ", inApp);
    }
    @Override
    public void onFail(String inAppCode, WebView webView, String message) {}

    @Override
    public void didClicked() {
        Log.d("popUp","didClicked")
    }

    @Override
    public void  didClosed() {
        Log.d("popUp","didClosed")
    }
    @Override
    public void  didDismissed() {
        Log.d("popUp","didDismissed")
    }
    @Override
    public void didDismissForever(InApp inApp, Error error) {
        Log.d("popUp", "didDismissForever ")
    }
});
ConstraintLayout view = findViewById(R.id.myPopupParentLayout)

ImageButton myImageButton = ImageButton(context);
.
.//set ImageButton params
.
boolean closeIconDisabled = false

InAppIndigitall.showPopUp(
  view,
  context,
  "myPopup_CODE",
  myImageButton,
  closeIcon,
  null)