Advanced Settings

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.

indigitall.InApp.topicList((topics) => {
    //DO SOMETHING
}, (error) => {
    //log error
});

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

//topics is typeof string[]
indigitall.InApp.topicsSubscribe([topicsCodes], (topics) => {
    //DO SOMETHING
}, (error) => {
    //log error
});
  
  //topics is typeof string[]
  indigitall.InApp.topicsUnsubscribe([topicsCodes], (topics) => {
    //DO SOMETHING
}, (error) => {
    //log error
});

LogIn and logOut

Once you have to initialize the SDK of Indigitall, it generates our identifier (deviceId) and be able to associate it with the custom ID that you associate to the device.

To perform the registration tasks, these two methods are used:

//User ID
indigitall.InApp.logIn("YOUR_ID", (hash)=>{
     //DO SOMETHING
}, (error)=>{
    //LOG ERROR
});

//Disconnection
indigitall.InApp.logOut(()=>{
    //DO SOMETHING
}, (error)=>{
    //LOG ERROR
});