Integration

🚧

In order to integrate the v2 version of inApp, please contact the indigitall support team

🚧

SDK versions < 6.0.0

Config class of push initialization is named InAppConfig.

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.

var config: INInAppConfig!
config = InAppConfig.init()
config.appKey= "YOUR_APP_KEY"
//only Enterprise cases
config.domainInApp = "https://device-api.indigitall.com/v2"

InAppIndigitall.showInAppWith(inAppId: "myBanner_CODE", view: myBanner) { inApp in
   print("INAPP: \(inApp.inAppId)")            
} failed: { error in
   print("ERROR: \(error.message)")            
}
        
InAppIndigitall.showInApp(withAppKey: "YOUR_APP_KEY", inAppId: "myBanner_CODE", view: myBanner) { inApp in
   print("INAPP: \(inApp.inAppId)")           
} failed: { error in
   print("ERROR: \(error.message)")            
}
        
InAppIndigitall.showInApp(with: config, inAppId: "myBanner_CODE", view: myBanner) { action in
    print("Did Touch \(action.app)")
} onShowTimeFinished: { inApp, time in
    print("Did onShowTimeFinished")
} didExpired: { inApp, error in
    print("Did didExpired")
} didShowManyTimes: { inApp, error in
    print("Did onShowTimeFinished")
} didClickOut: { inApp, error in
    print("INAPP didClickOut: \(inApp.inAppId)")
} success: { inApp in
    print("INAPP: \(inApp.inAppId)")
} failed: { error in
    print("ERROR: \(error.message)")
} formFailed: { errorList in
   for (error) in errorList {
       print("ERROR formFailed code: \(error.errorCode.rawValue) message: \(error.message) description:\(error.descriptionMessage)")
   }
}
INInAppConfig *config = [[INInAppConfig alloc]init];
config.appKey = @"YOUR_APP_KEY";
//only enterprises uses
[config setDomainInApp:@"https://device-api.indigitall.com/v2"];
    
[InAppIndigitall showInAppWithInAppId:@"myBanner_CODE" view:myBanner success:^(INInApp * _Nonnull) {
       //DO SOMETHING  
} failed:^(INError * _Nonnull error) {
     //DO SOMETHING
}];

[InAppIndigitall showInAppWithAppKey:@"YOUR_APP_KEY" inAppId:@"myBanner_CODE" view:myBanner success:^(INInApp * _Nonnull) {
     //DO SOMETHING
} failed:^(INError * _Nonnull error) {
     //DO SOMETHING
}];

[InAppIndigitall showInAppWithConfig:config InAppId:@"myBanner_CODE" view:myBanner didTouchWithAction:^(INInAppAction * _Nonnull action) {
     //DO SOMETHING
} onShowTimeFinished:^(INInApp * _Nonnull inApp, int showTime) {
     //DO SOMETHING
} didExpired:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
     //DO SOMETHING
} didShowManyTimes:^(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) {
     //DO SOMETHING
}];

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

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")
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"];

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 config: INInAppConfig!
config = InAppConfig.init(appKey: "YOUR_APP_KEY")
//only Enterprise cases
config.domainInApp = "https://device-api.indigitall.com/v2"

InAppIndigitall.showMultipleInAppWithList(inAppId: webViewCodes, listView: viewList) { inApp, view in
    //Do something
} failed: { error in
    //Do something    
}

InAppIndigitall.showMultipleInApp(withAppKey: "YOUR_APP_KEY", listInAppId: webViewCodes, listView: viewList) { inApp, view in
    //Do something
} failed: { error in
    //Do something
}

InAppIndigitall.showMultipleInApp(with: config, listInAppId: webViewCodes, listView: viewList) { inApp, view, action in
    //Did touch with action
} onShowTimeFinished: { inApp, view, time in
    //Do something
} didExpired: { inApp, error in
    //Do something
} didShowManyTimes: { inApp, error in
    //Do something
} didClickOut: { inApp, error in
    //Do something
} success: { inApp, view in
    //Do something
} failed: { error in
    //Do something
} formFailed: { errorList in
   for (error) in errorList {
       print("ERROR formFailed code: \(error.errorCode.rawValue) message: \(error.message) description:\(error.descriptionMessage)")
   }
}
INInAppConfig *config = [[INInAppConfig alloc]initWithAppKey:@"YOUR_APP_KEY"];
//only enterprise cases
[config setDomainInApp:@"https://device-api.indigitall.com/v2"];
    
