支持Flutter6端开发。惺惺是一个100%开源社交平台,每个人都可以搭建自己的服务器,掌握数据的所有权。
XXIMSDK sdk = XXIMSDK();
sdk.init(
directory: "",
requestTimeout: const Duration(seconds: 10),
rsaPublicKey: "",
aesKey: "",
cxnParams: CxnParams(
deviceModel: "",
deviceId: "",
osVersion: "",
platform: "",
appVersion: "",
language: "",
networkUsed: "",
ext: "",
),
autoPullTime: const Duration(seconds: 20),
pullMsgCount: 50,
isarSchemas: [],
isarMaxSizeMiB: Isar.defaultMaxSizeMiB,
isarInspector: false,
connectListener: ConnectListener(
onConnecting: () {},
onSuccess: () {},
onClose: (code, error) {},
),
subscribeCallback: SubscribeCallback(
onConvParams: () async {
return {"": const AesParams(key: "", iv: "")};
},
),
isarListener: IsarListener(
onCreate: (isar) {},
),
pullListener: PullListener(
onStart: () {},
onEnd: () {},
),
convListener: ConvListener(
onUpdate: () {},
),
msgListener: MsgListener(
onReceive: (msgModelList) {},
),
noticeListener: NoticeListener(
onReceive: (noticeModel) async {
return true;
},
),
unreadListener: UnreadListener(
onUnreadCount: (count) {},
),
);
sdk.connect("");
sdk.disconnect();
sdk.isConnect();
sdk.setCxnParams(
rsaPublicKey: "",
aesKey: "",
cxnParams: cxnParams,
);
sdk.setUserParams(
userId: "",
token: "",
ext: utf8.encode(""),
isarName: "",
convParams: {},
);
sdk.openPullSubscribe(
convParams: {},
);
sdk.closePullSubscribe();
List<int>? resp = await sdk.customRequest(
method: "",
bytes: [],
);
List<ConvModel> convList = await sdk.convManager.getConvList();
ConvModel? convModel = await sdk.convManager.getSingleConv(
convId: "",
);
sdk.convManager.setConvRead(
convId: "",
isSync: true ?? false,
);
sdk.convManager.updateConvMsg(
convId: "",
);
sdk.convManager.deleteConvMsg(
convId: "",
);
sdk.convManager.updateConvNotice(
convId: "",
);
sdk.convManager.deleteConvNotice(
convId: "",
);
sdk.convManager.setConvDraft(
convId: "",
draftModel: DraftModel(
content: "",
ext: "",
),
);
sdk.convManager.setConvHidden(
convId: "",
hidden: true ?? false,
);
sdk.convManager.deleteConv(
convId: "",
clear: true ?? false,
);
int unreadCount = await sdk.convManager.getUnreadCount();
List<MsgModel> msgList = await sdk.msgManager.getMsgList(
convId: "",
contentType: ContentType.text,
maxSeq: null,
size: 25,
);
MsgModel? msgModel = await sdk.msgManager.getFirstMsg(
convId: "",
);
MsgModel? msgModel = await sdk.msgManager.getSingleMsg(
clientMsgId: "",
);
List<MsgModel> msgList = await sdk.msgManager.getMultipleMsg(
clientMsgIdList: [],
);
MsgModel? msgModel = await sdk.msgManager.pullCloudMsg(
clientMsgId: "",
);
bool status = await sdk.msgManager.sendTyping(
convId: "",
content: TypingContent(
focus: true ?? false,
),
ext: "",
);
bool status = await sdk.msgManager.sendTip(
convId: "",
content: TipContent(
tip: "",
ext: "",
),
ext: "",
);
MsgModel msgModel = await sdk.msgManager.createText(...);
MsgModel msgModel = await sdk.msgManager.createImage(...);
MsgModel msgModel = await sdk.msgManager.createAudio(...);
MsgModel msgModel = await sdk.msgManager.createVideo(...);
MsgModel msgModel = await sdk.msgManager.createFile(...);
MsgModel msgModel = await sdk.msgManager.createLocation(...);
MsgModel msgModel = await sdk.msgManager.createCard(...);
MsgModel msgModel = await sdk.msgManager.createMerge(...);
MsgModel msgModel = await sdk.msgManager.createEmoji(...);
MsgModel msgModel = await sdk.msgManager.createCommand(...);
MsgModel msgModel = await sdk.msgManager.createRichText(...);
MsgModel msgModel = await sdk.msgManager.createMarkdown(...);
MsgModel msgModel = await sdk.msgManager.createCustom(...);
bool status = await sdk.msgManager.sendMsgList(
senderInfo: "",
msgModelList: [],
deliverAfter: 0,
);
bool status = await sdk.msgManager.sendReadMsg(
content: ReadContent(
convId: "",
seq: 0,
),
);
bool status = await sdk.msgManager.sendRevokeMsg(
clientMsgId: "",
content: TipContent(
tip: "",
ext: "",
),
);
bool status = await sdk.msgManager.sendEditMsg(
msgModel: msgModel,
);
sdk.msgManager.upsertMsg(
msgModel: msgModel,
includeMsgConv: true ?? false,
);
sdk.msgManager.deleteMsg(
clientMsgId: "",
);
sdk.msgManager.clearMsg(
convId: "",
);
List<NoticeModel> noticeList = await sdk.noticeManager.getNoticeList(
convId: "",
offset: 0,
limit: 25,
);
NoticeModel? noticeModel = await sdk.noticeManager.getSingleNotice(
noticeId: "",
);
List<NoticeModel> noticeList = await sdk.noticeManager.getMultipleNotice(
noticeIdList: [],
);
sdk.noticeManager.deleteNotice(
noticeId: "",
);
sdk.noticeManager.clearNotice(
convId: "",
);