Overview

Jocloud offers various client SDKs for you to connect to a global real-time network (RTN) for stable, reliable instant messaging services with high concurrency and ultra-low latency, helping you to create service scenarios quickly.

Jocloud’s mobile-specific instant messaging SDK code is Hummer.

  • Core offers SDK initialization login and configuration functions.
  • ChatRoom Service offers an API for chatroom management.
  • MessageService offers a channel for sending public screen, unicast and broadcast signaling messages.

Basic Functions

APIDescription
voidHMRInit(uint64_t appId)
voidHMROpen(uint64_t uid, const char *region, const char *token, HMRCompletion completion)
voidHMRClose()
voidHMRRefreshToken(const char *token)
voidHMRSetLogger(HMRLogFunction logFunction)
voidHMRAddStateListener(HMRStateListener *listener)
voidHMRRemoveStateListener(HMRStateListener *listener)
HMRStateHMRGetState()
const char *HMRGetVersion()
uint64_tHMRGetOwnUID()
CallbackDescription
voidonStateCallback(void *context, bool isInitial, HMRState oldState, HMRState newState)
voidonTokenInvalidCallback(void *context, HMRTokenInvalidCode code, const char *desc, int descsize)

Chatroom Management

APIDescription
voidHMRCreateChatRoom(HMRCompletion completion)
voidHMRCreateChatRoomWithInfo(HMRKvArray *info, HMRCompletion completion)
voidHMRJoinChatRoom(uint64_t roomId, HMRCompletion completion)
voidHMRJoinChatRoomWithMultiCheck(uint64_t roomId, bool isCheckMultiJoin, HMRCompletion completion)
voidHMRJoinChatRoomWithConfigs(uint64_t roomId, const HMRKvItem *joinProps, int numerOfProperty, HMRCompletion completion)
voidHMRLeaveChatRoom(uint64_t roomId, HMRCompletion completion)
voidHMRChatRoomChangeBasicInfo:(uint64_t roomId, HMRCompletion completion)
voidHMRChatRoomChangeBasicInfo(uint64_t roomId, HMRKvArray *info, HMRCompletion completion)
voidHMRAddChatRoomListener(HMRChatRoomListener *listener)
voidHMRRemoveChatRoomListener(HMRChatRoomListener *listener)
HMRIdentityHMRMakeChatRoomIdentity(uint64_t roomId)
HMRCodeHMRExtractChatRoomId(HMRIdentity identity, uint64_t *roomId)
boolHMRIsChatRoom(HMRIdentity identity)
CallbackDescription
voidonBasicInfoChanged(void *context, uint32_t chatroom, uint64_t operatorUser, const HMRKvArray *info)

Chatroom Member Management

APIDescription
voidHMRChatRoomFetchMembers(uint64_t roomId, int32_t num, int32_t offset, HMRCompletion completion)
voidHMRChatRoomSetUserInfo(uint64_t roomId, HMRKvArray *infos, HMRCompletion completion)
voidHMRChatRoomFetchOnLineUserInfoList(uint64_t roomId, HMRCompletion completion)
voidHMRAddMemberListener(HMRChatRoomMemberListener *listener)
voidHMRRemoveMemberListener(HMRChatRoomMemberListener *listener)
HMRIdentityHMRMakeChatRoomUser(uint64_t roomId, uint64_t userId)
HMRCodeHMRExtractChatRoomUser(HMRIdentity identity, uint64_t *roomId, uint64_t *userId)
boolHMRIsChatRoomUser(HMRIdentity identity)
CallbackDescription
voidonMemberJoined(void *context, uint32_t chatroom, const uint64_t *users, uint16_t usersize)
voidonMemberLeaved(void *context, uint32_t chatroom, const uint64_t *users, uint16_t usersize)
voidonMemberCountChanged(void *context, uint32_t chatroom, uint32_t count)
voidonMemberKicked(void *context, uint32_t chatroom, uint64_t admin, const uint64_t *member, uint16_t membersize, const char *reason)
voidonUserInfoSet(void *context, uint32_t chatroom, uint64_t user, const HMRKvArray *infos)

Message Channel

APIDescription
voidHMRSendMessasge(HMRMessage *message, HMRCompletion completion)
voidHMRAddMessageListener(HMRMessageListener *listener)
voidHMRRemoveMessageListener(HMRMessageListener *listener)
HMRMessage *HMRCreateMessage(HMRIdentity receiver, HMRMessageContent content, HMRMessageExtra extra)
voidHMRRetainMessage(HMRMessage *message)
voidHMRReleaseMessage(HMRMessage *message)
HMRMessageExtraHMRMakeMessageExtra(const char *extra, int32_t length)
boolHMRIsMessageFailed(HMRMessage *message)
HMRIdentityHMRGetConversationTarget(HMRMessage *message)
CallbackDescription
voidbeforeSending(void *context, HMRMessage *message)
voidafterSending(void *context, HMRMessage *message)
voidonReceive(void *context, HMRMessage *message)

Was this page helpful?

Helpful Not helpful
Submitted! Your feedback would help us improve the website.
Feedback
Top
<