tencent cloud

All product documents
Chat
Last updated: 2025-04-16 15:00:22
Flutter
Last updated: 2025-04-16 15:00:22

Feature Description

To group friends into categories such as "Classmates at university" and "Coworkers", call the following APIs.

Friend List

Creating a friend list

Call the createFriendGroup API (Details) to create a friend list.
Sample code:
// Create a friend list and add a friend to the list
V2TimValueCallback<List<V2TimFriendOperationResult>> friendgroups = await friendshipManager.createFriendGroup(groupName: "Friend list 1",userIDList: ['user1']);

Deleting a friend list

Call the deleteFriendGroup API (Details) to delete a friend list.
Sample code:
// Delete a friend list
V2TimCallback deleteFriendsgroup = await friendshipManager.deleteFriendGroup(groupNameList: ['Friend list 1']);

Renaming a friend list

Call the renameFriendGroup API (Details) to rename a friend list.
Sample code:
// Rename a friend list
V2TimCallback rename = await friendshipManager.renameFriendGroup(newName: "New friend list 1",oldName: 'Friend list 1');

Getting a friend list

Call the getFriendGroups API (Details) to get a friend list.
Sample code:
// Get the information of a friend list by list name
V2TimValueCallback<List<V2TimFriendGroup>> friendGrous = await friendshipManager.getFriendGroups(groupNameList: ['Friend list 1']);

Adding a friend to a list

Call the addFriendsToFriendGroup API (Details) to add a friend to a list.
Sample code:
// Add a friend to a friend list
V2TimValueCallback<List<V2TimFriendOperationResult>> addToFrindgroups = await friendshipManager.addFriendsToFriendGroup(groupName: "Friend list 1",userIDList: ['user1']);

Removing a friend from a list

Call deleteFriendsFromFriendGroup (Details) to remove a friend from a list.
Sample code:
// Remove a friend from a list
V2TimValueCallback<List<V2TimFriendOperationResult>> deletefromFriendsGrousps = await friendshipManager.deleteFriendsFromFriendGroup(groupName: "Friend list 1", userIDList: ['user1']);

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon