Skip to main content

addFriend

Feature Introduction

Description

Initiate a friend request to add someone as a friend.

Note

Related Callback: onFriendApplicationAdded

Function Prototype


- (void)addFriend:(NSString *)userID
reqMessage:(NSString * _Nullable)reqMessage
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameParameter TypeIs MandatoryDescription
userIDNSStringYesUser ID to be added
reqMessageNSStringYesRequest message

Return Result

Parameter NameParameter TypeDescription
onSuccessOIMSuccessCallbackSuccess Return
onFailureOIMFailureCallbackFailure Return

Code Example


[OIMManager.manager addFriend:@""
reqMessage:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];