onFriendAdded
Feature Introduction
info
Both users will receive this callback once they have successfully established a friendship.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- Unity
Return Prototype
Function(FriendInfo info)? onFriendAdded;
Return Results
Name | Type | Description |
---|---|---|
info | FriendInfo | Friend Details |
Return Prototype
- (void)onFriendAdded:(OIMFriendInfo *)info;
Return Results
Name | Type | Description |
---|---|---|
info | OIMFriendInfo | Friend Details |
Return Prototype
void onFriendAdded(FriendInfo info);
Return Results
Name | Type | Description |
---|---|---|
info | FriendInfo | Friend Details |
Return Prototype
onFriendAdded(data: WSEvent<FriendUserItem>): void;
Return Results
Name | Type | Description |
---|---|---|
data | WSEvent<FriendUserItem> | Friend Details |
Call Example
import { getSDK, CbEvents } from '@openim/wasm-client-sdk';
// or
// import { OpenIMSDK, CbEvents } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
const IMSDK = getSDK();
IMSDK.on(CbEvents.OnFriendAdded, ({ data }) => {
// data - Friend Details
});
Return Prototype
onFriendAdded(data: WSEvent<FriendUserItem>): void;
Return Results
Name | Type | Description |
---|---|---|
data | WSEvent<FriendUserItem> | Friend Details |
Call Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.subscribe(IMSDK.IMEvents.OnFriendAdded, ({ data }) => {
// data - Friend Details
});
Prototype
void OnFriendAdded(FriendInfo info);
Parameter
Parameter Name | Type | Description |
---|---|---|
info | FriendInfo | Friend Details |