addContactsToGroup

abstract fun addContactsToGroup(groupId: String?, contactIds: List<String?>, listener: RainbowListener<Unit, List<RainbowError<Unit>>>? = null)

Adds multiple contacts to a specific group.

This method allows you to add a list of contacts, identified by contactIds, to a group specified by groupId. Each contact in the list is added to the group, and the group's details are updated in the groups property.

If the groupId is null or empty, or if the contactIds list is empty, the method returns immediately, and the listener's onError method is triggered with an appropriate error message.

For each contact that fails to be added to the group, an individual RainbowError is added to the list of errors passed to the listener's onError method.

If all contacts are successfully added to the group, the listener's onSuccess method is called to indicate that the operation was completed successfully.

Parameters

groupId

The unique identifier of the group to which the contacts will be added. If null or empty, the method returns immediately, and the listener's onError method is called.

contactIds

A list of unique identifiers for the contacts to add to the group. If the list is empty, the method returns immediately, and the listener's onError method is called. Any null or empty IDs in the list will be ignored.

listener

An optional RainbowListener that will be notified with the result of the add operation. If any contacts fail to be added, the listener's onError method will be called with a list of RainbowError objects. On successful addition of all contacts, the listener's onSuccess method is called.