SDK

Segmentation

This is an add-on feature of Notificare. You will need to subscribe to the Users & Authentication add-on and configure this service as described here. Once subscribed, before you can use this functionality, make sure you create User Preferences like explained here.

The following methods are also only available when users are authenticated. This functionality will allow you to create a rich user profile based on your users preferences, personal information, etc.

To get a list of preferences for a user, use the following method:

try {
  List<NotificareUserPreference> response = await notificare.fetchUserPreferences();
  //Handle Success
} catch(e){
  //Handle Error
}

This method will return a list of all User Preferences created for your app. You can then add or remove users to/from segments in each preference.

To add the user to a segment in a preference, invoke the method below:

try {
  await notificare.addSegmentToUserPreference(segment, preference);
  //Handle Success
} catch(e){
  //Handle Error
}

To remove a user from a segment in a preference, invoke the method below:

try {
  await notificare.removeSegmentFromUserPreference(segment, preference);
  //Handle Success
} catch(e){
  //Handle Error
}

This functionality will allow you to categorize your users based on their preferences. You can then easily create campaigns using these segments.