Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
830ebf6b93 | ||
|
|
85495a94e1 | ||
|
|
d97794cf54 | ||
|
|
9ffe7e4ec7 | ||
|
|
1d6c53e0ff | ||
|
|
a35eba1160 | ||
|
|
0a175bb8b1 | ||
|
|
afb98bf399 | ||
|
|
1d27e9bc98 | ||
|
|
169affa005 | ||
|
|
6cf7b54e24 | ||
|
|
cdc12e513c | ||
|
|
b96401de8a | ||
|
|
7b65537e14 | ||
|
|
ee0cea6c2b | ||
|
|
b2c3c09c20 | ||
|
|
114980dab0 | ||
|
|
1af1ecfbb9 | ||
|
|
4b4b580d71 | ||
|
|
b46fb1a1d9 | ||
|
|
5ee8870d96 | ||
|
|
375bd6fcde | ||
|
|
1ca0ee7aaf | ||
|
|
622576295e | ||
|
|
5c13d83cc1 | ||
|
|
8beb75eb75 | ||
|
|
ab67f7fa10 | ||
|
|
c2bf30e268 | ||
|
|
a9567886b4 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@ build/
|
||||
.idea/other.xml
|
||||
windows/openlib/
|
||||
windows/third_party/
|
||||
.claude/
|
||||
|
||||
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<type id="android" />
|
||||
|
||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,3 +1,19 @@
|
||||
## 3.8.3+hotfix.10.1
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.10)
|
||||
|
||||
## 3.8.3+hotfix.10
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.10)
|
||||
|
||||
## 3.8.3+hotfix.7
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.7)
|
||||
|
||||
## 3.8.3+3
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.3)
|
||||
|
||||
## 3.8.2
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.2)
|
||||
|
||||
195
CLAUDE.md
Normal file
195
CLAUDE.md
Normal file
@@ -0,0 +1,195 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## 项目概述
|
||||
|
||||
这是一个 Flutter 插件项目,为 OpenIM 即时通讯服务提供 Flutter SDK 封装。该 SDK 支持 Android、iOS 和 Windows 平台。
|
||||
|
||||
**核心架构:**
|
||||
- Flutter 层通过 MethodChannel 与原生层通信
|
||||
- Android 原生层使用 gomobile 编译的 AAR 包与 OpenIM SDK Core (Go) 交互
|
||||
- iOS 原生层使用 gomobile 编译的 XCFramework 与 OpenIM SDK Core 交互
|
||||
- 数据传输格式为 JSON,数据存储使用 OpenIM SDK Core 内置的 SQLite
|
||||
|
||||
## 常用命令
|
||||
|
||||
### 开发环境设置
|
||||
```bash
|
||||
# 安装依赖
|
||||
flutter pub get
|
||||
|
||||
# 运行示例应用
|
||||
cd example
|
||||
flutter pub get
|
||||
flutter run
|
||||
```
|
||||
|
||||
### 测试
|
||||
```bash
|
||||
# 运行单元测试
|
||||
flutter test
|
||||
|
||||
# 运行集成测试
|
||||
cd example
|
||||
flutter test integration_test/plugin_integration_test.dart
|
||||
```
|
||||
|
||||
### 代码格式化
|
||||
```bash
|
||||
# 格式化代码
|
||||
dart format .
|
||||
|
||||
# 分析代码
|
||||
flutter analyze
|
||||
```
|
||||
|
||||
### Android 构建
|
||||
```bash
|
||||
# 在 example 目录中构建 Android
|
||||
cd example
|
||||
flutter build apk
|
||||
|
||||
# 构建 Android AAR
|
||||
cd android
|
||||
./gradlew assembleRelease
|
||||
```
|
||||
|
||||
### iOS 构建
|
||||
```bash
|
||||
# 在 example 目录中构建 iOS
|
||||
cd example
|
||||
flutter build ios
|
||||
```
|
||||
|
||||
## 核心架构设计
|
||||
|
||||
### 1. 管理器层次结构
|
||||
|
||||
`IMManager` 是核心管理器,包含以下子管理器:
|
||||
- `ConversationManager`: 会话管理(lib/src/manager/im_conversation_manager.dart)
|
||||
- `MessageManager`: 消息管理(lib/src/manager/im_message_manager.dart)
|
||||
- `FriendshipManager`: 好友关系管理(lib/src/manager/im_friendship_manager.dart)
|
||||
- `GroupManager`: 群组管理(lib/src/manager/im_group_manager.dart)
|
||||
- `ChannelManager`: <20><>道管理(lib/src/manager/im_channel_manager.dart)
|
||||
- `UserManager`: 用户管理(lib/src/manager/im_user_manager.dart)
|
||||
|
||||
### 2. 双向通信机制
|
||||
|
||||
**Flutter → Native (方法调用):**
|
||||
- Flutter 通过 MethodChannel 调用原生方法
|
||||
- 参数统一使用 `_buildParam()` 封装,添加 `ManagerName` 和清理空值
|
||||
- 每个请求可携带 `operationID` 用于追踪
|
||||
|
||||
**Native → Flutter (回调监听):**
|
||||
- 原生层通过 MethodChannel 回调 Flutter 层
|
||||
- Flutter 在 `IMManager._addNativeCallback()` 中统一处理所有监听器回调
|
||||
- 监听器类型定义在 `lib/src/enum/listener_type.dart`
|
||||
|
||||
### 3. 数据模型转换
|
||||
|
||||
所有数据模型位于 `lib/src/models/`,使用 JSON 序列化/反序列化:
|
||||
- `Utils.toObj()`: JSON Map 转对象
|
||||
- `Utils.toList()`: JSON Array 转对象列表
|
||||
- 所有模型类实现 `fromJson()` 和 `toJson()` 方法
|
||||
|
||||
### 4. 监听器系统
|
||||
|
||||
监听器定义在 `lib/src/listener/`,主要包括:
|
||||
- `OnConnectListener`: 连接状态监听
|
||||
- `OnAdvancedMsgListener`: 高级消息监听
|
||||
- `OnConversationListener`: 会话变化监听
|
||||
- `OnFriendshipListener`: 好友关系监听
|
||||
- `OnGroupListener`: 群组事件监听
|
||||
- `OnChannelListener`: 频道事件监听
|
||||
- `OnUserListener`: 用户信息监听
|
||||
|
||||
### 5. 原生层实现
|
||||
|
||||
**Android (Java):**
|
||||
- 插件入口: `android/src/main/java/io/openim/flutter_openim_sdk/FlutterOpenimSdkPlugin.java`
|
||||
- 各管理器实现: `android/src/main/java/io/openim/flutter_openim_sdk/manager/`
|
||||
- 依赖的 OpenIM SDK Core AAR 包位于 `android/libs/`
|
||||
|
||||
**iOS (Swift/ObjC):**
|
||||
- 插件入口: `ios/Classes/SwiftFlutterOpenimSdkPlugin.swift`
|
||||
- 模块化管理器: `ios/Classes/Module/`
|
||||
- 工具类: `ios/Classes/Util/`
|
||||
|
||||
## 开发注意事项
|
||||
|
||||
### SDK 初始化和登录流程
|
||||
|
||||
1. **必须先初始化 SDK** (`initSDK()` 或 `init()`)
|
||||
2. **设置监听器** (必须在登录前完成)
|
||||
3. **登录** (`login()`)
|
||||
4. SDK 初始化需要提供:
|
||||
- `platformID`: 平台 ID (参考 `IMPlatform` 枚举)
|
||||
- `apiAddr`: OpenIM Server API <20><><EFBFBD>址
|
||||
- `wsAddr`: OpenIM Server WebSocket 地址
|
||||
- `dataDir`: 数据存储目录
|
||||
|
||||
### 消息收发
|
||||
|
||||
- 创建消息使用 `MessageManager.create*Message()` 系列方法
|
||||
- 发送消息使用 `MessageManager.sendMessage()`
|
||||
- 接收消息通过 `OnAdvancedMsgListener` 监听
|
||||
- 支持单聊、群聊、在线消息等多种场景
|
||||
|
||||
### 平台特定功能
|
||||
|
||||
- **Android 独有**: `setListenerForService()` - 用于后台服务监听
|
||||
- **通知可见性规则**: Android SDK 35+ 支持的通知管理功能
|
||||
- **文件上传**: 支持自定义上传监听器 (`OnUploadFileListener`)
|
||||
|
||||
### 版本管理
|
||||
|
||||
- SDK 版本定义在 `lib/src/openim.dart` 中的 `OpenIM.version`
|
||||
- `pubspec.yaml` 中的版本应与之保持一致
|
||||
- 使用格式: `major.minor.patch+build` (如 `3.8.3+2`)
|
||||
|
||||
### 日志和调试
|
||||
|
||||
- 使用 `Logger.print()` 输出日志 (lib/src/logger.dart)
|
||||
- 支持上传日志到服务器: `uploadLogs()`
|
||||
- 可自定义日志级别 (1-6,默认 6 为全部输出)
|
||||
|
||||
## Android 特定配置
|
||||
|
||||
### ProGuard 规则
|
||||
|
||||
项目使用 ProGuard 混淆,规则文件在 `example/android/app/proguard-rules.pro`:
|
||||
```proguard
|
||||
-keep class io.openim.** { *; }
|
||||
-keep class open_im_sdk.** { *; }
|
||||
-keep class open_im_sdk_callback.** { *; }
|
||||
```
|
||||
|
||||
### Gradle 配置
|
||||
|
||||
- 使用阿里云 Maven 镜像加速依赖下载
|
||||
- 本地 Maven 仓库: `http://192.168.77.132:8081/repository/mvn2-group` (需根据实际情况修改)
|
||||
- `compileSdkVersion`: 34
|
||||
- `minSdkVersion`: 21
|
||||
|
||||
## 常见任务
|
||||
|
||||
### 添加新的 API 方法
|
||||
|
||||
1. 在对应的 Manager 类(Dart)中添加方法
|
||||
2. 在 Android Manager 类(Java)中实现
|
||||
3. 在 iOS Module 类(Swift)中实现
|
||||
4. 确保参数序列化和回调处理正确
|
||||
|
||||
### 添加新的监听器
|
||||
|
||||
1. 在 `lib/src/listener/` 创建监听器类
|
||||
2. 在 `ListenerType` 枚举中添加类型
|
||||
3. 在 `IMManager._addNativeCallback()` 中添加处理逻辑
|
||||
4. 在原生层实现对应的回调触发
|
||||
|
||||
### 调试原生层交互
|
||||
|
||||
- Flutter → Native: 在 `Logger.print()` 查看方法调用日志
|
||||
- Native → Flutter: 在 `_addNativeCallback()` 设置断点查看回调数据
|
||||
- 使用 `operationID` 追踪特定操作的完整流程
|
||||
674
LICENSE
674
LICENSE
@@ -1,21 +1,661 @@
|
||||
MIT License
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (c) 2018 OpenIM Corporation
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Preamble
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
12
README.md
12
README.md
@@ -155,4 +155,14 @@ Check out our [user case studies](https://github.com/OpenIMSDK/community/blob/ma
|
||||
|
||||
## License :page_facing_up:
|
||||
|
||||
OpenIM is licensed under the Apache 2.0 license. See [LICENSE](https://github.com/openimsdk/open-im-server/tree/main/LICENSE) for the full license text.
|
||||
This software is licensed under a dual-license model:
|
||||
|
||||
- The GNU Affero General Public License (AGPL), Version 3 or later; **OR**
|
||||
- Commercial license terms from OpenIMSDK.
|
||||
|
||||
If you wish to use this software under commercial terms, please contact us at: contact@openim.io
|
||||
|
||||
For more information, see: https://www.openim.io/en/licensing
|
||||
|
||||
|
||||
|
||||
|
||||
1
android/.gitignore
vendored
1
android/.gitignore
vendored
@@ -6,3 +6,4 @@
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.cxx
|
||||
|
||||
@@ -1,38 +1,28 @@
|
||||
group 'io.openim.flutter_openim_sdk'
|
||||
version '1.0'
|
||||
|
||||
def dir = getCurrentProjectDir()
|
||||
|
||||
def getCurrentProjectDir() {
|
||||
String result = ""
|
||||
rootProject.allprojects { project ->
|
||||
if (project.properties.get("name").toString() == "flutter_openim_sdk") {
|
||||
result = project.properties.get("projectDir").toString()
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
group = "io.openim.flutter_openim_sdk"
|
||||
version = "1.0"
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '2.0.20'
|
||||
|
||||
repositories {
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.3.1'
|
||||
classpath 'com.android.tools.build:gradle:8.7.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.allprojects {
|
||||
repositories {
|
||||
// 本地 AAR 调试配置 - 使用 rootProject.projectDir 确保路径正确
|
||||
// maven { url 'file://' + rootProject.projectDir.absolutePath + '/local-maven' }
|
||||
|
||||
maven {
|
||||
url 'http://192.168.77.132:8081/repository/mvn2-group'
|
||||
allowInsecureProtocol true
|
||||
url 'http://192.168.77.132:8081/repository/mvn2-group'
|
||||
allowInsecureProtocol true
|
||||
}
|
||||
google()
|
||||
mavenCentral()
|
||||
@@ -40,8 +30,10 @@ rootProject.allprojects {
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
namespace 'io.openim.flutter_openim_sdk'
|
||||
compileSdkVersion 34
|
||||
|
||||
defaultConfig {
|
||||
@@ -50,12 +42,28 @@ android {
|
||||
abiFilters "arm64-v8a","x86" // 根据需要添加其他 ABI
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
|
||||
dependencies {
|
||||
implementation 'io.openim:core-sdk:3.8.3-patch10@aar'
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
testImplementation("org.mockito:mockito-core:5.0.0")
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests.all {
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed", "standardOut", "standardError"
|
||||
outputs.upToDateWhen {false}
|
||||
showStandardStreams = true
|
||||
}
|
||||
}
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.openim:sdkcore:1.0.14'
|
||||
}
|
||||
//implementation 'com.openim:sdkcore:1.0.15-local'
|
||||
implementation 'com.openim:sdkcore:1.0.19'
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.enableDexingArtifactTransform=false
|
||||
@@ -1,9 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>io.openim</groupId>
|
||||
<artifactId>core-sdk</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</project>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="io.openim.flutter_openim_sdk">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
||||
@@ -35,14 +35,16 @@ public class FriendshipManager extends BaseManager {
|
||||
public void getFriendApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -135,4 +137,12 @@ public class FriendshipManager extends BaseManager {
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendApplicationUnhandledCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationUnhandledCount(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,14 +126,16 @@ public class GroupManager extends BaseManager {
|
||||
public void getGroupApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -240,4 +242,11 @@ public class GroupManager extends BaseManager {
|
||||
jsonValue(methodCall, "userIDs")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupApplicationUnhandledCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationUnhandledCount(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -102,6 +102,69 @@ public class IMManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void setNotificationVisibilityRule(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setNotificationVisibilityRule(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "notificationType"),
|
||||
value(methodCall, "visibilityType")
|
||||
);
|
||||
}
|
||||
|
||||
public void setNotificationVisibilityRules(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setNotificationVisibilityRules(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "rulesJSON")
|
||||
);
|
||||
}
|
||||
|
||||
public void getNotificationVisibilityRule(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getNotificationVisibilityRule(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "notificationType")
|
||||
);
|
||||
}
|
||||
|
||||
public void getNotificationVisibilityRules(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getNotificationVisibilityRules(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void enableNotificationVisibilityRule(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.enableNotificationVisibilityRule(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "notificationType")
|
||||
);
|
||||
}
|
||||
|
||||
public void disableNotificationVisibilityRule(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.disableNotificationVisibilityRule(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "notificationType")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteNotificationVisibilityRule(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteNotificationVisibilityRule(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "notificationType")
|
||||
);
|
||||
}
|
||||
|
||||
public void resetNotificationVisibilityRules(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.resetNotificationVisibilityRules(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
// public void setListenerForService(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.setListenerForService(new OnListenerForService());
|
||||
//
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk
|
||||
|
||||
import androidx.annotation.NonNull
|
||||
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
||||
import io.flutter.plugin.common.MethodChannel.Result
|
||||
|
||||
/** FlutterOpenimSdkPlugin */
|
||||
class FlutterOpenimSdkPlugin: FlutterPlugin, MethodCallHandler {
|
||||
/// The MethodChannel that will the communication between Flutter and native Android
|
||||
///
|
||||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
|
||||
/// when the Flutter Engine is detached from the Activity
|
||||
private lateinit var channel : MethodChannel
|
||||
|
||||
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter_openim_sdk")
|
||||
channel.setMethodCallHandler(this)
|
||||
}
|
||||
|
||||
override fun onMethodCall(call: MethodCall, result: Result) {
|
||||
if (call.method == "getPlatformVersion") {
|
||||
result.success("Android ${android.os.Build.VERSION.RELEASE}")
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel.setMethodCallHandler(null)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package io.openim.flutter_openim_sdk;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* This demonstrates a simple unit test of the Java portion of this plugin's
|
||||
* implementation.
|
||||
*
|
||||
* Once you have built the plugin's example app, you can run these tests from
|
||||
* the command
|
||||
* line by running `./gradlew testDebugUnitTest` in the `example/android/`
|
||||
* directory, or
|
||||
* you can run them directly from IDEs that support JUnit such as Android
|
||||
* Studio.
|
||||
*/
|
||||
|
||||
public class FlutterOpenimSdkPluginTest {
|
||||
@Test
|
||||
public void onMethodCall_getPlatformVersion_returnsExpectedValue() {
|
||||
FlutterOpenimSdkPlugin plugin = new FlutterOpenimSdkPlugin();
|
||||
|
||||
final MethodCall call = new MethodCall("getPlatformVersion", null);
|
||||
MethodChannel.Result mockResult = mock(MethodChannel.Result.class);
|
||||
plugin.onMethodCall(call, mockResult);
|
||||
|
||||
verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE);
|
||||
}
|
||||
}
|
||||
6
example/.gitignore
vendored
6
example/.gitignore
vendored
@@ -5,9 +5,11 @@
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.build/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
.swiftpm/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
@@ -41,3 +43,7 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# 本地调试 AAR 文件
|
||||
/libs/*.aar
|
||||
/android/local-maven/
|
||||
|
||||
3
example/android/.gitignore
vendored
3
example/android/.gitignore
vendored
@@ -5,9 +5,10 @@ gradle-wrapper.jar
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
|
||||
@@ -49,6 +49,7 @@ android {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.debug
|
||||
minifyEnabled true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
44
example/android/app/build.gradle.kts
Normal file
44
example/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,44 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.openim.flutter_openim_sdk_example"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "io.openim.flutter_openim_sdk_example"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<application
|
||||
android:label="example"
|
||||
android:label="flutter_openim_sdk_example"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package io.openim.flutter_openim_sdk_example;
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity;
|
||||
|
||||
public class MainActivity extends FlutterActivity {
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.example.example
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity()
|
||||
@@ -1,10 +1,54 @@
|
||||
buildscript {
|
||||
// 1. 修改这里:将 Kotlin 版本升级到 1.9.24 以解决 "Module was compiled with... 1.9.0" 报错
|
||||
ext.kotlin_version = '1.9.24'
|
||||
|
||||
repositories {
|
||||
// 2. 优化网络:优先使用阿里云镜像,解决下载慢/超时/握手失败问题
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Android Gradle 插件版本 (保持您当前的 7.3.0 即可,如果报错提示不兼容再升级到 7.4.2)
|
||||
classpath 'com.android.tools.build:gradle:7.3.0'
|
||||
|
||||
// Kotlin 插件 (这里引用了上面定义的 ext.kotlin_version)
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
// === 本地 AAR 调试配置 ===
|
||||
// 启用本地调试: 取消下面这行的注释
|
||||
// maven { url 'file://' + projectDir.absolutePath + '/local-maven' }
|
||||
// === 本地 AAR 配置结束 ===
|
||||
|
||||
// 3. 优化网络:allprojects 也要加镜像
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
// === 强制使用本地 AAR 版本 (调试时取消注释) ===
|
||||
// 注意: 必须配合上面的本地 Maven 仓库一起使用
|
||||
|
||||
// configurations.all {
|
||||
// resolutionStrategy {
|
||||
// force 'com.openim:sdkcore:1.0.15-local'
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
rootProject.buildDir = "../build"
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
@@ -15,4 +59,4 @@ subprojects {
|
||||
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
}
|
||||
21
example/android/build.gradle.kts
Normal file
21
example/android/build.gradle.kts
Normal file
@@ -0,0 +1,21 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
663
example/android/build/reports/problems/problems-report.html
Normal file
663
example/android/build/reports/problems/problems-report.html
Normal file
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
|
||||
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
||||
|
||||
@@ -19,7 +19,7 @@ pluginManagement {
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "7.3.0" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.9.24" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
|
||||
25
example/android/settings.gradle.kts
Normal file
25
example/android/settings.gradle.kts
Normal file
@@ -0,0 +1,25 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath = run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.7.3" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -7,16 +7,15 @@
|
||||
// https://flutter.dev/to/integration-testing
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
|
||||
void main() {
|
||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
// IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
testWidgets('getPlatformVersion test', (WidgetTester tester) async {
|
||||
final FlutterOpenimSdk plugin = FlutterOpenimSdk();
|
||||
final String? version = await plugin.getPlatformVersion();
|
||||
// The version string depends on the host platform running the test, so
|
||||
// just assert that some non-empty string is returned.
|
||||
expect(version?.isNotEmpty, true);
|
||||
});
|
||||
// testWidgets('getPlatformVersion test', (WidgetTester tester) async {
|
||||
// final FlutterOpenimSdk plugin = FlutterOpenimSdk();
|
||||
// final String? version = await plugin.getPlatformVersion();
|
||||
// // The version string depends on the host platform running the test, so
|
||||
// // just assert that some non-empty string is returned.
|
||||
// expect(version?.isNotEmpty, true);
|
||||
// });
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_openim_sdk (0.0.1):
|
||||
- Flutter
|
||||
- OpenIMSDKCore (= 3.8.2)
|
||||
- OpenIMSDKCore (3.8.2)
|
||||
- OpenIMSDKCore (= 3.8.3-hotfix.10)
|
||||
- OpenIMSDKCore (3.8.3-hotfix.10)
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
@@ -21,9 +21,9 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_openim_sdk: 77bdd08fb8dda1644a0c150b8ba7324f11b32404
|
||||
OpenIMSDKCore: aaffd63079a874d9272b8b962598723cb8128d32
|
||||
flutter_openim_sdk: 59aa0c08eb7499a1790168e10539e4dd915ced6e
|
||||
OpenIMSDKCore: bc9a6e5de2aabed76e4f69fe06a7c9df1d945afc
|
||||
|
||||
PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
|
||||
|
||||
COCOAPODS: 1.15.2
|
||||
COCOAPODS: 1.16.2
|
||||
|
||||
@@ -198,6 +198,7 @@
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
477B57FDE7C120496D1FEA7A /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -307,6 +308,23 @@
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
477B57FDE7C120496D1FEA7A /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
70DBF52745AF25A4FC72D8C3 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
@@ -54,11 +55,13 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
enableGPUValidationMode = "1"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
import 'package:flutter_openim_sdk/src/enum/group_notify_filter.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
void main() {
|
||||
try {
|
||||
@@ -14,32 +18,180 @@ class MyApp extends StatefulWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
bool _isLoading = true;
|
||||
bool _isLoggedIn = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_init();
|
||||
}
|
||||
|
||||
Future<void> _init() async {
|
||||
await _requestPermissions();
|
||||
await _initSDK();
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _requestPermissions() async {
|
||||
// 请求存储权限
|
||||
var status = await Permission.storage.request();
|
||||
if (status.isGranted) {
|
||||
// 权限已授予,可以读写文件
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _initSDK() async {
|
||||
var directory = await getApplicationDocumentsDirectory();
|
||||
|
||||
final rootPath = directory.path;
|
||||
OpenIM.iMManager
|
||||
.initSDK(
|
||||
platformID: 2,
|
||||
apiAddr: 'http://192.168.77.135:10002',
|
||||
wsAddr: 'ws://192.168.77.135:10001',
|
||||
dataDir: './',
|
||||
listener: OnConnectListener())
|
||||
dataDir: '$rootPath/',
|
||||
listener: OnConnectListener(onConnectSuccess: () {
|
||||
// Already connected to the server
|
||||
_isLoggedIn = true;
|
||||
}, onConnecting: () {
|
||||
// Connecting to the server, can be used for UI prompts
|
||||
}, onUserTokenExpired: () {
|
||||
// User token has expired, can be used for UI prompts
|
||||
_isLoggedIn = false;
|
||||
}, onKickedOffline: () {
|
||||
// The current user is kicked offline, and the user needs to be prompted to log in again
|
||||
_isLoggedIn = false;
|
||||
}))
|
||||
.then((value) {
|
||||
print('SDK initialized successfully');
|
||||
OpenIM.iMManager
|
||||
if (value) {
|
||||
OpenIM.iMManager.userManager.setUserListener(OnUserListener(
|
||||
onSelfInfoUpdated: (userInfo) {
|
||||
debugPrint('onSelfInfoUpdated: ${userInfo.toJson()}');
|
||||
},
|
||||
));
|
||||
|
||||
OpenIM.iMManager.setNotificationVisibilityRule(
|
||||
notificationType: MessageType.memberQuitNotification,
|
||||
visibilityType:
|
||||
GroupNotifyFilter.notificationVisibleToOperatorAndAdmin);
|
||||
|
||||
OpenIM.iMManager.setNotificationVisibilityRule(
|
||||
notificationType: MessageType.memberKickedNotification,
|
||||
visibilityType:
|
||||
GroupNotifyFilter.notificationVisibleToOperatorAndAdmin);
|
||||
|
||||
// success
|
||||
} else {
|
||||
// fail
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _login() async {
|
||||
try {
|
||||
await OpenIM.iMManager
|
||||
.login(
|
||||
userID: "3e8b8fb2ecd8414db50838d9f7bcb19d",
|
||||
userID: "8bfe13b5eac44e87963652abb91d80d2",
|
||||
token:
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiIzZThiOGZiMmVjZDg0MTRkYjUwODM4ZDlmN2JjYjE5ZCIsIlBsYXRmb3JtSUQiOjIsImV4cCI6MTc1Mzc1MTYyNywiaWF0IjoxNzQ1OTc1NjIyfQ.S-CxfETXYyLFe2VqStwbrVCRcB5j2T2qi-52y1L-3OI")
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiI4YmZlMTNiNWVhYzQ0ZTg3OTYzNjUyYWJiOTFkODBkMiIsIlBsYXRmb3JtSUQiOjIsImV4cCI6MTc3MTQwNzc2MCwiaWF0IjoxNzYzNjMxNzU1fQ.Da8DBofn085JsQlnSHfDqakH6puabZn7A2NAsUs9FoM")
|
||||
.then((value) {
|
||||
print('Login successful');
|
||||
}).catchError((error) {
|
||||
print('Login failed: $error');
|
||||
_isLoggedIn = true;
|
||||
List<String> list = [];
|
||||
OpenIM.iMManager.userManager.subscribeUsersStatus(list);
|
||||
//send();
|
||||
|
||||
OpenIM.iMManager.messageManager
|
||||
.setAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
// 当消息被撤回时调用
|
||||
onRecvNewMessage: (msg) {
|
||||
debugPrint('Received onRecvNewMessage: ${msg.toJson()}');
|
||||
},
|
||||
onRecvOnlineOnlyMessage: (msg) =>
|
||||
debugPrint('Received online-only message: ${msg.toJson()}'),
|
||||
onRecvOfflineNewMessage: (msg) =>
|
||||
debugPrint('Received offline message: ${msg.toJson()}'),
|
||||
));
|
||||
|
||||
OpenIM.iMManager.groupManager.setGroupListener(OnGroupListener(
|
||||
// 当群组申请被接受时调用
|
||||
onGroupApplicationAccepted: (groupApplication) {},
|
||||
// 当群组申请被添加时调用
|
||||
onGroupApplicationAdded: (groupApplication) {},
|
||||
// 当群组申请被删除时调用
|
||||
onGroupApplicationDeleted: (groupApplication) {},
|
||||
// 当群组申请被拒绝时调用
|
||||
onGroupApplicationRejected: (groupApplication) {
|
||||
debugPrint('Group application rejected: $groupApplication');
|
||||
},
|
||||
// 当群组信息发生变化时调用
|
||||
onGroupInfoChanged: (groupInfo) {
|
||||
debugPrint('Group info changed: $groupInfo');
|
||||
//等待一段时间,获得会话的最后一条消息
|
||||
Future.delayed(const Duration(seconds: 2), () {
|
||||
OpenIM.iMManager.conversationManager
|
||||
.getOneConversation(
|
||||
sourceID: groupInfo.groupID,
|
||||
sessionType: ConversationType.superGroup)
|
||||
.then((conversation) {
|
||||
debugPrint(
|
||||
'Updated conversation last message: ${conversation.latestMsg}');
|
||||
});
|
||||
});
|
||||
},
|
||||
// 当群组成员被添加时调用
|
||||
onGroupMemberAdded: (groupMember) {
|
||||
debugPrint('Group member added: $groupMember');
|
||||
},
|
||||
// 当群组成员被删除时调用
|
||||
onGroupMemberDeleted: (groupMember) {
|
||||
debugPrint('Group member deleted: $groupMember');
|
||||
},
|
||||
// 当群组成员信息发生变化时调用
|
||||
onGroupMemberInfoChanged: (groupMember) {
|
||||
debugPrint('Group member info changed: $groupMember');
|
||||
},
|
||||
// 当加入的群组被添加时调用
|
||||
onJoinedGroupAdded: (groupInfo) {
|
||||
debugPrint('Joined group added: $groupInfo');
|
||||
},
|
||||
// 当加入的群组被删除时调用
|
||||
onJoinedGroupDeleted: (groupInfo) {
|
||||
debugPrint('Joined group deleted: $groupInfo');
|
||||
},
|
||||
));
|
||||
OpenIM.iMManager.conversationManager
|
||||
.getAllConversationList()
|
||||
.then((value) {
|
||||
print('Get all conversation list successful');
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
_isLoggedIn = false;
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> send() async {
|
||||
OpenIM.iMManager.messageManager
|
||||
.sendMessage(
|
||||
userID: "724f91aceb434a28a1cd10f5564b2c68",
|
||||
message: await OpenIM.iMManager.messageManager
|
||||
.createTextMessage(text: 'hello openim'),
|
||||
offlinePushInfo: OfflinePushInfo(title: 'title', desc: 'desc'))
|
||||
.then((value) {
|
||||
print('send success');
|
||||
}).catchError((error) {
|
||||
print('send error');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -50,11 +202,35 @@ class _MyAppState extends State<MyApp> {
|
||||
appBar: AppBar(
|
||||
title: const Text('Plugin example app'),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
TextButton(onPressed: () {}, child: const Text('login')),
|
||||
],
|
||||
),
|
||||
body: _isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: _isLoggedIn
|
||||
? Column(
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
OpenIM.iMManager.logout().then((_) {
|
||||
setState(() {
|
||||
_isLoggedIn = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
child: const Text('logout')),
|
||||
],
|
||||
)
|
||||
: Center(
|
||||
child: TextButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
_login().then((_) {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
child: const Text('login'))),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
114
example/libs/README.md
Normal file
114
example/libs/README.md
Normal file
@@ -0,0 +1,114 @@
|
||||
# 本地 AAR 调试配置
|
||||
|
||||
此目录用于放置本地编译的 OpenIM SDK AAR 文件,仅在 example 项目调试时使用。
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 步骤 1: 准备 AAR 文件
|
||||
|
||||
将你的 AAR 文件重命名为 `sdkcore-debug.aar` 并放在本目录:
|
||||
|
||||
```
|
||||
example/libs/
|
||||
└── sdkcore-debug.aar (你的本地编译 AAR 文件)
|
||||
```
|
||||
|
||||
### 步骤 2: 复制到 Maven 仓库结构
|
||||
|
||||
```bash
|
||||
# Linux/Mac/Git Bash
|
||||
cd example
|
||||
cp libs/sdkcore-debug.aar android/local-maven/com/openim/sdkcore/1.0.15-local/sdkcore-1.0.15-local.aar
|
||||
|
||||
# Windows PowerShell
|
||||
cd example
|
||||
Copy-Item libs\sdkcore-debug.aar android\local-maven\com\openim\sdkcore\1.0.15-local\sdkcore-1.0.15-local.aar
|
||||
```
|
||||
|
||||
**注意**: POM 文件已自动创建在 `android/local-maven/com/openim/sdkcore/1.0.15-local/sdkcore-1.0.15-local.pom`
|
||||
|
||||
### 步骤 3: 启用本地 AAR
|
||||
|
||||
编辑 `example/android/build.gradle`,取消以下两处注释:
|
||||
|
||||
**1. 第 28 行 - 启用本地 Maven 仓库:**
|
||||
```gradle
|
||||
maven { url 'file://' + projectDir.absolutePath + '/local-maven' }
|
||||
```
|
||||
|
||||
**2. 第 43-49 行 - 强制使用本地版本:**
|
||||
```gradle
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
force 'com.openim:sdkcore:1.0.15-local'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 步骤 4: 清理并重新构建
|
||||
|
||||
```bash
|
||||
cd example
|
||||
flutter clean
|
||||
flutter pub get
|
||||
flutter build apk # 或 flutter run
|
||||
```
|
||||
|
||||
## 更新 AAR 后快速替换
|
||||
|
||||
如果你已经配置过一次,只是更新了 AAR 文件:
|
||||
|
||||
```bash
|
||||
cd example
|
||||
# 复制新的 AAR 文件
|
||||
cp libs/sdkcore-debug.aar android/local-maven/com/openim/sdkcore/1.0.15-local/sdkcore-1.0.15-local.aar
|
||||
|
||||
# 清理并重新构建
|
||||
flutter clean && flutter pub get && flutter run
|
||||
```
|
||||
|
||||
## 调试完成后恢复
|
||||
|
||||
重新注释掉 `example/android/build.gradle` 中的两处配置即可恢复使用远程 Maven 仓库的版本。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
example/
|
||||
├── libs/
|
||||
│ ├── README.md (本文件)
|
||||
│ └── sdkcore-debug.aar (你的 AAR 源文件)
|
||||
└── android/
|
||||
└── local-maven/ (Git 已忽略)
|
||||
└── com/openim/sdkcore/1.0.15-local/
|
||||
├── sdkcore-1.0.15-local.aar (Maven 仓库中的 AAR)
|
||||
└── sdkcore-1.0.15-local.pom (Maven 元数据)
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
- ✅ 此配置只影响 example 项目,不会修改插件本身
|
||||
- ✅ 切换远程/本地版本只需注释/取消注释即可
|
||||
- ✅ `.gitignore` 已配置忽略 `android/local-maven/` 目录
|
||||
- ⚠️ 每次修改 AAR 文件后需要重新复制到 Maven 目录并运行 `flutter clean`
|
||||
- ⚠️ 确保 AAR 文件名和版本号匹配
|
||||
|
||||
## 故障排查
|
||||
|
||||
### 问题 1: Kotlin 版本不兼容错误
|
||||
已修复:插件的 `android/build.gradle` 已添加 Kotlin 插件和正确的配置。
|
||||
|
||||
### 问题 2: "Zip file already contains entry" 错误
|
||||
运行彻底清理:
|
||||
```bash
|
||||
cd example
|
||||
flutter clean
|
||||
rm -rf build
|
||||
cd android && ./gradlew clean
|
||||
```
|
||||
|
||||
### 问题 3: 找不到 sdkcore 依赖
|
||||
确保:
|
||||
1. `android/build.gradle` 中的本地 Maven 仓库已取消注释
|
||||
2. `resolutionStrategy.force` 配置已取消注释
|
||||
3. AAR 文件已正确复制到 Maven 目录结构中
|
||||
@@ -57,6 +57,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -82,6 +90,11 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -146,6 +159,118 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.0"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.15"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_foundation
|
||||
sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.1"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_linux
|
||||
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_platform_interface
|
||||
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
path_provider_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_windows
|
||||
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
permission_handler:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.4.0"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "12.1.0"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.4.7"
|
||||
permission_handler_html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_html
|
||||
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.3+5"
|
||||
permission_handler_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.3.0"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_windows
|
||||
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.1"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.6"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.8"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -215,6 +340,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.5"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xdg_directories
|
||||
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
sdks:
|
||||
dart: ">=3.4.4 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
dart: ">=3.5.0 <4.0.0"
|
||||
flutter: ">=3.24.0"
|
||||
|
||||
@@ -43,6 +43,10 @@ dependencies:
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.6
|
||||
permission_handler: ^11.3.1
|
||||
path_provider: ^2.1.4
|
||||
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
34
example/update-local-aar.bat
Normal file
34
example/update-local-aar.bat
Normal file
@@ -0,0 +1,34 @@
|
||||
@echo off
|
||||
REM ====================================
|
||||
REM 更新本地 AAR 并重新构建
|
||||
REM ====================================
|
||||
|
||||
echo [1/5] 复制 AAR 文件到 Maven 仓库...
|
||||
copy /Y libs\sdkcore-debug.aar android\local-maven\com\openim\sdkcore\1.0.15-local\sdkcore-1.0.15-local.aar
|
||||
if %errorlevel% neq 0 (
|
||||
echo 错误: AAR 文件复制失败,请检查 libs\sdkcore-debug.aar 是否存在
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [2/5] 清理 Flutter 缓存...
|
||||
flutter clean
|
||||
|
||||
echo [3/5] 删除构建目录...
|
||||
if exist build rmdir /S /Q build
|
||||
|
||||
echo [4/5] 清理 Gradle 缓存...
|
||||
cd android
|
||||
call gradlew.bat clean
|
||||
cd ..
|
||||
|
||||
echo [5/5] 重新获取依赖...
|
||||
flutter pub get
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo 更新完成!现在可以运行:
|
||||
echo flutter run (运行应用)
|
||||
echo flutter build apk (构建 APK)
|
||||
echo ========================================
|
||||
pause
|
||||
34
example/update-local-aar.sh
Normal file
34
example/update-local-aar.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
####################################
|
||||
# 更新本地 AAR 并重新构建
|
||||
####################################
|
||||
|
||||
set -e # 遇到错误立即退出
|
||||
|
||||
echo "[1/5] 复制 AAR 文件到 Maven 仓库..."
|
||||
if [ ! -f "libs/sdkcore-debug.aar" ]; then
|
||||
echo "错误: libs/sdkcore-debug.aar 不存在"
|
||||
exit 1
|
||||
fi
|
||||
cp libs/sdkcore-debug.aar android/local-maven/com/openim/sdkcore/1.0.15-local/sdkcore-1.0.15-local.aar
|
||||
|
||||
echo "[2/5] 清理 Flutter 缓存..."
|
||||
flutter clean
|
||||
|
||||
echo "[3/5] 删除构建目录..."
|
||||
rm -rf build
|
||||
|
||||
echo "[4/5] 清理 Gradle 缓存..."
|
||||
cd android
|
||||
./gradlew clean
|
||||
cd ..
|
||||
|
||||
echo "[5/5] 重新获取依赖..."
|
||||
flutter pub get
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo "更新完成!现在可以运行:"
|
||||
echo " flutter run (运行应用)"
|
||||
echo " flutter build apk (构建 APK)"
|
||||
echo "========================================"
|
||||
@@ -7,8 +7,11 @@
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <flutter_openim_sdk/flutter_openim_sdk_plugin.h>
|
||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
FlutterOpenimSdkPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FlutterOpenimSdkPlugin"));
|
||||
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
flutter_openim_sdk
|
||||
permission_handler_windows
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
@@ -21,6 +21,7 @@ public class FriendshipManager: BaseServiceManager {
|
||||
self["searchFriends"] = searchFriends
|
||||
self["setFriendListener"] = setFriendListener
|
||||
self["updateFriends"] = updateFriends
|
||||
self["getFriendApplicationUnhandledCount"] = getFriendApplicationUnhandledCount
|
||||
}
|
||||
|
||||
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -48,11 +49,11 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getFriendApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||
}
|
||||
|
||||
func getFriendApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||
}
|
||||
|
||||
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -87,6 +88,10 @@ public class FriendshipManager: BaseServiceManager {
|
||||
func updateFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkUpdateFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||
}
|
||||
|
||||
func getFriendApplicationUnhandledCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationUnhandledCount(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||
}
|
||||
}
|
||||
|
||||
public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol {
|
||||
|
||||
@@ -32,6 +32,7 @@ public class GroupManager: BaseServiceManager {
|
||||
self["setGroupListener"] = setGroupListener
|
||||
self["setGroupMemberInfo"] = setGroupMemberInfo
|
||||
self["transferGroupOwner"] = transferGroupOwner
|
||||
self["getGroupApplicationUnhandledCount"] = getGroupApplicationUnhandledCount
|
||||
}
|
||||
|
||||
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
@@ -55,11 +56,11 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getGroupApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||
}
|
||||
|
||||
func getGroupApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||
}
|
||||
|
||||
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
@@ -147,6 +148,10 @@ public class GroupManager: BaseServiceManager {
|
||||
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func getGroupApplicationUnhandledCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetGroupApplicationUnhandledCount(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||
}
|
||||
}
|
||||
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
|
||||
@@ -18,6 +18,14 @@ public class IMMananger: BaseServiceManager {
|
||||
self["updateFcmToken"] = updateFcmToken
|
||||
self["setAppBackgroundStatus"] = setAppBackgroundStatus
|
||||
self["networkStatusChanged"] = networkStatusChanged
|
||||
self["setNotificationVisibilityRule"] = setNotificationVisibilityRule
|
||||
self["setNotificationVisibilityRules"] = setNotificationVisibilityRules
|
||||
self["getNotificationVisibilityRule"] = getNotificationVisibilityRule
|
||||
self["getNotificationVisibilityRules"] = getNotificationVisibilityRules
|
||||
self["enableNotificationVisibilityRule"] = enableNotificationVisibilityRule
|
||||
self["disableNotificationVisibilityRule"] = disableNotificationVisibilityRule
|
||||
self["deleteNotificationVisibilityRule"] = deleteNotificationVisibilityRule
|
||||
self["resetNotificationVisibilityRules"] = resetNotificationVisibilityRules
|
||||
}
|
||||
|
||||
fileprivate func addObservers() {
|
||||
@@ -107,6 +115,38 @@ public class IMMananger: BaseServiceManager {
|
||||
func networkStatusChanged(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkNetworkStatusChanged(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func setNotificationVisibilityRule(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetNotificationVisibilityRule(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "notificationType"], methodCall[int32: "visibilityType"])
|
||||
}
|
||||
|
||||
func setNotificationVisibilityRules(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetNotificationVisibilityRules(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "rulesJSON"])
|
||||
}
|
||||
|
||||
func getNotificationVisibilityRule(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetNotificationVisibilityRule(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "notificationType"])
|
||||
}
|
||||
|
||||
func getNotificationVisibilityRules(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetNotificationVisibilityRules(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func enableNotificationVisibilityRule(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkEnableNotificationVisibilityRule(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "notificationType"])
|
||||
}
|
||||
|
||||
func disableNotificationVisibilityRule(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDisableNotificationVisibilityRule(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "notificationType"])
|
||||
}
|
||||
|
||||
func deleteNotificationVisibilityRule(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteNotificationVisibilityRule(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "notificationType"])
|
||||
}
|
||||
|
||||
func resetNotificationVisibilityRules(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkResetNotificationVisibilityRules(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||
|
||||
23
ios/Resources/PrivacyInfo.xcprivacy
Normal file
23
ios/Resources/PrivacyInfo.xcprivacy
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array/>
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array/>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'flutter_openim_sdk'
|
||||
s.version = '0.0.11'
|
||||
s.version = '0.0.14'
|
||||
s.summary = 'A new Flutter project.'
|
||||
s.description = <<-DESC
|
||||
A new Flutter project.
|
||||
@@ -19,7 +19,7 @@ A new Flutter project.
|
||||
|
||||
#s.ios.vendored_frameworks = 'frameworks/*.xcframework'
|
||||
#s.vendored_frameworks = 'frameworks/*.xcframework'
|
||||
s.dependency 'openim_sdk_core_ios','0.11.0'
|
||||
s.dependency 'openim_sdk_core_ios','0.14.0'
|
||||
s.static_framework = true
|
||||
s.library = 'resolv'
|
||||
|
||||
@@ -30,4 +30,6 @@ A new Flutter project.
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' }
|
||||
s.swift_version = '5.0'
|
||||
|
||||
s.resource_bundles = {'flutter_openim_sdk_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
|
||||
end
|
||||
|
||||
13
lib/src/enum/group_notify_filter.dart
Normal file
13
lib/src/enum/group_notify_filter.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class GroupNotifyFilter {
|
||||
static const notificationVisibleToAll = 0; // 所有人可见 - Visible to all
|
||||
static const notificationVisibleToOperatorAndAdmin =
|
||||
1; // 操作者、被操作者和管理员可见 - Visible to operator, target and admin
|
||||
static const notificationVisibleToAdminOnly =
|
||||
2; // 仅管理员可见 - Visible to admin only
|
||||
static const notificationVisibleToOperatorOnly =
|
||||
3; // 仅操作者本人可见 - Visible to operator only
|
||||
static const notificationVisibleToTargetOnly =
|
||||
4; // 仅被操作者本人可见 - Visible to target only
|
||||
static const notificationVisibleToOperatorAndTarget =
|
||||
5; // 操作者和被操作者可见 - Visible to operator and target
|
||||
}
|
||||
@@ -50,22 +50,36 @@ class FriendshipManager {
|
||||
}));
|
||||
|
||||
/// Get Friend Requests Sent to Me
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient({String? operationID}) => _channel
|
||||
.invokeMethod(
|
||||
'getFriendApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient(
|
||||
{GetFriendApplicationListAsRecipientReq? req, String? operationID}) {
|
||||
if (req != null && req.offset > 0) {
|
||||
assert(req.count > 0, 'count must be greater than 0');
|
||||
}
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getFriendApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
'req': req?.toJson() ?? {},
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||
}
|
||||
|
||||
/// Get Friend Requests Sent by Me
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant({String? operationID}) => _channel
|
||||
.invokeMethod(
|
||||
'getFriendApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant(
|
||||
{GetFriendApplicationListAsApplicantReq? req, String? operationID}) {
|
||||
if (req != null && req.offset > 0) {
|
||||
assert(req.count > 0, 'count must be greater than 0');
|
||||
}
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getFriendApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
'req': req?.toJson() ?? {},
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||
}
|
||||
|
||||
/// Get Friend List, including friends who have been put into the blacklist
|
||||
Future<List<FriendInfo>> getFriendList({
|
||||
@@ -286,6 +300,17 @@ class FriendshipManager {
|
||||
.then((value) => value);
|
||||
}
|
||||
|
||||
Future<int> getFriendApplicationUnhandledCount(GetFriendApplicationUnhandledCountReq req,
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getFriendApplicationUnhandledCount',
|
||||
_buildParam({
|
||||
'req': req.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => int.parse(value));
|
||||
|
||||
static Map _buildParam(Map<String, dynamic> param) {
|
||||
param["ManagerName"] = "friendshipManager";
|
||||
param = Utils.cleanMap(param);
|
||||
|
||||
@@ -18,43 +18,39 @@ class GroupManager {
|
||||
/// Invite users to a group, allowing them to join without approval.
|
||||
/// [groupID] Group ID
|
||||
/// [userIDList] List of user IDs
|
||||
Future<List<GroupInviteResult>> inviteUserToGroup({
|
||||
Future inviteUserToGroup({
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'inviteUserToGroup',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||
_channel.invokeMethod(
|
||||
'inviteUserToGroup',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Remove group members
|
||||
/// [groupID] Group ID
|
||||
/// [userIDList] List of user IDs
|
||||
/// [reason] Reason for removal
|
||||
Future<List<GroupInviteResult>> kickGroupMember({
|
||||
Future kickGroupMember({
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'kickGroupMember',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||
_channel.invokeMethod(
|
||||
'kickGroupMember',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Query group member information
|
||||
/// [groupID] Group ID
|
||||
@@ -131,15 +127,17 @@ class GroupManager {
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
|
||||
Future<List<GroupInfo>> getJoinedGroupListPage({String? operationID, int offset = 0, int count = 40}) => _channel
|
||||
.invokeMethod(
|
||||
'getJoinedGroupListPage',
|
||||
_buildParam({
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
Future<List<GroupInfo>> getJoinedGroupListPage(
|
||||
{String? operationID, int offset = 0, int count = 40}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getJoinedGroupListPage',
|
||||
_buildParam({
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
|
||||
/// Query the list of joined groups
|
||||
Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
|
||||
@@ -218,7 +216,11 @@ class GroupManager {
|
||||
/// Apply to join a group, requiring approval from an administrator or the group.
|
||||
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code
|
||||
Future<dynamic> joinGroup(
|
||||
{required String groupID, String? reason, String? operationID, int joinSource = 3, String? ex}) =>
|
||||
{required String groupID,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
int joinSource = 3,
|
||||
String? ex}) =>
|
||||
_channel.invokeMethod(
|
||||
'joinGroup',
|
||||
_buildParam({
|
||||
@@ -258,22 +260,41 @@ class GroupManager {
|
||||
}));
|
||||
|
||||
/// Handle group membership applications received as a group owner or administrator
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({String? operationID}) => _channel
|
||||
.invokeMethod(
|
||||
'getGroupApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({
|
||||
GetGroupApplicationListAsRecipientReq? req,
|
||||
String? operationID,
|
||||
}) {
|
||||
if (req != null && req.offset > 0) {
|
||||
assert(req.count > 0, 'count must be greater than 0');
|
||||
}
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getGroupApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
'req': req?.toJson() ?? {},
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
/// Get the list of group membership applications sent by the user
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({String? operationID}) => _channel
|
||||
.invokeMethod(
|
||||
'getGroupApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({
|
||||
GetGroupApplicationListAsApplicantReq? req,
|
||||
String? operationID,
|
||||
}) {
|
||||
if (req != null && req.offset > 0) {
|
||||
assert(req.count > 0, 'count must be greater than 0');
|
||||
}
|
||||
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getGroupApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
'req': req?.toJson() ?? {},
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
/// Accept a group membership application as an administrator or group owner
|
||||
/// Note: Membership applications require approval from administrators or the group.
|
||||
@@ -584,13 +605,22 @@ class GroupManager {
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
Future<int> getGroupApplicationUnhandledCount(GetGroupApplicationUnhandledCountReq req,
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getGroupApplicationUnhandledCount',
|
||||
_buildParam({
|
||||
'req': req.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => int.parse(value));
|
||||
|
||||
static Map _buildParam(Map<String, dynamic> param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
param = Utils.cleanMap(param);
|
||||
log('param: $param');
|
||||
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
import 'package:flutter_openim_sdk/src/logger.dart';
|
||||
|
||||
|
||||
class IMManager {
|
||||
MethodChannel _channel;
|
||||
late ConversationManager conversationManager;
|
||||
@@ -60,7 +59,7 @@ class IMManager {
|
||||
case 'onUserTokenExpired':
|
||||
_connectListener.userTokenExpired();
|
||||
break;
|
||||
case 'onUserTokenInvalid':
|
||||
case 'onUserTokenInvalid':
|
||||
_connectListener.userTokenInvalid();
|
||||
break;
|
||||
}
|
||||
@@ -73,7 +72,8 @@ class IMManager {
|
||||
userManager.listener.selfInfoUpdated(userInfo);
|
||||
break;
|
||||
case 'onUserStatusChanged':
|
||||
final status = Utils.toObj(data, (map) => UserStatusInfo.fromJson(map));
|
||||
final status =
|
||||
Utils.toObj(data, (map) => UserStatusInfo.fromJson(map));
|
||||
userManager.listener.userStatusChanged(status);
|
||||
break;
|
||||
}
|
||||
@@ -82,19 +82,23 @@ class IMManager {
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onGroupApplicationAccepted':
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationAccepted(i);
|
||||
break;
|
||||
case 'onGroupApplicationAdded':
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationAdded(i);
|
||||
break;
|
||||
case 'onGroupApplicationDeleted':
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationDeleted(i);
|
||||
break;
|
||||
case 'onGroupApplicationRejected':
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationRejected(i);
|
||||
break;
|
||||
case 'onGroupDismissed':
|
||||
@@ -106,15 +110,18 @@ class IMManager {
|
||||
groupManager.listener.groupInfoChanged(i);
|
||||
break;
|
||||
case 'onGroupMemberAdded':
|
||||
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
final i =
|
||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
groupManager.listener.groupMemberAdded(i);
|
||||
break;
|
||||
case 'onGroupMemberDeleted':
|
||||
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
final i =
|
||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
groupManager.listener.groupMemberDeleted(i);
|
||||
break;
|
||||
case 'onGroupMemberInfoChanged':
|
||||
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
final i =
|
||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
groupManager.listener.groupMemberInfoChanged(i);
|
||||
break;
|
||||
case 'onJoinedGroupAdded':
|
||||
@@ -130,7 +137,6 @@ class IMManager {
|
||||
String type = call.arguments['type'];
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
|
||||
case 'onChannelDismissed':
|
||||
final i = Utils.toObj(data, (map) => ChannelInfo.fromJson(map));
|
||||
channelManager.listener.channelDismissed(i);
|
||||
@@ -140,18 +146,18 @@ class IMManager {
|
||||
channelManager.listener.channelInfoChanged(i);
|
||||
break;
|
||||
case 'onChannelMemberAdded':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => ChannelMembersInfo.fromJson(map));
|
||||
final i =
|
||||
Utils.toObj(data, (map) => ChannelMembersInfo.fromJson(map));
|
||||
channelManager.listener.channelMemberAdded(i);
|
||||
break;
|
||||
case 'onChannelMemberDeleted':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => ChannelMembersInfo.fromJson(map));
|
||||
final i =
|
||||
Utils.toObj(data, (map) => ChannelMembersInfo.fromJson(map));
|
||||
channelManager.listener.channelMemberDeleted(i);
|
||||
break;
|
||||
case 'onChannelMemberInfoChanged':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => ChannelMembersInfo.fromJson(map));
|
||||
final i =
|
||||
Utils.toObj(data, (map) => ChannelMembersInfo.fromJson(map));
|
||||
channelManager.listener.channelMemberInfoChanged(i);
|
||||
break;
|
||||
case 'onJoinedChannelAdded':
|
||||
@@ -163,7 +169,7 @@ class IMManager {
|
||||
channelManager.listener.joinedChannelDeleted(i);
|
||||
break;
|
||||
}
|
||||
}else if (call.method == ListenerType.advancedMsgListener) {
|
||||
} else if (call.method == ListenerType.advancedMsgListener) {
|
||||
var type = call.arguments['type'];
|
||||
// var id = call.arguments['data']['id'];
|
||||
switch (type) {
|
||||
@@ -184,7 +190,8 @@ class IMManager {
|
||||
break;
|
||||
case 'onRecvC2CReadReceipt':
|
||||
var value = call.arguments['data']['msgReceiptList'];
|
||||
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
var list =
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvC2CReadReceipt(list);
|
||||
break;
|
||||
case 'onRecvNewMessage':
|
||||
@@ -234,19 +241,24 @@ class IMManager {
|
||||
conversationManager.listener.syncServerFailed(data);
|
||||
break;
|
||||
case 'onNewConversation':
|
||||
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
var list =
|
||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
conversationManager.listener.newConversation(list);
|
||||
break;
|
||||
case 'onConversationChanged':
|
||||
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
var list =
|
||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
conversationManager.listener.conversationChanged(list);
|
||||
break;
|
||||
case 'onTotalUnreadMessageCountChanged':
|
||||
conversationManager.listener.totalUnreadMessageCountChanged(data ?? 0);
|
||||
conversationManager.listener
|
||||
.totalUnreadMessageCountChanged(data ?? 0);
|
||||
break;
|
||||
case 'onConversationUserInputStatusChanged':
|
||||
final i = Utils.toObj(data, (map) => InputStatusChangedData.fromJson(map));
|
||||
conversationManager.listener.conversationUserInputStatusChanged(i);
|
||||
final i = Utils.toObj(
|
||||
data, (map) => InputStatusChangedData.fromJson(map));
|
||||
conversationManager.listener
|
||||
.conversationUserInputStatusChanged(i);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.friendListener) {
|
||||
@@ -267,19 +279,23 @@ class IMManager {
|
||||
friendshipManager.listener.friendAdded(u);
|
||||
break;
|
||||
case 'onFriendApplicationAccepted':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationAccepted(u);
|
||||
break;
|
||||
case 'onFriendApplicationAdded':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationAdded(u);
|
||||
break;
|
||||
case 'onFriendApplicationDeleted':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationDeleted(u);
|
||||
break;
|
||||
case 'onFriendApplicationRejected':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationRejected(u);
|
||||
break;
|
||||
case 'onFriendDeleted':
|
||||
@@ -296,7 +312,8 @@ class IMManager {
|
||||
String data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onRecvCustomBusinessMessage':
|
||||
messageManager.customBusinessListener?.recvCustomBusinessMessage(data);
|
||||
messageManager.customBusinessListener
|
||||
?.recvCustomBusinessMessage(data);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.listenerForService) {
|
||||
@@ -304,19 +321,23 @@ class IMManager {
|
||||
String data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onFriendApplicationAccepted':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
_listenerForService?.friendApplicationAccepted(u);
|
||||
break;
|
||||
case 'onFriendApplicationAdded':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
_listenerForService?.friendApplicationAdded(u);
|
||||
break;
|
||||
case 'onGroupApplicationAccepted':
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
_listenerForService?.groupApplicationAccepted(i);
|
||||
break;
|
||||
case 'onGroupApplicationAdded':
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
_listenerForService?.groupApplicationAdded(i);
|
||||
break;
|
||||
case 'onRecvNewMessage':
|
||||
@@ -373,7 +394,8 @@ class IMManager {
|
||||
int fileSize = data['fileSize'];
|
||||
int streamSize = data['streamSize'];
|
||||
int storageSize = data['storageSize'];
|
||||
_uploadFileListener?.uploadProgress(id, fileSize, streamSize, storageSize);
|
||||
_uploadFileListener?.uploadProgress(
|
||||
id, fileSize, streamSize, storageSize);
|
||||
break;
|
||||
case 'uploadID':
|
||||
String id = data['id'];
|
||||
@@ -385,12 +407,14 @@ class IMManager {
|
||||
int index = data['index'];
|
||||
int partSize = data['partSize'];
|
||||
String partHash = data['partHash'];
|
||||
_uploadFileListener?.uploadPartComplete(id, index, partSize, partHash);
|
||||
_uploadFileListener?.uploadPartComplete(
|
||||
id, index, partSize, partHash);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (error, stackTrace) {
|
||||
Logger.print("回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
|
||||
Logger.print(
|
||||
"回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
|
||||
}
|
||||
return Future.value(null);
|
||||
});
|
||||
@@ -457,8 +481,8 @@ class IMManager {
|
||||
}
|
||||
|
||||
/// Deinitialize the SDK
|
||||
Future<dynamic> unInitSDK() {
|
||||
return _channel.invokeMethod('unInitSDK', _buildParam({}));
|
||||
void unInitSDK() {
|
||||
_channel.invokeMethod('unInitSDK', _buildParam({}));
|
||||
}
|
||||
|
||||
/// Login
|
||||
@@ -622,6 +646,86 @@ class IMManager {
|
||||
}
|
||||
}
|
||||
|
||||
//sdk多了这几个方法,增加一下
|
||||
Future setNotificationVisibilityRule(
|
||||
{required int notificationType,
|
||||
required int visibilityType,
|
||||
String? operationID}) =>
|
||||
_channel.invokeMethod(
|
||||
'setNotificationVisibilityRule',
|
||||
_buildParam({
|
||||
'notificationType': notificationType,
|
||||
'visibilityType': visibilityType,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
Future setNotificationVisibilityRules(
|
||||
{required String rulesJSON, String? operationID}) =>
|
||||
_channel.invokeMethod(
|
||||
'setNotificationVisibilityRules',
|
||||
_buildParam({
|
||||
'rulesJSON': rulesJSON,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
Future getNotificationVisibilityRule(
|
||||
{required int notificationType, String? operationID}) =>
|
||||
_channel.invokeMethod<int>(
|
||||
'getNotificationVisibilityRule',
|
||||
_buildParam({
|
||||
'notificationType': notificationType,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
|
||||
Future<Map<int, int>> getNotificationVisibilityRules(
|
||||
{String? operationID}) async {
|
||||
var result = await _channel.invokeMethod<Map<int, int>>(
|
||||
'getNotificationVisibilityRules',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
return result ?? <int, int>{};
|
||||
}
|
||||
|
||||
Future enableNotificationVisibilityRule(
|
||||
{required int notificationType, String? operationID}) =>
|
||||
_channel.invokeMethod(
|
||||
'enableNotificationVisibilityRule',
|
||||
_buildParam({
|
||||
'notificationType': notificationType,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
Future disableNotificationVisibilityRule(
|
||||
{required int notificationType, String? operationID}) =>
|
||||
_channel.invokeMethod(
|
||||
'disableNotificationVisibilityRule',
|
||||
_buildParam({
|
||||
'notificationType': notificationType,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
|
||||
Future deleteNotificationVisibilityRule(
|
||||
{required int notificationType, String? operationID}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteNotificationVisibilityRule',
|
||||
_buildParam({
|
||||
'notificationType': notificationType,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
|
||||
Future resetNotificationVisibilityRules({String? operationID}) =>
|
||||
_channel.invokeMethod(
|
||||
'resetNotificationVisibilityRules',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
|
||||
MethodChannel get channel => _channel;
|
||||
|
||||
static Map _buildParam(Map<String, dynamic> param) {
|
||||
|
||||
@@ -422,3 +422,90 @@ class GroupInviteResult {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class GetGroupApplicationListAsRecipientReq {
|
||||
final List<String> groupIDs;
|
||||
final List<int> handleResults;
|
||||
final int offset;
|
||||
final int count;
|
||||
|
||||
GetGroupApplicationListAsRecipientReq({
|
||||
this.groupIDs = const [],
|
||||
this.handleResults = const [],
|
||||
required this.offset,
|
||||
required this.count,
|
||||
});
|
||||
|
||||
GetGroupApplicationListAsRecipientReq.fromJson(Map<String, dynamic> json)
|
||||
: groupIDs = json['groupIDs'] == null ? [] : List<String>.from(json['groupIDs'].map((x) => x)),
|
||||
handleResults = json['handleResults'] == null ? [] : List<int>.from(json['handleResults'].map((x) => x)),
|
||||
offset = json['offset'],
|
||||
count = json['count'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
data['groupIDs'] = groupIDs;
|
||||
data['handleResults'] = handleResults;
|
||||
data['offset'] = offset;
|
||||
data['count'] = count;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetGroupApplicationListAsRecipientReq{groupIDs: $groupIDs, handleResults: $handleResults, offset: $offset, count: $count}';
|
||||
}
|
||||
}
|
||||
|
||||
class GetGroupApplicationListAsApplicantReq {
|
||||
final List<String> groupIDs;
|
||||
final List<int> handleResults;
|
||||
final int offset;
|
||||
final int count;
|
||||
|
||||
GetGroupApplicationListAsApplicantReq({
|
||||
this.groupIDs = const [],
|
||||
this.handleResults = const [],
|
||||
required this.offset,
|
||||
required this.count,
|
||||
});
|
||||
|
||||
GetGroupApplicationListAsApplicantReq.fromJson(Map<String, dynamic> json)
|
||||
: groupIDs = json['groupIDs'] == null ? [] : List<String>.from(json['groupIDs'].map((x) => x)),
|
||||
handleResults = json['handleResults'] == null ? [] : List<int>.from(json['handleResults'].map((x) => x)),
|
||||
offset = json['offset'],
|
||||
count = json['count'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
data['groupIDs'] = groupIDs;
|
||||
data['handleResults'] = handleResults;
|
||||
data['offset'] = offset;
|
||||
data['count'] = count;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetGroupApplicationListAsApplicantReq{groupIDs: $groupIDs, handleResults: $handleResults, offset: $offset, count: $count}';
|
||||
}
|
||||
}
|
||||
|
||||
class GetGroupApplicationUnhandledCountReq {
|
||||
final int time;
|
||||
|
||||
GetGroupApplicationUnhandledCountReq({this.time = 0});
|
||||
|
||||
GetGroupApplicationUnhandledCountReq.fromJson(Map<String, dynamic> json) : time = json['time'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
data['time'] = time;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetGroupApplicationUnhandledCountReq{time: $time}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import '../../flutter_openim_sdk.dart';
|
||||
|
||||
/// OA notification
|
||||
/// OA Notification
|
||||
class OANotification {
|
||||
/// Title
|
||||
String? notificationName;
|
||||
@@ -58,57 +58,50 @@ class OANotification {
|
||||
text = json['text'];
|
||||
externalUrl = json['externalUrl'];
|
||||
mixType = json['mixType'];
|
||||
pictureElem = json['pictureElem'] != null
|
||||
? PictureElem.fromJson(json['pictureElem'])
|
||||
: null;
|
||||
soundElem = json['soundElem'] != null
|
||||
? SoundElem.fromJson(json['soundElem'])
|
||||
: null;
|
||||
videoElem = json['videoElem'] != null
|
||||
? VideoElem.fromJson(json['videoElem'])
|
||||
: null;
|
||||
fileElem =
|
||||
json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
|
||||
pictureElem = json['pictureElem'] != null ? PictureElem.fromJson(json['pictureElem']) : null;
|
||||
soundElem = json['soundElem'] != null ? SoundElem.fromJson(json['soundElem']) : null;
|
||||
videoElem = json['videoElem'] != null ? VideoElem.fromJson(json['videoElem']) : null;
|
||||
fileElem = json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
|
||||
ex = json['ex'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['notificationName'] = this.notificationName;
|
||||
data['notificationFaceURL'] = this.notificationFaceURL;
|
||||
data['notificationType'] = this.notificationType;
|
||||
data['text'] = this.text;
|
||||
data['externalUrl'] = this.externalUrl;
|
||||
data['mixType'] = this.mixType;
|
||||
if (this.pictureElem != null) {
|
||||
data['pictureElem'] = this.pictureElem!.toJson();
|
||||
data['notificationName'] = notificationName;
|
||||
data['notificationFaceURL'] = notificationFaceURL;
|
||||
data['notificationType'] = notificationType;
|
||||
data['text'] = text;
|
||||
data['externalUrl'] = externalUrl;
|
||||
data['mixType'] = mixType;
|
||||
if (pictureElem != null) {
|
||||
data['pictureElem'] = pictureElem!.toJson();
|
||||
}
|
||||
if (this.soundElem != null) {
|
||||
data['soundElem'] = this.soundElem!.toJson();
|
||||
if (soundElem != null) {
|
||||
data['soundElem'] = soundElem!.toJson();
|
||||
}
|
||||
if (this.videoElem != null) {
|
||||
data['videoElem'] = this.videoElem!.toJson();
|
||||
if (videoElem != null) {
|
||||
data['videoElem'] = videoElem!.toJson();
|
||||
}
|
||||
if (this.fileElem != null) {
|
||||
data['fileElem'] = this.fileElem!.toJson();
|
||||
if (fileElem != null) {
|
||||
data['fileElem'] = fileElem!.toJson();
|
||||
}
|
||||
data['ex'] = this.ex;
|
||||
data['ex'] = ex;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 群事件通知
|
||||
/// Group Event Notification
|
||||
class GroupNotification {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 当前事件操作者信息
|
||||
/// Current event operator information
|
||||
GroupMembersInfo? opUser;
|
||||
|
||||
/// 群拥有者信息
|
||||
/// Group owner information
|
||||
GroupMembersInfo? groupOwnerUser;
|
||||
|
||||
/// 产生影响的群成员列表
|
||||
/// List of affected group members
|
||||
List<GroupMembersInfo>? memberList;
|
||||
|
||||
GroupNotification({
|
||||
@@ -120,12 +113,8 @@ class GroupNotification {
|
||||
|
||||
GroupNotification.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
opUser = json['opUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['opUser'])
|
||||
: null;
|
||||
groupOwnerUser = json['groupOwnerUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['groupOwnerUser'])
|
||||
: null;
|
||||
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
|
||||
groupOwnerUser = json['groupOwnerUser'] != null ? GroupMembersInfo.fromJson(json['groupOwnerUser']) : null;
|
||||
if (json['memberList'] != null) {
|
||||
memberList = <GroupMembersInfo>[];
|
||||
json['memberList'].forEach((v) {
|
||||
@@ -136,40 +125,42 @@ class GroupNotification {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.opUser != null) {
|
||||
data['opUser'] = this.opUser!.toJson();
|
||||
if (opUser != null) {
|
||||
data['opUser'] = opUser!.toJson();
|
||||
}
|
||||
if (this.groupOwnerUser != null) {
|
||||
data['groupOwnerUser'] = this.groupOwnerUser!.toJson();
|
||||
if (groupOwnerUser != null) {
|
||||
data['groupOwnerUser'] = groupOwnerUser!.toJson();
|
||||
}
|
||||
if (this.memberList != null) {
|
||||
data['memberList'] = this.memberList!.map((v) => v.toJson()).toList();
|
||||
if (memberList != null) {
|
||||
data['memberList'] = memberList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 用户被邀请进群通知
|
||||
/// User Invited to Join Group Notification
|
||||
class InvitedJoinGroupNotification {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 操作者信息
|
||||
/// Operator information
|
||||
GroupMembersInfo? opUser;
|
||||
|
||||
/// 被邀请进群的成员信息
|
||||
/// Inviter information
|
||||
GroupMembersInfo? inviterUser;
|
||||
|
||||
/// List of members invited to join the group
|
||||
List<GroupMembersInfo>? invitedUserList;
|
||||
|
||||
InvitedJoinGroupNotification({this.group, this.opUser, this.invitedUserList});
|
||||
|
||||
InvitedJoinGroupNotification.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
opUser = json['opUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['opUser'])
|
||||
: null;
|
||||
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
|
||||
inviterUser = json['inviterUser'] != null ? GroupMembersInfo.fromJson(json['inviterUser']) : null;
|
||||
if (json['invitedUserList'] != null) {
|
||||
invitedUserList = <GroupMembersInfo>[];
|
||||
json['invitedUserList'].forEach((v) {
|
||||
@@ -179,40 +170,39 @@ class InvitedJoinGroupNotification {
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.opUser != null) {
|
||||
data['opUser'] = this.opUser!.toJson();
|
||||
if (opUser != null) {
|
||||
data['opUser'] = opUser!.toJson();
|
||||
}
|
||||
if (this.invitedUserList != null) {
|
||||
data['invitedUserList'] =
|
||||
this.invitedUserList!.map((v) => v.toJson()).toList();
|
||||
if (inviterUser != null) {
|
||||
data['inviterUser'] = inviterUser!.toJson();
|
||||
}
|
||||
if (invitedUserList != null) {
|
||||
data['invitedUserList'] = invitedUserList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 组踢出成员通知
|
||||
/// Group Member Kicked Notification
|
||||
class KickedGroupMemeberNotification {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 操作者信息
|
||||
/// Operator information
|
||||
GroupMembersInfo? opUser;
|
||||
|
||||
/// 被踢出群的成员信息列表
|
||||
/// List of members kicked from the group
|
||||
List<GroupMembersInfo>? kickedUserList;
|
||||
|
||||
KickedGroupMemeberNotification(
|
||||
{this.group, this.opUser, this.kickedUserList});
|
||||
KickedGroupMemeberNotification({this.group, this.opUser, this.kickedUserList});
|
||||
|
||||
KickedGroupMemeberNotification.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
opUser = json['opUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['opUser'])
|
||||
: null;
|
||||
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
|
||||
if (json['kickedUserList'] != null) {
|
||||
kickedUserList = <GroupMembersInfo>[];
|
||||
json['kickedUserList'].forEach((v) {
|
||||
@@ -223,87 +213,82 @@ class KickedGroupMemeberNotification {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.opUser != null) {
|
||||
data['opUser'] = this.opUser!.toJson();
|
||||
if (opUser != null) {
|
||||
data['opUser'] = opUser!.toJson();
|
||||
}
|
||||
if (this.kickedUserList != null) {
|
||||
data['kickedUserList'] =
|
||||
this.kickedUserList!.map((v) => v.toJson()).toList();
|
||||
if (kickedUserList != null) {
|
||||
data['kickedUserList'] = kickedUserList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 退出群通知
|
||||
/// Quit Group Notification
|
||||
class QuitGroupNotification {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 退群的成员信息
|
||||
/// Information of the member who quit the group
|
||||
GroupMembersInfo? quitUser;
|
||||
|
||||
QuitGroupNotification({this.group, this.quitUser});
|
||||
|
||||
QuitGroupNotification.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
quitUser = json['quitUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['quitUser'])
|
||||
: null;
|
||||
quitUser = json['quitUser'] != null ? GroupMembersInfo.fromJson(json['quitUser']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.quitUser != null) {
|
||||
data['quitUser'] = this.quitUser!.toJson();
|
||||
if (quitUser != null) {
|
||||
data['quitUser'] = quitUser!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 进群通知
|
||||
/// Enter Group Notification
|
||||
class EnterGroupNotification {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 进入群的成员信息
|
||||
/// Information of the member who entered the group
|
||||
GroupMembersInfo? entrantUser;
|
||||
|
||||
EnterGroupNotification({this.group, this.entrantUser});
|
||||
|
||||
EnterGroupNotification.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
entrantUser = json['entrantUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['entrantUser'])
|
||||
: null;
|
||||
entrantUser = json['entrantUser'] != null ? GroupMembersInfo.fromJson(json['entrantUser']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.entrantUser != null) {
|
||||
data['quitUser'] = this.entrantUser!.toJson();
|
||||
if (entrantUser != null) {
|
||||
data['entrantUser'] = entrantUser!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 群权转让通知
|
||||
/// Group Rights Transfer Notification
|
||||
class GroupRightsTransferNoticication {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 操作者信息
|
||||
/// Operator information
|
||||
GroupMembersInfo? opUser;
|
||||
|
||||
/// 群新的拥有者信息
|
||||
/// New group owner information
|
||||
GroupMembersInfo? newGroupOwner;
|
||||
|
||||
GroupRightsTransferNoticication({
|
||||
@@ -314,41 +299,37 @@ class GroupRightsTransferNoticication {
|
||||
|
||||
GroupRightsTransferNoticication.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
opUser = json['opUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['opUser'])
|
||||
: null;
|
||||
newGroupOwner = json['newGroupOwner'] != null
|
||||
? GroupMembersInfo.fromJson(json['newGroupOwner'])
|
||||
: null;
|
||||
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
|
||||
newGroupOwner = json['newGroupOwner'] != null ? GroupMembersInfo.fromJson(json['newGroupOwner']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.opUser != null) {
|
||||
data['opUser'] = this.opUser!.toJson();
|
||||
if (opUser != null) {
|
||||
data['opUser'] = opUser!.toJson();
|
||||
}
|
||||
if (this.newGroupOwner != null) {
|
||||
data['newGroupOwner'] = this.newGroupOwner!.toJson();
|
||||
if (newGroupOwner != null) {
|
||||
data['newGroupOwner'] = newGroupOwner!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 禁言成员通知
|
||||
/// Mute Member Notification
|
||||
class MuteMemberNotification {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 操作者信息
|
||||
/// Operator information
|
||||
GroupMembersInfo? opUser;
|
||||
|
||||
/// 被禁言的成员信息
|
||||
/// Muted member information
|
||||
GroupMembersInfo? mutedUser;
|
||||
|
||||
/// 禁言时间s
|
||||
/// Mute duration in seconds
|
||||
int? mutedSeconds;
|
||||
|
||||
MuteMemberNotification({
|
||||
@@ -360,40 +341,36 @@ class MuteMemberNotification {
|
||||
|
||||
MuteMemberNotification.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
opUser = json['opUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['opUser'])
|
||||
: null;
|
||||
mutedUser = json['mutedUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['mutedUser'])
|
||||
: null;
|
||||
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
|
||||
mutedUser = json['mutedUser'] != null ? GroupMembersInfo.fromJson(json['mutedUser']) : null;
|
||||
mutedSeconds = json['mutedSeconds'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.opUser != null) {
|
||||
data['opUser'] = this.opUser!.toJson();
|
||||
if (opUser != null) {
|
||||
data['opUser'] = opUser!.toJson();
|
||||
}
|
||||
if (this.mutedUser != null) {
|
||||
data['mutedUser'] = this.mutedUser!.toJson();
|
||||
if (mutedUser != null) {
|
||||
data['mutedUser'] = mutedUser!.toJson();
|
||||
}
|
||||
data['mutedSeconds'] = this.mutedSeconds;
|
||||
data['mutedSeconds'] = mutedSeconds;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 阅后即焚通知
|
||||
/// Burn After Reading Notification
|
||||
class BurnAfterReadingNotification {
|
||||
/// 接收者
|
||||
/// Receiver
|
||||
String? recvID;
|
||||
|
||||
/// 发送者
|
||||
/// Sender
|
||||
String? sendID;
|
||||
|
||||
/// 是否开启
|
||||
/// Whether enabled
|
||||
bool? isPrivate;
|
||||
|
||||
BurnAfterReadingNotification({this.recvID, this.sendID, this.isPrivate});
|
||||
@@ -406,22 +383,22 @@ class BurnAfterReadingNotification {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['recvID'] = this.recvID;
|
||||
data['sendID'] = this.sendID;
|
||||
data['isPrivate'] = this.isPrivate;
|
||||
data['recvID'] = recvID;
|
||||
data['sendID'] = sendID;
|
||||
data['isPrivate'] = isPrivate;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 群成员信息发送变化通知
|
||||
/// Group Member Information Changed Notification
|
||||
class GroupMemberInfoChangedNotification {
|
||||
/// 群信息
|
||||
/// Group information
|
||||
GroupInfo? group;
|
||||
|
||||
/// 操作者信息
|
||||
/// Operator information
|
||||
GroupMembersInfo? opUser;
|
||||
|
||||
/// 资料发生改变的成员
|
||||
/// Member with changed information
|
||||
GroupMembersInfo? changedUser;
|
||||
|
||||
GroupMemberInfoChangedNotification({
|
||||
@@ -432,24 +409,20 @@ class GroupMemberInfoChangedNotification {
|
||||
|
||||
GroupMemberInfoChangedNotification.fromJson(Map<String, dynamic> json) {
|
||||
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||
opUser = json['opUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['opUser'])
|
||||
: null;
|
||||
changedUser = json['changedUser'] != null
|
||||
? GroupMembersInfo.fromJson(json['changedUser'])
|
||||
: null;
|
||||
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
|
||||
changedUser = json['changedUser'] != null ? GroupMembersInfo.fromJson(json['changedUser']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.group != null) {
|
||||
data['group'] = this.group!.toJson();
|
||||
if (group != null) {
|
||||
data['group'] = group!.toJson();
|
||||
}
|
||||
if (this.opUser != null) {
|
||||
data['opUser'] = this.opUser!.toJson();
|
||||
if (opUser != null) {
|
||||
data['opUser'] = opUser!.toJson();
|
||||
}
|
||||
if (this.changedUser != null) {
|
||||
data['changedUser'] = this.changedUser!.toJson();
|
||||
if (changedUser != null) {
|
||||
data['changedUser'] = changedUser!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
@@ -707,3 +680,4 @@ class ChannelMemberInfoChangedNotification {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +124,6 @@ class SearchFriendsInfo extends FriendInfo {
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = super.toJson();
|
||||
data['relationship'] = this.relationship;
|
||||
return data ?? {};
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,3 +423,78 @@ class UserStatusInfo {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class GetFriendApplicationListAsRecipientReq {
|
||||
final List<int> handleResults;
|
||||
final int offset;
|
||||
final int count;
|
||||
|
||||
GetFriendApplicationListAsRecipientReq({
|
||||
this.handleResults = const [],
|
||||
required this.offset,
|
||||
required this.count,
|
||||
});
|
||||
|
||||
GetFriendApplicationListAsRecipientReq.fromJson(Map<String, dynamic> json)
|
||||
: handleResults = json['handleResults'] == null ? [] : List<int>.from(json['handleResults'].map((x) => x)),
|
||||
offset = json['offset'],
|
||||
count = json['count'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
data['handleResults'] = handleResults;
|
||||
data['offset'] = offset;
|
||||
data['count'] = count;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetFriendApplicationListAsRecipientReq{handleResults: $handleResults, offset: $offset, count: $count}';
|
||||
}
|
||||
}
|
||||
|
||||
class GetFriendApplicationListAsApplicantReq {
|
||||
final int offset;
|
||||
final int count;
|
||||
|
||||
GetFriendApplicationListAsApplicantReq({
|
||||
required this.offset,
|
||||
required this.count,
|
||||
});
|
||||
|
||||
GetFriendApplicationListAsApplicantReq.fromJson(Map<String, dynamic> json)
|
||||
: offset = json['offset'],
|
||||
count = json['count'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
data['offset'] = offset;
|
||||
data['count'] = count;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetFriendApplicationListAsApplicantReq{offset: $offset, count: $count}';
|
||||
}
|
||||
}
|
||||
|
||||
class GetFriendApplicationUnhandledCountReq {
|
||||
final int time;
|
||||
|
||||
GetFriendApplicationUnhandledCountReq({this.time = 0});
|
||||
|
||||
GetFriendApplicationUnhandledCountReq.fromJson(Map<String, dynamic> json) : time = json['time'];
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
data['time'] = time;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetSelfUnhandledApplyCountReq{time: $time}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OpenIM {
|
||||
static const version = '3.8.3+2';
|
||||
static const version = '3.8.3+hotfix.10.1';
|
||||
|
||||
static const _channel = MethodChannel('flutter_openim_sdk');
|
||||
|
||||
|
||||
76
pubspec.lock
76
pubspec.lock
@@ -5,50 +5,50 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.11.0"
|
||||
version: "2.13.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.4.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.18.0"
|
||||
version: "1.19.1"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
version: "1.3.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -63,18 +63,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
|
||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.5"
|
||||
version: "10.0.9"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
|
||||
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.5"
|
||||
version: "3.0.9"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -87,10 +87,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16+1"
|
||||
version: "0.12.17"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -103,71 +103,71 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.0"
|
||||
version: "1.9.1"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
version: "0.0.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.10.1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
version: "1.12.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.4"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.4.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
version: "1.2.2"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
|
||||
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.2"
|
||||
version: "0.7.4"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -180,10 +180,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
|
||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.5"
|
||||
version: "15.0.0"
|
||||
sdks:
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: flutter_openim_sdk
|
||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||
version: 3.8.3+2
|
||||
version: 3.8.3+hotfix.10.1
|
||||
homepage: https://www.openim.io
|
||||
repository: https://github.com/openimsdk/open-im-sdk-flutter
|
||||
|
||||
@@ -11,7 +11,7 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
@@ -14,13 +14,6 @@ namespace ThreadUtil {
|
||||
static std::condition_variable g_queueCondition;
|
||||
static bool g_initialized = false;
|
||||
static HANDLE g_workerThread = NULL;
|
||||
|
||||
// Function to initialize the platform thread ID
|
||||
void InitializePlatformThreadId() {
|
||||
g_platformThreadId = GetCurrentThreadId();
|
||||
g_initialized = true;
|
||||
}
|
||||
|
||||
// Worker thread function
|
||||
unsigned __stdcall WorkerThreadProc(void* param) {
|
||||
while (true) {
|
||||
@@ -39,6 +32,16 @@ namespace ThreadUtil {
|
||||
|
||||
return 0;
|
||||
}
|
||||
// Function to initialize the platform thread ID
|
||||
void InitializePlatformThreadId() {
|
||||
g_platformThreadId = GetCurrentThreadId();
|
||||
|
||||
// Create worker thread
|
||||
g_workerThread = (HANDLE)_beginthreadex(NULL, 0, WorkerThreadProc, NULL, 0, NULL);
|
||||
g_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Function to ensure code runs on the platform thread
|
||||
void RunOnPlatformThread(std::function<void()> callback) {
|
||||
@@ -46,8 +49,7 @@ namespace ThreadUtil {
|
||||
if (!g_initialized) {
|
||||
InitializePlatformThreadId();
|
||||
|
||||
// Create worker thread
|
||||
g_workerThread = (HANDLE)_beginthreadex(NULL, 0, WorkerThreadProc, NULL, 0, NULL);
|
||||
|
||||
}
|
||||
|
||||
// If we're already on the platform thread, execute directly
|
||||
|
||||
@@ -69,3 +69,6 @@ std::string map_2_json(const flutter::EncodableMap& map) {
|
||||
auto json_string = json_object.dump(); // 序列化为 JSON 字符串
|
||||
return json_string; // 序列化为 JSON 字符串
|
||||
}
|
||||
std::string value_2_json(flutter::EncodableValue value){
|
||||
return EncodableValueToJson(value).dump();
|
||||
}
|
||||
@@ -31,6 +31,6 @@ std::vector<uint8_t> zego_value_get_vector_uint8(flutter::EncodableValue value);
|
||||
ZFMap zego_value_get_map(flutter::EncodableValue value);
|
||||
ZFArray zego_value_get_list(flutter::EncodableValue value);
|
||||
std::string map_2_json(const flutter::EncodableMap& map);
|
||||
|
||||
|
||||
std::string value_2_json(flutter::EncodableValue value);
|
||||
nlohmann::json EncodableValueToJson(const flutter::EncodableValue& value);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void ChannelManagerService::getChannelMembersInfo(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto channelID = zego_value_get_string(arguments->at(flutter::EncodableValue("channelID")));
|
||||
auto userIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
auto userIDList = value_2_json(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* channelID_cs = const_cast<char*>(channelID.c_str());
|
||||
char* userIDList_cs = const_cast<char*>(userIDList.c_str());
|
||||
@@ -89,7 +89,7 @@ void ChannelManagerService::getChannelsInfo(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto channelIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("channelIDList")));
|
||||
auto channelIDList = value_2_json(arguments->at(flutter::EncodableValue("channelIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* channelIDList_cs = const_cast<char*>(channelIDList.c_str());
|
||||
|
||||
@@ -189,7 +189,7 @@ void ChannelManagerService::getUsersInChannel(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto channelID = zego_value_get_string(arguments->at(flutter::EncodableValue("channelID")));
|
||||
auto userIDs = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
auto userIDs = value_2_json(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* channelID_cs = const_cast<char*>(channelID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
|
||||
@@ -8,49 +8,48 @@
|
||||
|
||||
class ChannelManagerService : public FLTService
|
||||
{
|
||||
|
||||
public:
|
||||
ChannelManagerService();
|
||||
|
||||
void onMethodCalled(
|
||||
const std::string &method,
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
public:
|
||||
ChannelManagerService();
|
||||
|
||||
// Method handlers
|
||||
void setChannelListener(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getChannelMembersInfo(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getChannelMemberList(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getChannelsInfo(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void joinChannel(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void quitChannel(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeChannelMute(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeChannelMemberMute(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void isJoinChannel(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUsersInChannel(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
virtual void onMethodCalled(
|
||||
const std::string& method, const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result)
|
||||
override;
|
||||
|
||||
private:
|
||||
std::string m_serviceName;
|
||||
};
|
||||
// Method handlers
|
||||
void setChannelListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getChannelMembersInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getChannelMemberList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getChannelsInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void joinChannel(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void quitChannel(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeChannelMute(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeChannelMemberMute(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void isJoinChannel(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUsersInChannel(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // CHANNEL_MANAGER_SERVICE_H
|
||||
@@ -116,7 +116,7 @@ void ConversationManagerService::getMultipleConversation(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto conversationIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("conversationIDList")));
|
||||
auto conversationIDList = value_2_json(arguments->at(flutter::EncodableValue("conversationIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* conversationIDList_cs = const_cast<char*>(conversationIDList.c_str());
|
||||
|
||||
@@ -314,7 +314,7 @@ void ConversationManagerService::setConversation(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto conversationID = zego_value_get_string(arguments->at(flutter::EncodableValue("conversationID")));
|
||||
auto req = zego_value_get_string(arguments->at(flutter::EncodableValue("req")));
|
||||
auto req = value_2_json(arguments->at(flutter::EncodableValue("req")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* conversationID_cs = const_cast<char*>(conversationID.c_str());
|
||||
char* req_cs = const_cast<char*>(req.c_str());
|
||||
|
||||
@@ -6,77 +6,76 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class ConversationManagerService: public FLTService {
|
||||
class ConversationManagerService : public FLTService {
|
||||
public:
|
||||
ConversationManagerService();
|
||||
ConversationManagerService();
|
||||
|
||||
|
||||
void onMethodCalled(
|
||||
const std::string& method,
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
virtual void onMethodCalled(
|
||||
const std::string& method, const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result)
|
||||
override;
|
||||
|
||||
// Method handlers
|
||||
void setConversationListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAllConversationList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getConversationListSplit(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getOneConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getMultipleConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setConversationDraft(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void hideConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void markConversationMessageAsRead(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getTotalUnreadMsgCount(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getConversationIDBySessionType(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void clearConversationAndDeleteAllMsg(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteConversationAndDeleteAllMsg(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAtAllTag(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void hideAllConversations(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeInputStates(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getInputStates(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchConversations(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
// Method handlers
|
||||
void setConversationListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAllConversationList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getConversationListSplit(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getOneConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getMultipleConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setConversationDraft(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void hideConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void markConversationMessageAsRead(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getTotalUnreadMsgCount(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getConversationIDBySessionType(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void clearConversationAndDeleteAllMsg(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteConversationAndDeleteAllMsg(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAtAllTag(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void hideAllConversations(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeInputStates(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getInputStates(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setConversation(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchConversations(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
private:
|
||||
std::string m_serviceName;
|
||||
};
|
||||
|
||||
#endif // CONVERSATION_MANAGER_SERVICE_H
|
||||
@@ -107,7 +107,7 @@ void FriendshipManagerService::getFriendsInfo(
|
||||
if (arguments)
|
||||
{
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
auto userIDList = value_2_json(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
auto filterBlack = zego_value_get_bool(arguments->at(flutter::EncodableValue("filterBlack")));
|
||||
char *operationID_cs = const_cast<char *>(operationID.c_str());
|
||||
char *userIDList_cs = const_cast<char *>(userIDList.c_str());
|
||||
@@ -275,7 +275,7 @@ void FriendshipManagerService::checkFriend(
|
||||
if (arguments)
|
||||
{
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
auto userIDList = value_2_json(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
char *operationID_cs = const_cast<char *>(operationID.c_str());
|
||||
char *userIDList_cs = const_cast<char *>(userIDList.c_str());
|
||||
|
||||
@@ -351,7 +351,7 @@ void FriendshipManagerService::searchFriends(
|
||||
if (arguments)
|
||||
{
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto searchParam = zego_value_get_string(arguments->at(flutter::EncodableValue("searchParam")));
|
||||
auto searchParam = value_2_json(arguments->at(flutter::EncodableValue("searchParam")));
|
||||
char *operationID_cs = const_cast<char *>(operationID.c_str());
|
||||
char *searchParam_cs = const_cast<char *>(searchParam.c_str());
|
||||
|
||||
@@ -370,7 +370,7 @@ void FriendshipManagerService::updateFriends(
|
||||
if (arguments)
|
||||
{
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto req = zego_value_get_string(arguments->at(flutter::EncodableValue("req")));
|
||||
auto req = value_2_json(arguments->at(flutter::EncodableValue("req")));
|
||||
char *operationID_cs = const_cast<char *>(operationID.c_str());
|
||||
char *req_cs = const_cast<char *>(req.c_str());
|
||||
|
||||
|
||||
@@ -10,65 +10,63 @@
|
||||
class FriendshipManagerService : public FLTService
|
||||
{
|
||||
public:
|
||||
FriendshipManagerService();
|
||||
FriendshipManagerService();
|
||||
|
||||
void onMethodCalled(
|
||||
const std::string &method,
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
virtual void onMethodCalled(
|
||||
const std::string& method, const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result)
|
||||
override;
|
||||
|
||||
// Method handlers
|
||||
void setFriendListener(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendsInfo(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void addFriend(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendApplicationListAsRecipient(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendApplicationListAsApplicant(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendList(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendListPage(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void addBlacklist(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getBlacklist(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void removeBlacklist(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void checkFriend(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteFriend(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void acceptFriendApplication(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void refuseFriendApplication(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchFriends(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void updateFriends(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
// Method handlers
|
||||
void setFriendListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendsInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void addFriend(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendApplicationListAsRecipient(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendApplicationListAsApplicant(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getFriendListPage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void addBlacklist(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getBlacklist(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void removeBlacklist(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void checkFriend(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteFriend(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void acceptFriendApplication(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void refuseFriendApplication(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchFriends(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void updateFriends(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
private:
|
||||
std::string m_serviceName;
|
||||
};
|
||||
|
||||
#endif // FRIENDSHIP_MANAGER_SERVICE_H
|
||||
@@ -90,7 +90,7 @@ void GroupManagerService::inviteUserToGroup(
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto groupID = zego_value_get_string(arguments->at(flutter::EncodableValue("groupID")));
|
||||
auto reason = zego_value_get_string(arguments->at(flutter::EncodableValue("reason")));
|
||||
auto userIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
auto userIDList = value_2_json(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* groupID_cs = const_cast<char*>(groupID.c_str());
|
||||
char* reason_cs = const_cast<char*>(reason.c_str());
|
||||
@@ -109,7 +109,7 @@ void GroupManagerService::kickGroupMember(
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto groupID = zego_value_get_string(arguments->at(flutter::EncodableValue("groupID")));
|
||||
auto reason = zego_value_get_string(arguments->at(flutter::EncodableValue("reason")));
|
||||
auto userIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
auto userIDList = value_2_json(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* groupID_cs = const_cast<char*>(groupID.c_str());
|
||||
char* reason_cs = const_cast<char*>(reason.c_str());
|
||||
@@ -127,7 +127,7 @@ void GroupManagerService::getGroupMembersInfo(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto groupID = zego_value_get_string(arguments->at(flutter::EncodableValue("groupID")));
|
||||
auto userIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
auto userIDList = value_2_json(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* groupID_cs = const_cast<char*>(groupID.c_str());
|
||||
char* userIDList_cs = const_cast<char*>(userIDList.c_str());
|
||||
@@ -204,7 +204,7 @@ void GroupManagerService::setGroupInfo(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto groupInfo = zego_value_get_string(arguments->at(flutter::EncodableValue("groupInfo")));
|
||||
auto groupInfo = value_2_json(arguments->at(flutter::EncodableValue("groupInfo")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* groupInfo_cs = const_cast<char*>(groupInfo.c_str());
|
||||
|
||||
@@ -219,7 +219,7 @@ void GroupManagerService::getGroupsInfo(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto groupIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("groupIDList")));
|
||||
auto groupIDList = value_2_json(arguments->at(flutter::EncodableValue("groupIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* groupIDList_cs = const_cast<char*>(groupIDList.c_str());
|
||||
|
||||
@@ -399,7 +399,7 @@ void GroupManagerService::searchGroups(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto searchParam = zego_value_get_string(arguments->at(flutter::EncodableValue("searchParam")));
|
||||
auto searchParam = value_2_json(arguments->at(flutter::EncodableValue("searchParam")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* searchParam_cs = const_cast<char*>(searchParam.c_str());
|
||||
|
||||
@@ -419,7 +419,7 @@ void GroupManagerService::getGroupMemberListByJoinTimeFilter(
|
||||
auto count = zego_value_get_int(arguments->at(flutter::EncodableValue("count")));
|
||||
auto joinTimeBegin = zego_value_get_int(arguments->at(flutter::EncodableValue("joinTimeBegin")));
|
||||
auto joinTimeEnd = zego_value_get_int(arguments->at(flutter::EncodableValue("joinTimeEnd")));
|
||||
auto excludeUserIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("excludeUserIDList")));
|
||||
auto excludeUserIDList = value_2_json(arguments->at(flutter::EncodableValue("excludeUserIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* groupID_cs = const_cast<char*>(groupID.c_str());
|
||||
char* excludeUserIDList_cs = const_cast<char*>(excludeUserIDList.c_str());
|
||||
@@ -450,7 +450,7 @@ void GroupManagerService::searchGroupMembers(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto searchParam = zego_value_get_string(arguments->at(flutter::EncodableValue("searchParam")));
|
||||
auto searchParam = value_2_json(arguments->at(flutter::EncodableValue("searchParam")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* searchParam_cs = const_cast<char*>(searchParam.c_str());
|
||||
|
||||
@@ -465,7 +465,7 @@ void GroupManagerService::setGroupMemberInfo(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto info = zego_value_get_string(arguments->at(flutter::EncodableValue("info")));
|
||||
auto info = value_2_json(arguments->at(flutter::EncodableValue("info")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* info_cs = const_cast<char*>(info.c_str());
|
||||
|
||||
@@ -496,7 +496,7 @@ void GroupManagerService::getUsersInGroup(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto groupID = zego_value_get_string(arguments->at(flutter::EncodableValue("groupID")));
|
||||
auto userIDs = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
auto userIDs = value_2_json(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* groupID_cs = const_cast<char*>(groupID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
|
||||
@@ -10,98 +10,97 @@
|
||||
class GroupManagerService : public FLTService
|
||||
{
|
||||
public:
|
||||
GroupManagerService();
|
||||
GroupManagerService();
|
||||
|
||||
void onMethodCalled(
|
||||
const std::string &method,
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
virtual void onMethodCalled(
|
||||
const std::string& method, const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result)
|
||||
override;
|
||||
|
||||
// Method handlers
|
||||
void setGroupListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void inviteUserToGroup(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void kickGroupMember(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMembersInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMemberList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getJoinedGroupList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getJoinedGroupListPage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createGroup(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setGroupInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupsInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void joinGroup(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void quitGroup(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void transferGroupOwner(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupApplicationListAsRecipient(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupApplicationListAsApplicant(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void acceptGroupApplication(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void refuseGroupApplication(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void dismissGroup(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeGroupMute(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeGroupMemberMute(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchGroups(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMemberListByJoinTimeFilter(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMemberOwnerAndAdmin(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchGroupMembers(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setGroupMemberInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void isJoinGroup(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUsersInGroup(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
// Method handlers
|
||||
void setGroupListener(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void inviteUserToGroup(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void kickGroupMember(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMembersInfo(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMemberList(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getJoinedGroupList(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getJoinedGroupListPage(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createGroup(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setGroupInfo(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupsInfo(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void joinGroup(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void quitGroup(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void transferGroupOwner(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupApplicationListAsRecipient(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupApplicationListAsApplicant(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void acceptGroupApplication(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void refuseGroupApplication(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void dismissGroup(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeGroupMute(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void changeGroupMemberMute(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchGroups(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMemberListByJoinTimeFilter(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getGroupMemberOwnerAndAdmin(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchGroupMembers(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setGroupMemberInfo(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void isJoinGroup(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUsersInGroup(
|
||||
const flutter::EncodableMap *arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
private:
|
||||
std::string m_serviceName;
|
||||
};
|
||||
|
||||
#endif // GROUP_MANAGER_SERVICE_H
|
||||
@@ -125,13 +125,16 @@ void MessageManagerService::sendMessage(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto message = zego_value_get_string(arguments->at(flutter::EncodableValue("message")));
|
||||
auto message = value_2_json(arguments->at(flutter::EncodableValue("message")));
|
||||
auto userID = zego_value_get_string(arguments->at(flutter::EncodableValue("userID")));
|
||||
auto groupID = zego_value_get_string(arguments->at(flutter::EncodableValue("groupID")));
|
||||
auto channelID = zego_value_get_string(arguments->at(flutter::EncodableValue("channelID")));
|
||||
auto offlinePushInfo = zego_value_get_string(arguments->at(flutter::EncodableValue("offlinePushInfo")));
|
||||
auto offlinePushInfo = value_2_json(arguments->at(flutter::EncodableValue("offlinePushInfo")));
|
||||
auto isOnlineOnly = zego_value_get_bool(arguments->at(flutter::EncodableValue("isOnlineOnly")));
|
||||
auto clientMsgID = zego_value_get_string(arguments->at(flutter::EncodableValue("clientMsgID")));
|
||||
auto json = EncodableValueToJson(arguments->at(flutter::EncodableValue("message")));
|
||||
auto clientMsgID = json["clientMsgID"].get<std::string>();
|
||||
|
||||
|
||||
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* message_cs = const_cast<char*>(message.c_str());
|
||||
@@ -170,7 +173,7 @@ void MessageManagerService::editMessage(
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto conversationID = zego_value_get_string(arguments->at(flutter::EncodableValue("conversationID")));
|
||||
auto clientMsgID = zego_value_get_string(arguments->at(flutter::EncodableValue("clientMsgID")));
|
||||
auto message = zego_value_get_string(arguments->at(flutter::EncodableValue("message")));
|
||||
auto message = value_2_json(arguments->at(flutter::EncodableValue("message")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* conversationID_cs = const_cast<char*>(conversationID.c_str());
|
||||
char* clientMsgID_cs = const_cast<char*>(clientMsgID.c_str());
|
||||
@@ -247,7 +250,7 @@ void MessageManagerService::insertSingleMessageToLocalStorage(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto message = zego_value_get_string(arguments->at(flutter::EncodableValue("message")));
|
||||
auto message = value_2_json(arguments->at(flutter::EncodableValue("message")));
|
||||
auto receiverID = zego_value_get_string(arguments->at(flutter::EncodableValue("receiverID")));
|
||||
auto senderID = zego_value_get_string(arguments->at(flutter::EncodableValue("senderID")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
@@ -266,7 +269,7 @@ void MessageManagerService::insertGroupMessageToLocalStorage(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto message = zego_value_get_string(arguments->at(flutter::EncodableValue("message")));
|
||||
auto message = value_2_json(arguments->at(flutter::EncodableValue("message")));
|
||||
auto groupID = zego_value_get_string(arguments->at(flutter::EncodableValue("groupID")));
|
||||
auto channelID = zego_value_get_string(arguments->at(flutter::EncodableValue("channelID")));
|
||||
auto senderID = zego_value_get_string(arguments->at(flutter::EncodableValue("senderID")));
|
||||
@@ -288,7 +291,7 @@ void MessageManagerService::markMessagesAsReadByMsgID(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto conversationID = zego_value_get_string(arguments->at(flutter::EncodableValue("conversationID")));
|
||||
auto messageIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("messageIDList")));
|
||||
auto messageIDList = value_2_json(arguments->at(flutter::EncodableValue("messageIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* conversationID_cs = const_cast<char*>(conversationID.c_str());
|
||||
char* messageIDList_cs = const_cast<char*>(messageIDList.c_str());
|
||||
@@ -338,9 +341,9 @@ void MessageManagerService::createTextAtMessage(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto text = zego_value_get_string(arguments->at(flutter::EncodableValue("text")));
|
||||
auto atUserIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("atUserIDList")));
|
||||
auto atUserInfoList = zego_value_get_string(arguments->at(flutter::EncodableValue("atUserInfoList")));
|
||||
auto quoteMessage = zego_value_get_string(arguments->at(flutter::EncodableValue("quoteMessage")));
|
||||
auto atUserIDList = value_2_json(arguments->at(flutter::EncodableValue("atUserIDList")));
|
||||
auto atUserInfoList = value_2_json(arguments->at(flutter::EncodableValue("atUserInfoList")));
|
||||
auto quoteMessage = value_2_json(arguments->at(flutter::EncodableValue("quoteMessage")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* text_cs = const_cast<char*>(text.c_str());
|
||||
char* atUserIDList_cs = const_cast<char*>(atUserIDList.c_str());
|
||||
@@ -503,9 +506,9 @@ void MessageManagerService::createMergerMessage(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto messageList = zego_value_get_string(arguments->at(flutter::EncodableValue("messageList")));
|
||||
auto messageList = value_2_json(arguments->at(flutter::EncodableValue("messageList")));
|
||||
auto title = zego_value_get_string(arguments->at(flutter::EncodableValue("title")));
|
||||
auto summaryList = zego_value_get_string(arguments->at(flutter::EncodableValue("summaryList")));
|
||||
auto summaryList = value_2_json(arguments->at(flutter::EncodableValue("summaryList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* messageList_cs = const_cast<char*>(messageList.c_str());
|
||||
char* title_cs = const_cast<char*>(title.c_str());
|
||||
@@ -523,7 +526,7 @@ void MessageManagerService::createForwardMessage(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto message = zego_value_get_string(arguments->at(flutter::EncodableValue("message")));
|
||||
auto message = value_2_json(arguments->at(flutter::EncodableValue("message")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* message_cs = const_cast<char*>(message.c_str());
|
||||
|
||||
@@ -579,7 +582,7 @@ void MessageManagerService::createQuoteMessage(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto quoteText = zego_value_get_string(arguments->at(flutter::EncodableValue("quoteText")));
|
||||
auto quoteMessage = zego_value_get_string(arguments->at(flutter::EncodableValue("quoteMessage")));
|
||||
auto quoteMessage = value_2_json(arguments->at(flutter::EncodableValue("quoteMessage")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* quoteText_cs = const_cast<char*>(quoteText.c_str());
|
||||
char* quoteMessage_cs = const_cast<char*>(quoteMessage.c_str());
|
||||
@@ -596,7 +599,7 @@ void MessageManagerService::createCardMessage(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto cardMessage = zego_value_get_string(arguments->at(flutter::EncodableValue("cardMessage")));
|
||||
auto cardMessage = value_2_json(arguments->at(flutter::EncodableValue("cardMessage")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* cardMessage_cs = const_cast<char*>(cardMessage.c_str());
|
||||
|
||||
@@ -630,7 +633,7 @@ void MessageManagerService::createAdvancedTextMessage(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto text = zego_value_get_string(arguments->at(flutter::EncodableValue("text")));
|
||||
auto richMessageInfoList = zego_value_get_string(arguments->at(flutter::EncodableValue("richMessageInfoList")));
|
||||
auto richMessageInfoList = value_2_json(arguments->at(flutter::EncodableValue("richMessageInfoList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* text_cs = const_cast<char*>(text.c_str());
|
||||
char* richMessageInfoList_cs = const_cast<char*>(richMessageInfoList.c_str());
|
||||
@@ -648,8 +651,8 @@ void MessageManagerService::createAdvancedQuoteMessage(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto quoteText = zego_value_get_string(arguments->at(flutter::EncodableValue("quoteText")));
|
||||
auto quoteMessage = zego_value_get_string(arguments->at(flutter::EncodableValue("quoteMessage")));
|
||||
auto richMessageInfoList = zego_value_get_string(arguments->at(flutter::EncodableValue("richMessageInfoList")));
|
||||
auto quoteMessage = value_2_json(arguments->at(flutter::EncodableValue("quoteMessage")));
|
||||
auto richMessageInfoList = value_2_json(arguments->at(flutter::EncodableValue("richMessageInfoList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* quoteText_cs = const_cast<char*>(quoteText.c_str());
|
||||
char* quoteMessage_cs = const_cast<char*>(quoteMessage.c_str());
|
||||
@@ -667,7 +670,7 @@ void MessageManagerService::searchLocalMessages(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto filter = zego_value_get_string(arguments->at(flutter::EncodableValue("filter")));
|
||||
auto filter = value_2_json(arguments->at(flutter::EncodableValue("filter")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* filter_cs = const_cast<char*>(filter.c_str());
|
||||
|
||||
@@ -727,7 +730,7 @@ void MessageManagerService::findMessageList(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto searchParams = zego_value_get_string(arguments->at(flutter::EncodableValue("searchParams")));
|
||||
auto searchParams = value_2_json(arguments->at(flutter::EncodableValue("searchParams")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* searchParams_cs = const_cast<char*>(searchParams.c_str());
|
||||
|
||||
@@ -775,13 +778,16 @@ void MessageManagerService::sendMessageNotOss(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto message = zego_value_get_string(arguments->at(flutter::EncodableValue("message")));
|
||||
auto message = value_2_json(arguments->at(flutter::EncodableValue("message")));
|
||||
auto userID = zego_value_get_string(arguments->at(flutter::EncodableValue("userID")));
|
||||
auto groupID = zego_value_get_string(arguments->at(flutter::EncodableValue("groupID")));
|
||||
auto channelId = zego_value_get_string(arguments->at(flutter::EncodableValue("channelId")));
|
||||
auto offlinePushInfo = zego_value_get_string(arguments->at(flutter::EncodableValue("offlinePushInfo")));
|
||||
auto clientMsgID = zego_value_get_string(arguments->at(flutter::EncodableValue("clientMsgID")));
|
||||
auto offlinePushInfo = value_2_json(arguments->at(flutter::EncodableValue("offlinePushInfo")));
|
||||
auto isOnlineOnly = zego_value_get_bool(arguments->at(flutter::EncodableValue("isOnlineOnly")));
|
||||
|
||||
auto json = EncodableValueToJson(arguments->at(flutter::EncodableValue("message")));
|
||||
auto clientMsgID = json["clientMsgID"].get<std::string>();
|
||||
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* message_cs = const_cast<char*>(message.c_str());
|
||||
char* userID_cs = const_cast<char*>(userID.c_str());
|
||||
@@ -801,9 +807,9 @@ void MessageManagerService::createImageMessageByURL(
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto sourcePath = zego_value_get_string(arguments->at(flutter::EncodableValue("sourcePath")));
|
||||
auto sourcePicture = zego_value_get_string(arguments->at(flutter::EncodableValue("sourcePicture")));
|
||||
auto bigPicture = zego_value_get_string(arguments->at(flutter::EncodableValue("bigPicture")));
|
||||
auto snapshotPicture = zego_value_get_string(arguments->at(flutter::EncodableValue("snapshotPicture")));
|
||||
auto sourcePicture = value_2_json(arguments->at(flutter::EncodableValue("sourcePicture")));
|
||||
auto bigPicture = value_2_json(arguments->at(flutter::EncodableValue("bigPicture")));
|
||||
auto snapshotPicture = value_2_json(arguments->at(flutter::EncodableValue("snapshotPicture")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* sourcePath_cs = const_cast<char*>(sourcePath.c_str());
|
||||
char* sourcePicture_cs = const_cast<char*>(sourcePicture.c_str());
|
||||
@@ -822,7 +828,7 @@ void MessageManagerService::createSoundMessageByURL(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto soundElem = zego_value_get_string(arguments->at(flutter::EncodableValue("soundElem")));
|
||||
auto soundElem = value_2_json(arguments->at(flutter::EncodableValue("soundElem")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* soundElem_cs = const_cast<char*>(soundElem.c_str());
|
||||
|
||||
@@ -838,7 +844,7 @@ void MessageManagerService::createVideoMessageByURL(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto videoElem = zego_value_get_string(arguments->at(flutter::EncodableValue("videoElem")));
|
||||
auto videoElem = value_2_json(arguments->at(flutter::EncodableValue("videoElem")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* videoElem_cs = const_cast<char*>(videoElem.c_str());
|
||||
|
||||
@@ -854,7 +860,7 @@ void MessageManagerService::createFileMessageByURL(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto fileElem = zego_value_get_string(arguments->at(flutter::EncodableValue("fileElem")));
|
||||
auto fileElem = value_2_json(arguments->at(flutter::EncodableValue("fileElem")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* fileElem_cs = const_cast<char*>(fileElem.c_str());
|
||||
|
||||
@@ -870,7 +876,7 @@ void MessageManagerService::fetchSurroundingMessages(
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto message = zego_value_get_string(arguments->at(flutter::EncodableValue("message")));
|
||||
auto message = value_2_json(arguments->at(flutter::EncodableValue("message")));
|
||||
auto before = zego_value_get_int(arguments->at(flutter::EncodableValue("before")));
|
||||
auto after = zego_value_get_int(arguments->at(flutter::EncodableValue("after")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
|
||||
@@ -8,152 +8,151 @@
|
||||
|
||||
class MessageManagerService : public FLTService {
|
||||
public:
|
||||
MessageManagerService();
|
||||
MessageManagerService();
|
||||
|
||||
void onMethodCalled(
|
||||
const std::string& method,
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
virtual void onMethodCalled(
|
||||
const std::string& method, const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result)
|
||||
override;
|
||||
|
||||
// Method handlers
|
||||
void setAdvancedMsgListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void sendMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void revokeMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void editMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteMessageFromLocalStorage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteMessageFromLocalAndSvr(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteAllMsgFromLocal(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteAllMsgFromLocalAndSvr(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void insertSingleMessageToLocalStorage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void insertGroupMessageToLocalStorage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void markMessagesAsReadByMsgID(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void typingStatusUpdate(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createTextMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createTextAtMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createImageMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createImageMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createSoundMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createSoundMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createVideoMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createVideoMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFileMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFileMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createMergerMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createForwardMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createLocationMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createCustomMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createQuoteMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createCardMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFaceMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createAdvancedTextMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createAdvancedQuoteMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchLocalMessages(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void clearConversationAndDeleteAllMsg(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAdvancedHistoryMessageList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAdvancedHistoryMessageListReverse(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void findMessageList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setMessageLocalEx(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setAppBadge(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void sendMessageNotOss(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createImageMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createSoundMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createVideoMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFileMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void fetchSurroundingMessages(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setCustomBusinessListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
// Method handlers
|
||||
void setAdvancedMsgListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void sendMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void revokeMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void editMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteMessageFromLocalStorage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteMessageFromLocalAndSvr(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteAllMsgFromLocal(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void deleteAllMsgFromLocalAndSvr(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void insertSingleMessageToLocalStorage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void insertGroupMessageToLocalStorage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void markMessagesAsReadByMsgID(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void typingStatusUpdate(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createTextMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createTextAtMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createImageMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createImageMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createSoundMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createSoundMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createVideoMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createVideoMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFileMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFileMessageFromFullPath(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createMergerMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createForwardMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createLocationMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createCustomMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createQuoteMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createCardMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFaceMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createAdvancedTextMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createAdvancedQuoteMessage(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void searchLocalMessages(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void clearConversationAndDeleteAllMsg(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAdvancedHistoryMessageList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getAdvancedHistoryMessageListReverse(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void findMessageList(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setMessageLocalEx(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setAppBadge(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void sendMessageNotOss(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createImageMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createSoundMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createVideoMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void createFileMessageByURL(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void fetchSurroundingMessages(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setCustomBusinessListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
private:
|
||||
std::string m_serviceName;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_MANAGER_SERVICE_H
|
||||
@@ -6,144 +6,160 @@
|
||||
#include "Listen.h"
|
||||
|
||||
UserManagerService::UserManagerService() {
|
||||
m_serviceName = "userManager";
|
||||
m_serviceName = "userManager";
|
||||
}
|
||||
|
||||
void UserManagerService::onMethodCalled(
|
||||
const std::string& method,
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (method == "setUserListener") {
|
||||
setUserListener(arguments, result);
|
||||
} else if (method == "getUsersInfo") {
|
||||
getUsersInfo(arguments, result);
|
||||
} else if (method == "setSelfInfo") {
|
||||
setSelfInfo(arguments, result);
|
||||
} else if (method == "getSelfUserInfo") {
|
||||
getSelfUserInfo(arguments, result);
|
||||
} else if (method == "subscribeUsersStatus") {
|
||||
subscribeUsersStatus(arguments, result);
|
||||
} else if (method == "unsubscribeUsersStatus") {
|
||||
unsubscribeUsersStatus(arguments, result);
|
||||
} else if (method == "getSubscribeUsersStatus") {
|
||||
getSubscribeUsersStatus(arguments, result);
|
||||
} else if (method == "getUserStatus") {
|
||||
getUserStatus(arguments, result);
|
||||
} else {
|
||||
result->NotImplemented();
|
||||
}
|
||||
const std::string& method,
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (method == "setUserListener") {
|
||||
setUserListener(arguments, result);
|
||||
}
|
||||
else if (method == "getUsersInfo") {
|
||||
getUsersInfo(arguments, result);
|
||||
}
|
||||
else if (method == "setSelfInfo") {
|
||||
setSelfInfo(arguments, result);
|
||||
}
|
||||
else if (method == "getSelfUserInfo") {
|
||||
getSelfUserInfo(arguments, result);
|
||||
}
|
||||
else if (method == "subscribeUsersStatus") {
|
||||
subscribeUsersStatus(arguments, result);
|
||||
}
|
||||
else if (method == "unsubscribeUsersStatus") {
|
||||
unsubscribeUsersStatus(arguments, result);
|
||||
}
|
||||
else if (method == "getSubscribeUsersStatus") {
|
||||
getSubscribeUsersStatus(arguments, result);
|
||||
}
|
||||
else if (method == "getUserStatus") {
|
||||
getUserStatus(arguments, result);
|
||||
}
|
||||
else {
|
||||
result->NotImplemented();
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::setUserListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
set_user_listener(NewUserListenCallBack());
|
||||
result->Success(flutter::EncodableValue());
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
set_user_listener(NewUserListenCallBack());
|
||||
result->Success(flutter::EncodableValue());
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::getUsersInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDList = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDList_cs = const_cast<char*>(userIDList.c_str());
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDList = value_2_json(arguments->at(flutter::EncodableValue("userIDList")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDList_cs = const_cast<char*>(userIDList.c_str());
|
||||
|
||||
get_users_info(NewBaseCallBack(result), operationID_cs, userIDList_cs);
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
get_users_info(NewBaseCallBack(result), operationID_cs, userIDList_cs);
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::setSelfInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userInfo = map_2_json(*arguments);
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userInfo_cs = const_cast<char*>(userInfo.c_str());
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userInfo = map_2_json(*arguments);
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userInfo_cs = const_cast<char*>(userInfo.c_str());
|
||||
|
||||
set_self_info(NewBaseCallBack(result), operationID_cs, userInfo_cs);
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
set_self_info(NewBaseCallBack(result), operationID_cs, userInfo_cs);
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::getSelfUserInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
|
||||
get_self_user_info(NewBaseCallBack(result), operationID_cs);
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
get_self_user_info(NewBaseCallBack(result), operationID_cs);
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::subscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDs = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDs = value_2_json(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
|
||||
subscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs);
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
subscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs);
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::unsubscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDs = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDs = value_2_json(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
|
||||
unsubscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs);
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
unsubscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs);
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::getSubscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
|
||||
get_subscribe_users_status(NewBaseCallBack(result), operationID_cs);
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
get_subscribe_users_status(NewBaseCallBack(result), operationID_cs);
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
void UserManagerService::getUserStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDs = zego_value_get_string(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
if (arguments) {
|
||||
auto operationID = zego_value_get_string(arguments->at(flutter::EncodableValue("operationID")));
|
||||
auto userIDs = value_2_json(arguments->at(flutter::EncodableValue("userIDs")));
|
||||
char* operationID_cs = const_cast<char*>(operationID.c_str());
|
||||
char* userIDs_cs = const_cast<char*>(userIDs.c_str());
|
||||
|
||||
get_user_status(NewBaseCallBack(result), operationID_cs, userIDs_cs);
|
||||
} else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
get_user_status(NewBaseCallBack(result), operationID_cs, userIDs_cs);
|
||||
}
|
||||
else {
|
||||
result->Error("INVALID_ARGUMENT", "Arguments cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,41 +9,40 @@
|
||||
|
||||
class UserManagerService : public FLTService {
|
||||
public:
|
||||
UserManagerService();
|
||||
UserManagerService();
|
||||
|
||||
void onMethodCalled(
|
||||
const std::string& method,
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
virtual void onMethodCalled(
|
||||
const std::string& method, const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result)
|
||||
override;
|
||||
|
||||
// Method handlers
|
||||
void setUserListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUsersInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setSelfInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getSelfUserInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void subscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void unsubscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getSubscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUserStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
// Method handlers
|
||||
void setUserListener(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUsersInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void setSelfInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getSelfUserInfo(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void subscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void unsubscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getSubscribeUsersStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
void getUserStatus(
|
||||
const flutter::EncodableMap* arguments,
|
||||
std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
|
||||
|
||||
private:
|
||||
std::string m_serviceName;
|
||||
};
|
||||
|
||||
#endif // USER_MANAGER_SERVICE_H
|
||||
Reference in New Issue
Block a user