Advanced Settings

indigitall SDK for Segments clicking here

Segments / Topics

Our SDK allows you to classify users into different customizable groups. This is very useful for:

  • Implement a preferences screen so that the user can choose the topics for which they want to receive notifications.
  • Label according to the navigation or actions that the user performs.
  • Segment communications according to whether the user has identified or is anonymous.
  • Segment based on language, culture, customer category, or based on any other criteria you need.

Remember that you must first define the groups you want to work with in the indigitall console (Tools> Topics).

List groups

Use the topicsList method to get the list of groups that are configured in your indigitall project. The callback of this method receives as a parameter an array of Topics, which contains the information of all the available groups, as well as a flag that indicates whether the user is included in any of them.

InAppIndigitall.topicsListWith { topics in
            //get codes
        }, onError: { (error) in
            //print error
        }
[InAppIndigitall topicsListWithOnSuccess:^(NSArray<INInAppTopic *> * _Nonnull topics) {
        //get topics
    } onError:^(INError * _Nonnull error) {
        //print error
    }];

List groups from console

This method can be customized with the following options:

  • inAppConfig (InAppConfiguration): Configuration object.
    • appKey (string, required): Application key.
    • urlInAppApi (string, optional): Custom InApp API URL. Only required if you work with a custom cloud environment.
  • limit: Defines the number of topics that will be returned on each page. The minimum allowed value is 20.

When calling the method, you will receive the topics in a paginated format. This means you can check the current page, view the available topics, and continue loading additional pages until there are no more results.

In case of error, the method provides an error callback so you can handle the issue appropriately.

let inAppConfig = INInAppConfig() 
inAppConfig.appKey = "YOUR_APP_KEY"
inAppConfig.domainInApp = "CUSTOM_DOMAIN"// Optional: only if you use a custom cloud
Indigitall.inAppTopicsListFromConsole(with: inAppConfig, 
                                      limit: 20 // Minimum value is 20
) { pageTopic in
    print("total InApp from console topics: \(pageTopic.topics.count)"
    if (pageTopic.hasNextPage()) {
        pageTopic.loadNextPage()
    } else {
        print("No more InApp topics available")
    }
 
 } onError: { error in
        print("error inapp topics: \(error)")
 }

#import <Indigitall/Indigitall.h>

INInAppConfig *inAppConfig = [[INInAppConfig alloc] init];
inAppConfig.appKey = @"YOUR_APP_KEY";
inAppConfig.domainInApp = @"CUSTOM_DOMAIN"; // Optional: only if you use a custom cloud

[Indigitall inAppTopicsListFromConsoleWithConfig:inAppConfig
                                           limit:20  // Minimum value is 20
                                          success:^(INInAppPageTopic * _Nonnull pageTopic) {
    
    NSLog(@"total InApp from console topics: %lu", (unsigned long)pageTopic.topics.count);
    
    if ([pageTopic hasNextPage]) {
        [pageTopic loadNextPage];
    } else {
        NSLog(@"No more InApp topics available");
    }
    
} onError:^(NSError * _Nonnull error) {
    NSLog(@"error inapp topics: %@", error);
}];
<

When the request is successful, the onSuccess callback provides an INInAppPageTopic object.

  • Fields
    • topics (ArrayList?): List of topics included in the current page.
    • currentPage (Int): Current page index. Starts at 0.
    • total (Int): Total number of topics available across all pages.
    • pageSize (Int): Maximum number of topics per page, obtained from configuration.
    • totalPages (Double): Total number of pages available, calculated as total / pageSize.
  • Methods
    • hasNextPage(): Boolean
      Returns true if there are additional pages of topics to load.
    • loadNextPage()
      Loads the next page of topics. If there are no more pages available, it will call onError with the code INAPP_TOPIC_LIST_NO_MORE_PAGES.

Manage subscription

To manage the device subscription to one or more groups, there are two methods: topicsSubscribe and topicsUnsubscribe.

Optionally, both receive a TopicsCallback object as the third parameter, which will return the list of all Topic in the project.

InAppIndigitall.topicsSubscribe(withArrayString: []) { topics in
       //get codes     
        }
InAppIndigitall.topicsSubscribe(withTopicArray: []) { topics in
       //get codes     
        }	

InAppIndigitall.topicsUnSubscribe(withArrayString: []) { topics in
            //get codes
        }
InAppIndigitall.topicsUnSubscribe(withTopicArray: []) { topics in
            //get codes
        }
[InAppIndigitall topicsSubscribeWithArrayString:@[topics] onSuccess:^(NSArray<NSString *> * _Nonnull topics) {
   //get codes
} onError:^(INError * _Nonnull error) {
   //print error
}];

[InAppIndigitall topicsUnSubscribeWithArrayString:@[topics] onSuccess:^(NSArray<NSString *> * _Nonnull topics) {
		//get codes
} onError:^(INError * _Nonnull error) {
	//print error
}];

Profile

You can set the profile variable when displaying an InApp. This allows you to add an additional type of filter — for example, if you want to control the display of the InApp for different users within the same campaign, without needing to create multiple ones with the same schema code.


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

Custom Time Slide for Carousel

You can set the custom time slide variable when displaying an InApp with a carousel.
This allows you to define the interval (in milliseconds) that each image will be shown before automatically changing to the next one.

var config: INInAppConfig!
config = InAppConfig.init()
config.appKey= "YOUR_APP_KEY"
//only Enterprise cases
config.domainInApp = " https://{{cloud}}.device-api.indigitall.com/v2"
config.customTimeSlideForCarousel = 3000 // 3 seconds per image

Default value: if not set, the carousel will use 10000ms.

  • Custom value: you can pass any positive integer (milliseconds). For example:

1000 → 1 second

3000 → 3 seconds

5000 → 5 seconds