APIs for Flutter

Update time: 2022/10/11 03:31:31

Instant Messaging (IM) is a stable messaging service based on the communication technology provided by CommsEase. You can use IM to build robust chatting features for your apps. NIM SDK for Flutter offers a full-fledged instant messaging framework using Flutter, encapsulates internal complexitiess, and provideseasy-to-use APIs to facilitate quickly integration with third-party applications. You can use NIM SDK for Flutter to build Android, iOS, Windows, and macOS applications.

  • NimCore Class can initialize the SDK and get functionalities of other subclasses.
  • AuthService class provides the authentication interface, including login and logout.
  • UserService class provides the user service.
  • MessageService class provides the messaging service.
  • EventSubscribeService class manages the event subscription service.
  • SystemMessageService class provides the system notification service.
  • TeamService class provides the group chat service.
  • ChatroomService class contains APIs for the chat room service.
  • NOSService class provides the NOS storage service.
  • AudioService class provides the audio service.
  • SettingsService class provides interfaces for settings.
  • PassThroughService class provides the data transmission service in pass-through mode.

The SDK may return error codes and warning codes during API calls. For more information, see Error codes and warning codes.

NimCore

Method/property Description SDK version
instance Get a global SDK instance. V1.0.0
initialize Initialize the SDK V1.0.0
authService Get the authentication service V1.0.0
userService Get the user service V1.0.0
messageService Get the messaging service V1.0.0
eventSubscribeService Get the event subscription service V1.0.0
chatroomService Get the chat room service V1.0.0
audioService Get the audio service. V1.0.0
teamService Get the group chat service. V1.0.0
systemMessageService Get the system messaging service. V1.0.0
settingsService Get the settings service. V1.0.0
nosService Get the NOS storage service. V1.0.0
passThroughService Get the data transmission service in pass-through mode. V1.0.0

AuthService

Method/property Description SDK version
login Log in to the system V1.0.0
logout Log out of the system V1.0.0
kickOutOtherOnlineClient Invalidate login sessions on other clients. V1.0.0
authStatus Login status event stream V1.0.0
onlineClients Multi-device login event stream V1.0.0
dynamicTokenProvider Set the token provider for dynamic login V1.0.0

UserService

Method/property Description SDK version
addFriend Add a friend V1.0.0
deleteFriend Delete a friend V1.0.0
getFriendList Get the friends list V1.0.0
updateMyUserInfo Update the profile V1.0.0

MessageService

Method/property Description SDK version
sendMessage Send a message V1.0.0
searchMessage Search for a message V1.0.0
replyMessage Reply a message. V1.0.0
revokeMessage Recall a message V1.0.0
pullMessageHistory Retrieve the message history. V1.0.0
onMessage Event stream of receiving a message V1.0.0
onMessageStatus Event stream of message status changes V1.0.0

TeamService

Method/property Description SDK version
createTeam Create a group chat V1.0.0
dismissTeam Dismiss a group V1.0.0
queryTeam Query the group profile V1.0.0
applyJoinTeam Request to join a group V1.0.0
acceptInvite Accept an invitation to join a group. V1.0.0
quitTeam Leave a group V1.0.0
passApply Approve a join request V1.0.0
removeMembers Remove members from a group V1.0.0

ChatroomService

Method/property Description SDK version
enterChatroom Join a chat room V1.0.0
exitChatroom Leave a chat room V1.0.0
fetchChatroomInfo Get the profile of a chat room V1.0.0
fetchChatroomMembers Get the members of a chat room. V1.0.0
fetchMessageHistory Retrieve the message history of a chat room. V1.0.0
sendChatroomMessage Send a message in a chat room V1.0.0
onMessageReceived Event stream of receiving messages in a chat room V1.0.0

EventSubscribeService

Method/property Description SDK version
registerEventSubscribe Register the event of subscribing to the online status of a specified account. V1.0.0
unregisterEventSubscribe Unregister the event of subscribing to the online status of a specified account. V1.0.0
publishEvent Publish the event to subscribers V1.0.0
eventSubscribeStream Event stream of receiving events V1.0.0

SystemMessageService

Method/property Description SDK version
querySystemMessageUnread Get the unread system messages. V1.0.0
clearSystemMessages Delete all system messages. V1.0.0
sendCustomNotification Send a custom system notification V1.0.0
onCustomNotification Called when receiving a system notification V1.0.0

NOSService

Method/property Description SDK version
upload Upload an attachment V1.0.0
onNOSTransferProgress Event stream of transfer progress V1.0.0
onNOSTransferStatus Status event stream V1.0.0

AudioService

Method/property Description SDK version
startRecord Start audio recording V1.0.0
stopRecord Stop audio recording V1.0.0
onAudioRecordStatus Event stream of recording status V1.0.0

SettingsService

Method/property Description SDK version
enableNotificationAndroid Message alert configuration (Android) V1.0.0
enablePushServiceAndroid Enable or disable push notifications (Android) V1.0.0
updateAPNSToken Update iOS deviceToken V1.0.0
uploadLogs Upload logs V1.0.0

PassThroughService

Method/property Description SDK version
httpProxy Send an HTTP proxy request V1.0.0
Was this page helpful?
Yes
No
  • NimCore
  • AuthService
  • UserService
  • MessageService
  • TeamService
  • ChatroomService
  • EventSubscribeService
  • SystemMessageService
  • NOSService
  • AudioService
  • SettingsService
  • PassThroughService