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:

1
2
3
4
5
6
7
8
9
10
11
 Notificare.shared().fetchUserPreferences(new NotificareCallback<List<NotificareUserPreference>>() {
	@Override
	public void onSuccess(List<NotificareUserPreference> notificareUserPreferences) {

	}

	@Override
	public void onError(NotificareError notificareError) {

	}
}

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

1
2
3
4
5
6
7
8
9
10
11
Notificare.shared().userSegmentAddToUserPreference(preference.getPreferenceOptions().get(which).getUserSegmentId(), preference, new NotificareCallback<Boolean>() {
	@Override
	public void onSuccess(Boolean aBoolean) {

	}

	@Override
	public void onError(NotificareError notificareError) {

	}
});

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

1
2
3
4
5
6
7
8
9
10
11
Notificare.shared().userSegmentRemoveFromUserPreference(preference.getPreferenceOptions().get(which).getUserSegmentId(), preference, new NotificareCallback<Boolean>() {
	@Override
	public void onSuccess(Boolean aBoolean) {

	}

	@Override
	public void onError(NotificareError notificareError) {

	}
});

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