Integration

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.

One single banner
Create a UIView view on your storyboard. 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 iOS points.

@IBOutlet weak var myBanner: UIView!
@property (weak, nonatomic) IBOutlet UIView *myBanner;

Instantiate In-App messages using the showInApp method.

Indigitall.show(inApp: "myBanner_CODE", view: myBanner) { actions in
    print("Did touch with actions")
} onShowTimeFinished: { inApp, showTime) in
    //DO SOMETHING
} didExpired: { inApp, error in
    //DO SOMETHING
} didShowMoreThanOnce: { inApp, error in
    //DO SOMETHING
} didClickOut: { inApp, error in
    //DO SOMETHING
} success: { inApp in
    //DO SOMETHING
} failed: { error in
    // LOG ERROR
}
[Indigitall showInApp:myBanner_CODE view:myBanner didTouchWithAction:(INInAppAction *action^{
    // DO SOMETHING    
} onShowTimeFinished:^(INInApp * _Nonnull inApp, int showTime) {
    // DO SOMETHING    
} didExpired:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    // DO SOMETHING    
} didShowMoreThanOnce:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    // DO SOMETHING    
} didClickOut:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    // DO SOMETHING    
} success:^(INInApp * _Nonnull) {
    // DO SOMETHING    
} failed:^(INError * _Nonnull error) {
    // LOG ERROR
}];

Multiple banner
Create multiple views of UIView on your storyboard. 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 iOS points.

@IBOutlet weak var viewBanner: UIView!
    @IBOutlet weak var viewBannerTwo: UIView!
    @IBOutlet weak var viewBannerThree: UIView!
    ...

Create an array of the views and codes of the inApp that you define in the console and instantiate the In-App messages using the showMultipleInApp method.

var viewList = [UIView]()
    viewList.append(viewBanner)
    viewList.append(viewBannerTwo)
    viewList.append(viewBannerThree)

    var webViewCodes = [String]()
    webViewCodes.append("myInApp_code_banner")
    webViewCodes.append("myInApp_code_banner_two")
    webViewCodes.append("myInApp_code_banner_three")

Indigitall.showMultiple(inApp: webViewCodes, listView: viewList) { inApp, view, action in
        print("INAPP didTouch: \(inApp.inAppId) y vista: \(view)")
    } onShowTimeFinished: { (inApp, view, showTime) in
        print("INAPP onShowTimeFinished: \(inApp.inAppId) y vista: \(view) en \(showTime)ms")
        view.isHidden = true
    } didExpired: { inApp, error in
        print("INAPP didExpired: \(inApp.inAppId) error: \(error.message)")
    } didShowMoreThanOnce: { inApp, error in
        print("INAPP didShowMoreThanOnce: \(inApp.inAppId) error: \(error.message)")
    } didClickOut: { inApp, error in
        print("INAPP didClickOut: \(inApp.inAppId) error: \(error.message)")
    } success: { inApp, view in
        print("INAPP success: \(inApp.inAppId) y vista: \(view)")
    } failed: { error in
        print("ERROR: \(error.message)")
    }
NSMutableArray <UIView *> *viewList;
    [viewList addObject:yourCustomView];
    [viewList addObject:yourCustomViewTwo];
    [viewList addObject:yourCustomViewThree];

    NSMutableArray <NSString *> *webViewCodes;
    [webViewCodes addObject:@"myInApp_code_banner"];
    [webViewCodes addObject:@"myInApp_code_banner_two"];
    [webViewCodes addObject:@"myInApp_code_banner_three"]; 

    [Indigitall showMultipleInApp:webViewCodes listView:viewList didTouchWithAction:^(INInApp * _Nonnull inApp, UIView * _Nonnull webView, INInAppAction *action) {
        // DO SOMETHING
    } onShowTimeFinished:^(INInApp * _Nonnull inApp, UIView * _Nonnull webView, int showtime) {
        // DO SOMETHING
    } didExpired:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
        // DO SOMETHING
    } didShowMoreThanOnce:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
        // DO SOMETHING
    } didClickOut:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
        // DO SOMETHING
    } success:^(INInApp * _Nonnull inapp, UIView * _Nonnull view) {
        // DO SOMETHING
    } failed:^(INError * _Nonnull error) {
        // LOG ERROR
    }];
}];

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.

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 iOS points.

Indigitall.showPopup("myInApp_code_popup", didAppear: {
    // DO SOMETHING
} didCancel: {
    print("Did cancel")
} didTouchWithAction: {
    print("Did touch")
} didDismissed: {
    print("Did dissmised")
} onShowTimeFinished: { inApp, showTime in
    print("Did onShowtimeFinished \(inApp.inAppId) on \(showTime)ms")
} didExpired: { inApp, error in
    print("Did didExpired")
} didShowMoreThanOnce: { inApp, error in
    print("Did didShowMoreThanOnce")
} didClickOut: { inApp, error in
    print("Did didClickOut")
} didDismissForever: { inApp, error in
    print("Did didDismissForever")
} failed: {error in
    print("Did failed \(error.description) with message: \(error.message)")
}
[Indigitall showPopup:@"myInApp_code_popup-Inapp" didAppear:^{
        // DO SOMETHING 
    } didCancel:^{
        // DO SOMETHING 
    } didTouchWithAction:^(INInAppAction *action){
        // DO SOMETHING 
    } didDismissed:^{
        // DO SOMETHING 
    } onShowTimeFinished:^(INInApp *inApp, int showTime){
        // DO SOMETHING 
    } didExpired:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } didShowMoreThanOnce:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } didClickOut:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } didDismissForever:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } failed:^(INError * _Nonnull error) {
       // LOG ERROR
    }];

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 UIButton , if you want 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.

let closeButton = UIButton()
.
.//set UIButton params
.
Indigitall.showPopup("myInApp_code_popup-InApp", closeIcon: closeButton, closeIconDisabled: false) {
        print("Did appear")
    } didCancel: {
        print("Did cancel")
    } didTouchWithAction: { action in
        print("Did didTouchWithAction")
    } didDismissed: {
        print("Did dissmised")
    } onShowTimeFinished: { inApp, showTime in
        print("Did onShowtimeFinished \(inApp.inAppId) on \(showTime)ms")
    } didExpired: { inApp, error in
        print("Did didExpired")
    } didShowMoreThanOnce: { inApp, error in
        print("Did didShowMoreThanOnce")
    } didClickOut: { inApp, error in
        print("Did didClickOut")
    } didDismissForever: { inApp, error in
        print("Did didDismissForever")
    } failed: {error in
        print("Did failed \(error.description) with message: \(error.message)")
    }
[Indigitall showPopup:@"myInApp_code_popup-InApp", closeIcon: closeButton, closeIconDisabled: false, didAppear:^{
        // DO SOMETHING 
    } didCancel:^{
        // DO SOMETHING 
    } didTouchWithAction:^(INInAppAction *action){
        // DO SOMETHING 
    } didDismissed:^{
        // DO SOMETHING 
    } onShowTimeFinished:^(INInApp *inApp, int showTime){
        // DO SOMETHING 
    } didExpired:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } didShowMoreThanOnce:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } didClickOut:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } didDismissForever:^(INInApp *inApp, INError *error){
        // DO SOMETHING 
    } failed:^(INError * _Nonnull error) {
       // LOG ERROR
    }];