[InAppIndigitall showMultipleInAppWithListInAppId:webViewCodes listView:viewList success:^(INInApp * _Nonnull inapp, UIView * _Nonnull view) {
    //Do something
} failed:^(INError * _Nonnull error) {
    //Do something
}];

[InAppIndigitall showMultipleInAppWithAppKey:@"YOUR_APP_KEY" listInAppId:webViewCodes listView:viewList success:^(INInApp * _Nonnull inapp, UIView * _Nonnull view) {
    //Do something
} failed:^(INError * _Nonnull error) {
    //Do something
}];

[InAppIndigitall showMultipleInAppWithConfig:config listInAppId:webViewCodes listView:viewList didTouch:^(INInApp * _Nonnull inApp, UIView * _Nonnull webView, INInAppAction * _Nonnull action) {
    //Do something
} onShowTimeFinished:^(INInApp * _Nonnull inApp, UIView * _Nonnull webView, int showtime) {
    //Do something
} didExpired:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    //Do something
} didShowManyTimes:^(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) {
    //Do something
} formFailed: ^(NSArray<INInAppError*> *error){
  //Do something
}];

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.

InAppIndigitall.showPopup(withPopupId: "myInApp_code_popup") {
    //do something
} didCancel: {
    //do something
} failed: { error in
    //do something
}

InAppIndigitall.showPopup(withAppKey: "YOUR_APP_KEY", popupId: "myInApp_code_popup") {
    //do something
} didCancel: {
    //do something
} failed: { error in
    //do something
} formFailed: { errorList in
   for (error) in errorList {
       print("ERROR formFailed code: \(error.errorCode.rawValue) message: \(error.message) description:\(error.descriptionMessage)")
   }
}
[InAppIndigitall showPopupWithPopupId:@"" didAppear:^{
    //do something
} didCancel:^{
    //do something
} failed:^(INError * _Nonnull error) {
    //do something
}];

[InAppIndigitall showPopupWithAppKey:@"" popupId:@"" didAppear:^{
    //do something
} didCancel:^{
    //do something
} failed:^(INError * _Nonnull error) {
    //do something
} formFailed: ^(NSArray<INInAppError*> *error){
  //Do something
}];

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.

If you want to close popup when it is clicked, you have to add on InApp configuration object, setClosePopupWhenClicked boolean param.

var config: INInAppConfig!
config = INInAppConfig.init(appKey: "YOUR_APP_KEY")
//only Enterprise cases
config.domainInApp = "https://device-api.indigitall.com/v2"
config.closePopupWhenClicked = true

InAppIndigitall.showPopup(with: config, popupId: "myInApp_code_popup", closeIcon: closeicon, closeIconDisabled: false) {
    //do something
} didCancel: {
    //do something
} didTouchWithAction: { action in
    //do something
} didDismissed: {
    //do something
} onShowTimeFinished: { inApp, time in
    //do something
} didExpired: { inApp, error in
    //do something
} didShowManyTimes: { inApp, error in
    //do something
} didClickOut: { inApp, error in
    //do something
} didDismissForever: { inApp, error in
    //do something
} failed: { error in
    //do something
} formFailed: { errorList in
   for (error) in errorList {
       print("ERROR formFailed code: \(error.errorCode.rawValue) message: \(error.message) description:\(error.descriptionMessage)")
   }
}
INInAppConfig *config = [[INInAppConfig alloc]initWithAppKey:@"YOUR_APP_KEY"];
//only enterprise cases
[config setDomainInApp:@"https://device-api.indigitall.com/v2"];
[config setClosePopupWhenClicked: true];
 
 
[InAppIndigitall showPopupWithConfig:config popupId:@"" closeIcon:closebutton closeIconDisabled:false didAppear:^{
     //DO SOMETHING
} didCancel:^{
    //DO SOMETHING
} didTouchWithAction:^(INInAppAction * _Nonnull action) {
    //DO SOMETHING
} didDismissed:^{
    //DO SOMETHING
} onShowTimeFinished:^(INInApp * _Nonnull inApp, int showTime) {
    //DO SOMETHING
} didExpired:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    //DO SOMETHING
} didShowManyTimes:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    //DO SOMETHING
} didClickOut:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    //DO SOMETHING
} didDismissForever:^(INInApp * _Nonnull inApp, INError * _Nonnull error) {
    //DO SOMETHING
} failed:^(INError * _Nonnull error) {
    //DO SOMETHING
} formFailed: ^(NSArray<INInAppError*> *error){
  //Do something
}];