If the logged-in user has set confirmation for friend requests and another user sends a friend request to this user, the logged-in user will receive the friend request callback, and the IM SDK will notify the developer using this callback. If the same account has logged in on multiple terminals, each terminal will receive the callback.
Set the callback for setting friend requests as read
note
If you call setFriendApplicationRead to set the friend request list as read, you will receive this callback (mainly used for multi-device synchronization).
This callback is used for multi-terminal synchronization. For example, the same IM SDK account has logged in to devices A and B. When device A adds a friend, the IM SDK on device B will receive a friend addition notification, and the IM SDK will notify the developer using this callback.
This callback is used for multi-terminal synchronization. For example, the same IM SDK account has logged in to devices A and B. When device A adds a friend, the IM SDK on device B will receive a friend addition notification, and the IM SDK will notify the developer using this callback.
This callback is used for multi-terminal synchronization. For example, the same IM SDK account has logged in to devices A and B. When device A updates a friend's profile, the IM SDK on device B will receive a friend profile update notification, and the IM SDK will notify the developer via this callback.
If kTIMUserProfileAddPermission is set to kTIMProfileAddPermission_NeedConfirm in your profile, you will receive a friend request when someone adds you as a friend, and you can process the request through this API.
When using this API to modify the profile of a friend, see FriendProfileItem (in interface) for information about the fields that can be modified. You can modify multiple fields at a time. When modifying a custom field, you can add the prefix Tag_SNS_Custom_ to the entered key value. If you do not add this prefix, the SDK will automatically add this prefix.
Developers can use this interface to detect the friend relationship between a given UserID list and the current account. Please refer to the related content to detect friends. Check friends。
Friends information
This interface returns all friends information through callbackFriendProfile.
kTIMFriendProfileIdentifier = "friend_profile_identifier"; // String. Read-only. UserID of the friend. kTIMFriendProfileGroupNameArray = "friend_profile_group_name_array"; // Array string. Read-only. List of friend list names. kTIMFriendProfileRemark = "friend_profile_remark"; // String. Read-only. Friend remarks, which is 96 bytes at most. This field is empty if the API is called to obtain your own profile. kTIMFriendProfileAddWording = "friend_profile_add_wording"; // String. Read-only. Friend request reason. kTIMFriendProfileAddSource = "friend_profile_add_source"; // String. Read-only. Friend request source. kTIMFriendProfileAddTime = "friend_profile_add_time"; // Number. Read-only. Time when the friend was added. kTIMFriendProfileUserProfile = "friend_profile_user_profile"; // Object, [UserProfile](../../interfaces/interface_friendshipinterface.userprofile.html). Read-only. Personal profile of the friend. kTIMFriendProfileCustomStringArray = "friend_profile_custom_string_array"; // Array, [FriendProfileCustemStringInfo](). Read-only. [Custom friend fields](https://cloud.tencent.com/document/product/269/1501#.E8.87.AA.E5.AE.9A.E4.B9.89.E5.A5.BD.E5.8F.8B.E5.AD.97.E6.AE.B5).
Set the callback for friend requests.
If the logged-in user has set confirmation for friend requests and another user sends a friend request to this user, the logged-in user will receive the friend request callback, and the IM SDK will notify the developer using this callback. If the same account has logged in on multiple terminals, each terminal will receive the callback.