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 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:

Notificare.shared.authentication().fetchUserPreferences { result in

}

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

Notificare.shared.authentication().fetchUserSegments { result in

}

To add a user to a segment, invoke one of the methods below:

//
// With a user segment
//
let segment: NotificareUserSegment
Notificare.shared.authentication().addUserSegment(segment) { result in

}

//
// With a user preference + option
//
let option: NotificareUserPreference.Option
let preference: NotificareUserPreference
Notificare.shared.authentication().addUserSegmentToPreference(option: option, to: preference) { result in

}

To remove a user from a segment, invoke one of the methods below:

//
// With a user segment
//
let segment: NotificareUserSegment
Notificare.shared.authentication().removeUserSegment(segment) { result in

}

//
// With a user preference + option
//
let option: NotificareUserPreference.Option
let preference: NotificareUserPreference
Notificare.shared.authentication().removeUserSegmentFromPreference(option: option, from: preference) { result in

}

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