支持Flutter6端开发。惺惺是一个100%开源社交平台,每个人都可以搭建自己的服务器,掌握数据的所有权。
XXIMCore core = XXIMCore();
core.init(
requestTimeout: const Duration(seconds: 10),
connectListener: ConnectListener(
onConnecting: () {},
onSuccess: () {},
onClose: (code, error) {},
),
receivePushListener: ReceivePushListener(
onPushMsgDataList: (msgDataList) {},
onPushNoticeData: (noticeData) {},
),
);
core.connect("");
core.disconnect();
core.isConnect();
bool? status = await core.setCxnParams(
reqId: "",
packageId: "",
rsaPublicKey: "",
aesKey: "",
req: CxnParams(
platform: "",
deviceId: "",
deviceModel: "",
osVersion: "",
appVersion: "",
language: "",
networkUsed: "",
ext: "",
),
);
SetUserParamsResp? resp = await core.setUserParams(
reqId: "",
req: SetUserParamsReq(
userId: "",
token: "",
ext: utf8.encode(""),
),
);
BatchGetConvSeqResp? resp = await core.batchGetConvSeq(
reqId: "",
req: BatchGetConvSeqReq(
convIdList: [],
),
);
GetMsgListResp? resp = await core.batchGetMsgListByConvId(
reqId: "",
req: BatchGetMsgListByConvIdReq(
items: [
BatchGetMsgListByConvIdReq_Item(
convId: "",
seqList: [],
),
],
),
);
GetMsgByIdResp? resp = await core.getMsgById(
reqId: "",
req: GetMsgByIdReq(
clientMsgId: "",
serverMsgId: "",
),
);
SendMsgListResp? resp = await core.sendMsgList(
reqId: "",
req: SendMsgListReq(
msgDataList: [
MsgData(
clientMsgId: "",
clientTime: "",
senderId: "",
senderInfo: utf8.encode(""),
convId: "",
atUsers: [],
contentType: MsgContentType.text,
content: utf8.encode(""),
options: MsgData_Options(
storageForServer: true,
storageForClient: true,
needDecrypt: false,
offlinePush: true,
updateConvMsg: true,
updateUnreadCount: true,
),
offlinePush: MsgData_OfflinePush(
title: "",
content: "",
payload: "",
),
ext: utf8.encode(""),
),
],
deliverAfter: 0,
),
);
ReadMsgResp? resp = await core.sendReadMsg(
reqId: "",
req: ReadMsgReq(
senderId: "",
convId: "",
seq: "",
noticeContent: utf8.encode(""),
),
);
EditMsgResp? resp = await core.sendEditMsg(
reqId: "",
req: EditMsgReq(
senderId: "",
serverMsgId: "",
contentType: MsgContentType.text,
content: utf8.encode(""),
ext: utf8.encode(""),
noticeContent: utf8.encode(""),
),
);
AckNoticeDataResp? resp = await core.ackNoticeData(
reqId: "",
req: AckNoticeDataReq(
convId: "",
noticeId: "",
),
);
List<int>? resp = await core.customRequest(
reqId: "",
method: "",
bytes: [],
);