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. Full screen content that forces the user to click or discard the information.
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.
Define a hybridWeview in the .xml file. The size must match what you have defined in the indigitall console ( Tools> In-App / In-Web Schemas ). Remember to translate the units from PX to _inches.
//160 units is 1 inch. 64 units is 1 cm
<local:HybridWebView x:Name="hybridWebView" InAppId="Billboard" WidthRequest="x" HeightRequest="y"/>
Instantiate In-App messages using the ShowInApp method.
indigitall.ShowInApp(webViewHybrid, "INAPP_CODE", (inAppId, webview) =>
{
//DO SOMETHING
},(inAppId, webview, errorMessage)=>
{
//LOG ERROR
}, (inAppCode, webView) =>
{
//DidDismissed
});
Android Xamarin Classics
Create a WebView view in your layouts. The size must match what you have defined in the indigitall console ( Tools> In-App / In-Web Schemas ). Remember to translate the units from PX to DP.
<android.webkit.WebView
android:id="@+id/myBanner"
android:layout_width="230dp"
android:layout_height="33.33dp"
/>
<android.webkit.WebView
android:id="@+id/otherBanner"
android:layout_width="250dp"
android:layout_height="36dp"
/>
Instantiate In-App messages using the showInApp method.
var myBanner = FindViewById<Android.Webkit.WebView>(Resource.Id.myBanner);
var otherBanner = FindViewById<Android.Webkit.WebView>(Resource.Id.otherBanner);
var views = new List<Android.Webkit.WebView>();
views.Add(myBanner);
views.Add(otherBanner);
var codes = new List<>();
codes.Add("myBanner_CODE");
codes.Add("otherBanner_CODE");
Indigitall.showInApp(getContext(), codes, views, new ShowInAppCallback() {
@Override
public void onLoad(String inAppCode, WebView webView) {
Log.d("In-App loaded: ", inAppCode);
}
@Override
public void onFail(String inAppCode, WebView webView, String message) {}
@Override
public void didDismissed(String inAppCode, WebView webView) {
super.didDismissed(inAppCode,webView);
Log.d("InApp didDismissed " + inAppCode);
}
});
iOS Xamarin Classics
Create a WebView view on the storyBoard. The size must match what you defined in the indigitall console ( Tools > In-App / In-Web Schemas ). Remember to translate the units from PX to iOS points.
Instantiate In-App messages using the method, whether you want to show one inapp or several of them.
IndigitallXamarin.Indigitall.ShowInApp(uiWebviewIos, "Billboard", (inAppId, webView) =>
{
// DO SOMETHING
}, (inAppId, webView, message) =>
{
// DO SOMETHING
},()=>{
//DidDismissed: DO SOMETHING
});
var views = new List<UIView>();
views.Add(myBanner);
views.Add(otherBanner);
var codes = new List<>();
codes.Add("myBanner_CODE");
codes.Add("otherBanner_CODE");
IndigitallXamarin.Indigitall.ShowMultipleInApp(views, codes, (inAppId, webView) =>
{
// DO SOMETHING
}, (inAppId, webView, message) =>
{
// DO SOMETHING
}, (inApp, webView) =>{
//DidDismissed: DO SOMETHING
});
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.
Instantiate the In-App messages from the hybridWebView using the ShowPopUp method.
indigitall.ShowPopUp(view, "INAPP_CODE", (inAppId, webview) =>
{
//DO SOMETHING
},(inAppId, webview, errorMessage)=>
{
//LOG ERROR
}, () =>
{
Console.WriteLine("DidClick");
}, () =>
{
Console.WriteLine("DidClose");
}, () =>
{
Console.WriteLine("DidDismissed");
});
//In the event that you want to customize the close icon of the Popup,
//you can use the following method, in which you add a custom UIButton, or use the ** closeIconDisabled ** variable to show none:
indigitall.ShowPopUp(view, "INAPP_CODE", myIcon, false, (inAppId, webview) =>
{
//DO SOMETHING
},(inAppId, webview, errorMessage)=>
{
//LOG ERROR
}, () =>
{
Console.WriteLine("DidClick");
}, () =>
{
Console.WriteLine("DidClose");
}, () =>
{
Console.WriteLine("DidDismissed");
});
Android Xamarin Classics
Create a WebView view in your layouts. The size must match what you have defined in the indigitall console ( Tools> In-App / In-Web Schemas ). Remember to translate the units from PX to DP.
var view = findViewById(R.id.myPopup)
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 onFail(String inAppCode, WebView webView, String message) {}
});
//In the event that you want to customize the close icon of the Popup, you can
//use the following method, in which you add a custom UIButton, or use the ** closeIconDisabled ** variable to show none:
Indigitall.ShowPopUp(view, getContext(), "myPopup_CODE", myIcon, false, new ShowInAppCallback() {
@Override
public void onLoad(String inAppCode, WebView webView) {
Log.d("In-App loaded: ", inAppCode);
}
@Override
public void onFail(String inAppCode, WebView webView, String message) {}
});
iOS Xamarin Classics
Create a WebView view on the storyBoard. The size must match what you defined in the indigitall console ( Tools > In-App / In-Web Schemas ). Remember to translate the units from PX to iOS points.
IndigitallXamarin.Indigitall.ShowPopup("myPopup_CODE", () =>
{
// DO SOMETHING didAppear
}, () =>
{
// DO SOMETHING didCancel
}, () =>
{
// DO SOMETHING didClicked
},(error)=> {
//Log Error
});
//In the event that you want to customize the close icon of the Popup,
//you can use the following method, in which you add a custom UIButton, or use the ** closeIconDisabled ** variable to show none:
IndigitallXamarin.Indigitall.ShowPopup("myPopup_CODE", myIcon, false, () =>
{
// DO SOMETHING didAppear
}, () =>
{
// DO SOMETHING didCancel
}, () =>
{
// DO SOMETHING didClicked
},(error)=> {
//Log Error
});