提交 c613bb54 authored 作者: Mr.Qi's avatar Mr.Qi

增加公告外接可选方法

上级 ee769ac5
...@@ -29,6 +29,9 @@ abstract class BaseMessageConfig ...@@ -29,6 +29,9 @@ abstract class BaseMessageConfig
//处理消息页面跳转 //处理消息页面跳转
Future? onJumpToMessagePage(String page, dynamic arguments); Future? onJumpToMessagePage(String page, dynamic arguments);
/// 公告消息弹窗
Future? onShowAnnouncementMessage(dynamic info);
//连接websocket 获取及时消息 //连接websocket 获取及时消息
Future<void> connectWebSocket(BuildContext context) async { Future<void> connectWebSocket(BuildContext context) async {
String userNo = messageConfig.userKey; String userNo = messageConfig.userKey;
...@@ -62,8 +65,10 @@ abstract class BaseMessageConfig ...@@ -62,8 +65,10 @@ abstract class BaseMessageConfig
if (mBizType == bizType) { if (mBizType == bizType) {
var body = MessageData.fromJson(data?['body']); var body = MessageData.fromJson(data?['body']);
if (body.showType == '1') { if (body.showType == '1') {
if (onShowAnnouncementMessage(body.toJson()) == null) {
/// 首页公告 /// 首页公告
insertNotice(body); insertNotice(body);
}
} else if (body.showType == '2' && } else if (body.showType == '2' &&
messageConfig.showInAppNotification == 1) { messageConfig.showInAppNotification == 1) {
/// 全局通知 /// 全局通知
......
name: clx_flutter_message name: clx_flutter_message
description: An in-app messaging plugin description: An in-app messaging plugin
version: 0.0.2 version: 0.0.3
homepage: homepage:
environment: environment:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论