SDKsuni-app
Check friendship
Check the friendship between the current account and selected users.
import { checkFriend } from '@/uni_modules/unix-openim-sdk'
const result = await checkFriend(['user_a', 'user_b'])
result?.result.forEach((relation) => cacheFriendRelation(relation.userID, relation.result))Read results by userID, not array position, and interpret relation values through exported constants rather than numeric literals. This query does not create a friendship; use addFriend() when appropriate.
Was this page helpful?