Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cb2c6d514 | ||
|
|
90be2f74ac | ||
|
|
53ef6c2173 | ||
|
|
373171aded | ||
|
|
58702fcbaf | ||
|
|
8b8c9d5923 | ||
|
|
d5e3947878 | ||
|
|
6edf9b74fa | ||
|
|
fcc8373560 | ||
|
|
7e8d72929a | ||
|
|
03fa70c585 | ||
|
|
8b4a35e6b7 | ||
|
|
71897bcb4e | ||
|
|
57340e52a7 | ||
|
|
197f0b482f | ||
|
|
e009224256 | ||
|
|
ad0563aee4 | ||
|
|
d120312ac9 | ||
|
|
d64b426c90 | ||
|
|
3a845dc40b | ||
|
|
700265c685 | ||
|
|
73b9eb776f | ||
|
|
372e573ea0 | ||
|
|
8ea08f9ce6 | ||
|
|
40b65f52a5 | ||
|
|
6c0676fbe5 | ||
|
|
80152e2314 | ||
|
|
2381d26729 | ||
|
|
b25f0d8547 | ||
|
|
f4e7eaf50e | ||
|
|
f40d4148a8 | ||
|
|
23fa27d2cc | ||
|
|
6a1dc1f62a | ||
|
|
07212474fe | ||
|
|
8655088af6 | ||
|
|
b7aa083f48 | ||
|
|
514fb53eca | ||
|
|
9345c6465a | ||
|
|
b05e68355e | ||
|
|
3746652552 | ||
|
|
e323eea8cd | ||
|
|
f111d0c69e | ||
|
|
ba661a516e | ||
|
|
43016d5e86 | ||
|
|
4c43d54a1a | ||
|
|
b71cd22dce | ||
|
|
f3261d2ce4 | ||
|
|
cd0865853b | ||
|
|
3b01a700c9 | ||
|
|
74b3747f23 | ||
|
|
24ff862476 | ||
|
|
64e91c8294 | ||
|
|
b33d047cfb | ||
|
|
2e52435041 | ||
|
|
e0071ca84b | ||
|
|
9d2e2ee0b2 | ||
|
|
7d7cf6ddfa | ||
|
|
4df97754c7 | ||
|
|
5555cfde7c | ||
|
|
39988a49cf | ||
|
|
9c176068c4 | ||
|
|
6ef237b1e6 | ||
|
|
ad3923e121 | ||
|
|
0607cd2928 | ||
|
|
760d65b9d0 | ||
|
|
46e28651ea | ||
|
|
b6aea0f7e1 | ||
|
|
e1a6ab3c79 | ||
|
|
c16fe12ca6 | ||
|
|
0fbfc70ef1 | ||
|
|
603188d98a | ||
|
|
51667e19d7 | ||
|
|
862bf46ace | ||
|
|
744268371f | ||
|
|
aa05465509 | ||
|
|
790dbafd6b | ||
|
|
6527295f1f | ||
|
|
27293375a4 | ||
|
|
401255df6e | ||
|
|
7fdc262b5f | ||
|
|
579e3dd236 | ||
|
|
232b5dd8f8 | ||
|
|
1ead087f08 | ||
|
|
b5f80cc052 | ||
|
|
a97048ea9d | ||
|
|
1aae155c58 | ||
|
|
39b2112e0e | ||
|
|
7cedb36001 | ||
|
|
e32598bb06 | ||
|
|
40190198d8 | ||
|
|
e18bbc567a | ||
|
|
0107919f97 | ||
|
|
ad346184cb | ||
|
|
d4bc4f7ae2 | ||
|
|
5bafe70ef4 | ||
|
|
4129d649cd | ||
|
|
ddd77fa307 | ||
|
|
90f715acea | ||
|
|
1fce0e4cae | ||
|
|
dbaad13dd1 | ||
|
|
0e147a033f | ||
|
|
15042ed2ea | ||
|
|
66c9b0f673 |
44
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
name: Bug report (BUG模板)
|
||||
about: Create a bug report helping us fix it. (创建一个 BUG 报告以帮助我们进行修复)
|
||||
title: "[BUG] Error with something"
|
||||
labels: await investigate, bug
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is.
|
||||
请用精炼的语句准确描述你遇到的BUG。-->
|
||||
|
||||
**How to reproduce**
|
||||
<!-- Please **provide a minimum demo** rather than
|
||||
**a full project or a incomplete pages**.
|
||||
Otherwise, we won't accept your request.
|
||||
请提供一个 **最简单的 demo** 用于复现,而不要提供 **整个项目或者不完整的页面**,
|
||||
否则我们不会受理你的问题。-->
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
<!-- 描述复现步骤 -->
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. Error occurred.
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen.
|
||||
描述你期望的行为。-->
|
||||
|
||||
**Screenshots (If contains)**
|
||||
<!-- If applicable, add screenshots to help explain your problem.
|
||||
如有相关截图,请提供它们用于解释问题所在。-->
|
||||
|
||||
**Version information**
|
||||
- Device: *e.g. iPhone X*
|
||||
- OS: *e.g. iOS 14.7.1*
|
||||
- Package Version: *e.g. v1.0.9*
|
||||
- Flutter Version: *e.g. v2.8.0*
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here.
|
||||
在此提供更多的内容。 -->
|
||||
30
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
name: Feature request (功能请求)
|
||||
about: Request a new feature that the package didn't include. (请求一个依赖并未包含的功能)
|
||||
title: "[Feature] Request a feature with something"
|
||||
labels: feature, await investigate
|
||||
|
||||
---
|
||||
|
||||
**Version information**
|
||||
- Device: *e.g. iPhone X*
|
||||
- OS: *e.g. iOS 14.7.1*
|
||||
- Package Version: *e.g. v1.0.9*
|
||||
- Flutter Version: *e.g. v2.8.0*
|
||||
|
||||
**Is your feature request related to a problem?**
|
||||
<!-- A clear and concise description if it's related to an exist problem.
|
||||
如果与已有问题有关,请准确描述。-->
|
||||
|
||||
**Describe the solution you'd like**
|
||||
<!-- A clear and concise description of what you want to happen.
|
||||
描述你期望的解决方案。-->
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
<!-- A clear and concise description of any alternative solutions
|
||||
or features you've considered.
|
||||
准确描述其他解决方案或你的疑虑。 -->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context or screenshots about the feature request here.
|
||||
请提供任何你认为需要的附加内容。 -->
|
||||
27
.github/workflows/stale.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
#
|
||||
# You can adjust the behavior by modifying this file.
|
||||
# For more information, see:
|
||||
# https://github.com/actions/stale
|
||||
name: Mark stale issues and pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '33 21 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'Stale issue message'
|
||||
stale-pr-message: 'Stale pull request message'
|
||||
stale-issue-label: 'no-issue-activity'
|
||||
stale-pr-label: 'no-pr-activity'
|
||||
461
.idea/dbnavigator.xml
generated
Normal file
@@ -0,0 +1,461 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DBNavigator.Project.DataEditorManager">
|
||||
<record-view-column-sorting-type value="BY_INDEX" />
|
||||
<value-preview-text-wrapping value="false" />
|
||||
<value-preview-pinned value="false" />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.DataExportManager">
|
||||
<export-instructions>
|
||||
<create-header value="true" />
|
||||
<friendly-headers value="false" />
|
||||
<quote-values-containing-separator value="true" />
|
||||
<quote-all-values value="false" />
|
||||
<value-separator value="" />
|
||||
<file-name value="" />
|
||||
<file-location value="" />
|
||||
<scope value="GLOBAL" />
|
||||
<destination value="FILE" />
|
||||
<format value="EXCEL" />
|
||||
<charset value="UTF-8" />
|
||||
</export-instructions>
|
||||
</component>
|
||||
<component name="DBNavigator.Project.DatabaseBrowserManager">
|
||||
<autoscroll-to-editor value="false" />
|
||||
<autoscroll-from-editor value="true" />
|
||||
<show-object-properties value="true" />
|
||||
<loaded-nodes />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.DatabaseFileManager">
|
||||
<open-files />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.EditorStateManager">
|
||||
<last-used-providers />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.ExecutionManager">
|
||||
<retain-sticky-names value="false" />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.MethodExecutionManager">
|
||||
<method-browser />
|
||||
<execution-history>
|
||||
<group-entries value="true" />
|
||||
<execution-inputs />
|
||||
</execution-history>
|
||||
<argument-values-cache />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.ObjectDependencyManager">
|
||||
<last-used-dependency-type value="INCOMING" />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.ObjectQuickFilterManager">
|
||||
<last-used-operator value="EQUAL" />
|
||||
<filters />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.ParserDiagnosticsManager">
|
||||
<diagnostics-history />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true">
|
||||
<recently-used-interfaces />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.Settings">
|
||||
<connections />
|
||||
<browser-settings>
|
||||
<general>
|
||||
<display-mode value="TABBED" />
|
||||
<navigation-history-size value="100" />
|
||||
<show-object-details value="false" />
|
||||
</general>
|
||||
<filters>
|
||||
<object-type-filter>
|
||||
<object-type name="SCHEMA" enabled="true" />
|
||||
<object-type name="USER" enabled="true" />
|
||||
<object-type name="ROLE" enabled="true" />
|
||||
<object-type name="PRIVILEGE" enabled="true" />
|
||||
<object-type name="CHARSET" enabled="true" />
|
||||
<object-type name="TABLE" enabled="true" />
|
||||
<object-type name="VIEW" enabled="true" />
|
||||
<object-type name="MATERIALIZED_VIEW" enabled="true" />
|
||||
<object-type name="NESTED_TABLE" enabled="true" />
|
||||
<object-type name="COLUMN" enabled="true" />
|
||||
<object-type name="INDEX" enabled="true" />
|
||||
<object-type name="CONSTRAINT" enabled="true" />
|
||||
<object-type name="DATASET_TRIGGER" enabled="true" />
|
||||
<object-type name="DATABASE_TRIGGER" enabled="true" />
|
||||
<object-type name="SYNONYM" enabled="true" />
|
||||
<object-type name="SEQUENCE" enabled="true" />
|
||||
<object-type name="PROCEDURE" enabled="true" />
|
||||
<object-type name="FUNCTION" enabled="true" />
|
||||
<object-type name="PACKAGE" enabled="true" />
|
||||
<object-type name="TYPE" enabled="true" />
|
||||
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
|
||||
<object-type name="ARGUMENT" enabled="true" />
|
||||
<object-type name="DIMENSION" enabled="true" />
|
||||
<object-type name="CLUSTER" enabled="true" />
|
||||
<object-type name="DBLINK" enabled="true" />
|
||||
</object-type-filter>
|
||||
</filters>
|
||||
<sorting>
|
||||
<object-type name="COLUMN" sorting-type="NAME" />
|
||||
<object-type name="FUNCTION" sorting-type="NAME" />
|
||||
<object-type name="PROCEDURE" sorting-type="NAME" />
|
||||
<object-type name="ARGUMENT" sorting-type="POSITION" />
|
||||
</sorting>
|
||||
<default-editors>
|
||||
<object-type name="VIEW" editor-type="SELECTION" />
|
||||
<object-type name="PACKAGE" editor-type="SELECTION" />
|
||||
<object-type name="TYPE" editor-type="SELECTION" />
|
||||
</default-editors>
|
||||
</browser-settings>
|
||||
<navigation-settings>
|
||||
<lookup-filters>
|
||||
<lookup-objects>
|
||||
<object-type name="SCHEMA" enabled="true" />
|
||||
<object-type name="USER" enabled="false" />
|
||||
<object-type name="ROLE" enabled="false" />
|
||||
<object-type name="PRIVILEGE" enabled="false" />
|
||||
<object-type name="CHARSET" enabled="false" />
|
||||
<object-type name="TABLE" enabled="true" />
|
||||
<object-type name="VIEW" enabled="true" />
|
||||
<object-type name="MATERIALIZED VIEW" enabled="true" />
|
||||
<object-type name="INDEX" enabled="true" />
|
||||
<object-type name="CONSTRAINT" enabled="true" />
|
||||
<object-type name="DATASET TRIGGER" enabled="true" />
|
||||
<object-type name="DATABASE TRIGGER" enabled="true" />
|
||||
<object-type name="SYNONYM" enabled="false" />
|
||||
<object-type name="SEQUENCE" enabled="true" />
|
||||
<object-type name="PROCEDURE" enabled="true" />
|
||||
<object-type name="FUNCTION" enabled="true" />
|
||||
<object-type name="PACKAGE" enabled="true" />
|
||||
<object-type name="TYPE" enabled="true" />
|
||||
<object-type name="DIMENSION" enabled="false" />
|
||||
<object-type name="CLUSTER" enabled="false" />
|
||||
<object-type name="DBLINK" enabled="true" />
|
||||
</lookup-objects>
|
||||
<force-database-load value="false" />
|
||||
<prompt-connection-selection value="true" />
|
||||
<prompt-schema-selection value="true" />
|
||||
</lookup-filters>
|
||||
</navigation-settings>
|
||||
<dataset-grid-settings>
|
||||
<general>
|
||||
<enable-zooming value="true" />
|
||||
<enable-column-tooltip value="true" />
|
||||
</general>
|
||||
<sorting>
|
||||
<nulls-first value="true" />
|
||||
<max-sorting-columns value="4" />
|
||||
</sorting>
|
||||
<tracking-columns>
|
||||
<columnNames value="" />
|
||||
<visible value="true" />
|
||||
<editable value="false" />
|
||||
</tracking-columns>
|
||||
</dataset-grid-settings>
|
||||
<dataset-editor-settings>
|
||||
<text-editor-popup>
|
||||
<active value="false" />
|
||||
<active-if-empty value="false" />
|
||||
<data-length-threshold value="100" />
|
||||
<popup-delay value="1000" />
|
||||
</text-editor-popup>
|
||||
<values-actions-popup>
|
||||
<show-popup-button value="true" />
|
||||
<element-count-threshold value="1000" />
|
||||
<data-length-threshold value="250" />
|
||||
</values-actions-popup>
|
||||
<general>
|
||||
<fetch-block-size value="100" />
|
||||
<fetch-timeout value="30" />
|
||||
<trim-whitespaces value="true" />
|
||||
<convert-empty-strings-to-null value="true" />
|
||||
<select-content-on-cell-edit value="true" />
|
||||
<large-value-preview-active value="true" />
|
||||
</general>
|
||||
<filters>
|
||||
<prompt-filter-dialog value="true" />
|
||||
<default-filter-type value="BASIC" />
|
||||
</filters>
|
||||
<qualified-text-editor text-length-threshold="300">
|
||||
<content-types>
|
||||
<content-type name="Text" enabled="true" />
|
||||
<content-type name="Properties" enabled="true" />
|
||||
<content-type name="XML" enabled="true" />
|
||||
<content-type name="DTD" enabled="true" />
|
||||
<content-type name="HTML" enabled="true" />
|
||||
<content-type name="XHTML" enabled="true" />
|
||||
<content-type name="Java" enabled="true" />
|
||||
<content-type name="SQL" enabled="true" />
|
||||
<content-type name="PL/SQL" enabled="true" />
|
||||
<content-type name="JSON" enabled="true" />
|
||||
<content-type name="JSON5" enabled="true" />
|
||||
<content-type name="Groovy" enabled="true" />
|
||||
<content-type name="AIDL" enabled="true" />
|
||||
<content-type name="YAML" enabled="true" />
|
||||
<content-type name="Manifest" enabled="true" />
|
||||
</content-types>
|
||||
</qualified-text-editor>
|
||||
<record-navigation>
|
||||
<navigation-target value="VIEWER" />
|
||||
</record-navigation>
|
||||
</dataset-editor-settings>
|
||||
<code-editor-settings>
|
||||
<general>
|
||||
<show-object-navigation-gutter value="false" />
|
||||
<show-spec-declaration-navigation-gutter value="true" />
|
||||
<enable-spellchecking value="true" />
|
||||
<enable-reference-spellchecking value="false" />
|
||||
</general>
|
||||
<confirmations>
|
||||
<save-changes value="false" />
|
||||
<revert-changes value="true" />
|
||||
</confirmations>
|
||||
</code-editor-settings>
|
||||
<code-completion-settings>
|
||||
<filters>
|
||||
<basic-filter>
|
||||
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="function" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
|
||||
<filter-element type="OBJECT" id="schema" selected="true" />
|
||||
<filter-element type="OBJECT" id="role" selected="true" />
|
||||
<filter-element type="OBJECT" id="user" selected="true" />
|
||||
<filter-element type="OBJECT" id="privilege" selected="true" />
|
||||
<user-schema>
|
||||
<filter-element type="OBJECT" id="table" selected="true" />
|
||||
<filter-element type="OBJECT" id="view" selected="true" />
|
||||
<filter-element type="OBJECT" id="materialized view" selected="true" />
|
||||
<filter-element type="OBJECT" id="index" selected="true" />
|
||||
<filter-element type="OBJECT" id="constraint" selected="true" />
|
||||
<filter-element type="OBJECT" id="trigger" selected="true" />
|
||||
<filter-element type="OBJECT" id="synonym" selected="false" />
|
||||
<filter-element type="OBJECT" id="sequence" selected="true" />
|
||||
<filter-element type="OBJECT" id="procedure" selected="true" />
|
||||
<filter-element type="OBJECT" id="function" selected="true" />
|
||||
<filter-element type="OBJECT" id="package" selected="true" />
|
||||
<filter-element type="OBJECT" id="type" selected="true" />
|
||||
<filter-element type="OBJECT" id="dimension" selected="true" />
|
||||
<filter-element type="OBJECT" id="cluster" selected="true" />
|
||||
<filter-element type="OBJECT" id="dblink" selected="true" />
|
||||
</user-schema>
|
||||
<public-schema>
|
||||
<filter-element type="OBJECT" id="table" selected="false" />
|
||||
<filter-element type="OBJECT" id="view" selected="false" />
|
||||
<filter-element type="OBJECT" id="materialized view" selected="false" />
|
||||
<filter-element type="OBJECT" id="index" selected="false" />
|
||||
<filter-element type="OBJECT" id="constraint" selected="false" />
|
||||
<filter-element type="OBJECT" id="trigger" selected="false" />
|
||||
<filter-element type="OBJECT" id="synonym" selected="false" />
|
||||
<filter-element type="OBJECT" id="sequence" selected="false" />
|
||||
<filter-element type="OBJECT" id="procedure" selected="false" />
|
||||
<filter-element type="OBJECT" id="function" selected="false" />
|
||||
<filter-element type="OBJECT" id="package" selected="false" />
|
||||
<filter-element type="OBJECT" id="type" selected="false" />
|
||||
<filter-element type="OBJECT" id="dimension" selected="false" />
|
||||
<filter-element type="OBJECT" id="cluster" selected="false" />
|
||||
<filter-element type="OBJECT" id="dblink" selected="false" />
|
||||
</public-schema>
|
||||
<any-schema>
|
||||
<filter-element type="OBJECT" id="table" selected="true" />
|
||||
<filter-element type="OBJECT" id="view" selected="true" />
|
||||
<filter-element type="OBJECT" id="materialized view" selected="true" />
|
||||
<filter-element type="OBJECT" id="index" selected="true" />
|
||||
<filter-element type="OBJECT" id="constraint" selected="true" />
|
||||
<filter-element type="OBJECT" id="trigger" selected="true" />
|
||||
<filter-element type="OBJECT" id="synonym" selected="true" />
|
||||
<filter-element type="OBJECT" id="sequence" selected="true" />
|
||||
<filter-element type="OBJECT" id="procedure" selected="true" />
|
||||
<filter-element type="OBJECT" id="function" selected="true" />
|
||||
<filter-element type="OBJECT" id="package" selected="true" />
|
||||
<filter-element type="OBJECT" id="type" selected="true" />
|
||||
<filter-element type="OBJECT" id="dimension" selected="true" />
|
||||
<filter-element type="OBJECT" id="cluster" selected="true" />
|
||||
<filter-element type="OBJECT" id="dblink" selected="true" />
|
||||
</any-schema>
|
||||
</basic-filter>
|
||||
<extended-filter>
|
||||
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="function" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
|
||||
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
|
||||
<filter-element type="OBJECT" id="schema" selected="true" />
|
||||
<filter-element type="OBJECT" id="user" selected="true" />
|
||||
<filter-element type="OBJECT" id="role" selected="true" />
|
||||
<filter-element type="OBJECT" id="privilege" selected="true" />
|
||||
<user-schema>
|
||||
<filter-element type="OBJECT" id="table" selected="true" />
|
||||
<filter-element type="OBJECT" id="view" selected="true" />
|
||||
<filter-element type="OBJECT" id="materialized view" selected="true" />
|
||||
<filter-element type="OBJECT" id="index" selected="true" />
|
||||
<filter-element type="OBJECT" id="constraint" selected="true" />
|
||||
<filter-element type="OBJECT" id="trigger" selected="true" />
|
||||
<filter-element type="OBJECT" id="synonym" selected="true" />
|
||||
<filter-element type="OBJECT" id="sequence" selected="true" />
|
||||
<filter-element type="OBJECT" id="procedure" selected="true" />
|
||||
<filter-element type="OBJECT" id="function" selected="true" />
|
||||
<filter-element type="OBJECT" id="package" selected="true" />
|
||||
<filter-element type="OBJECT" id="type" selected="true" />
|
||||
<filter-element type="OBJECT" id="dimension" selected="true" />
|
||||
<filter-element type="OBJECT" id="cluster" selected="true" />
|
||||
<filter-element type="OBJECT" id="dblink" selected="true" />
|
||||
</user-schema>
|
||||
<public-schema>
|
||||
<filter-element type="OBJECT" id="table" selected="true" />
|
||||
<filter-element type="OBJECT" id="view" selected="true" />
|
||||
<filter-element type="OBJECT" id="materialized view" selected="true" />
|
||||
<filter-element type="OBJECT" id="index" selected="true" />
|
||||
<filter-element type="OBJECT" id="constraint" selected="true" />
|
||||
<filter-element type="OBJECT" id="trigger" selected="true" />
|
||||
<filter-element type="OBJECT" id="synonym" selected="true" />
|
||||
<filter-element type="OBJECT" id="sequence" selected="true" />
|
||||
<filter-element type="OBJECT" id="procedure" selected="true" />
|
||||
<filter-element type="OBJECT" id="function" selected="true" />
|
||||
<filter-element type="OBJECT" id="package" selected="true" />
|
||||
<filter-element type="OBJECT" id="type" selected="true" />
|
||||
<filter-element type="OBJECT" id="dimension" selected="true" />
|
||||
<filter-element type="OBJECT" id="cluster" selected="true" />
|
||||
<filter-element type="OBJECT" id="dblink" selected="true" />
|
||||
</public-schema>
|
||||
<any-schema>
|
||||
<filter-element type="OBJECT" id="table" selected="true" />
|
||||
<filter-element type="OBJECT" id="view" selected="true" />
|
||||
<filter-element type="OBJECT" id="materialized view" selected="true" />
|
||||
<filter-element type="OBJECT" id="index" selected="true" />
|
||||
<filter-element type="OBJECT" id="constraint" selected="true" />
|
||||
<filter-element type="OBJECT" id="trigger" selected="true" />
|
||||
<filter-element type="OBJECT" id="synonym" selected="true" />
|
||||
<filter-element type="OBJECT" id="sequence" selected="true" />
|
||||
<filter-element type="OBJECT" id="procedure" selected="true" />
|
||||
<filter-element type="OBJECT" id="function" selected="true" />
|
||||
<filter-element type="OBJECT" id="package" selected="true" />
|
||||
<filter-element type="OBJECT" id="type" selected="true" />
|
||||
<filter-element type="OBJECT" id="dimension" selected="true" />
|
||||
<filter-element type="OBJECT" id="cluster" selected="true" />
|
||||
<filter-element type="OBJECT" id="dblink" selected="true" />
|
||||
</any-schema>
|
||||
</extended-filter>
|
||||
</filters>
|
||||
<sorting enabled="true">
|
||||
<sorting-element type="RESERVED_WORD" id="keyword" />
|
||||
<sorting-element type="RESERVED_WORD" id="datatype" />
|
||||
<sorting-element type="OBJECT" id="column" />
|
||||
<sorting-element type="OBJECT" id="table" />
|
||||
<sorting-element type="OBJECT" id="view" />
|
||||
<sorting-element type="OBJECT" id="materialized view" />
|
||||
<sorting-element type="OBJECT" id="index" />
|
||||
<sorting-element type="OBJECT" id="constraint" />
|
||||
<sorting-element type="OBJECT" id="trigger" />
|
||||
<sorting-element type="OBJECT" id="synonym" />
|
||||
<sorting-element type="OBJECT" id="sequence" />
|
||||
<sorting-element type="OBJECT" id="procedure" />
|
||||
<sorting-element type="OBJECT" id="function" />
|
||||
<sorting-element type="OBJECT" id="package" />
|
||||
<sorting-element type="OBJECT" id="type" />
|
||||
<sorting-element type="OBJECT" id="dimension" />
|
||||
<sorting-element type="OBJECT" id="cluster" />
|
||||
<sorting-element type="OBJECT" id="dblink" />
|
||||
<sorting-element type="OBJECT" id="schema" />
|
||||
<sorting-element type="OBJECT" id="role" />
|
||||
<sorting-element type="OBJECT" id="user" />
|
||||
<sorting-element type="RESERVED_WORD" id="function" />
|
||||
<sorting-element type="RESERVED_WORD" id="parameter" />
|
||||
</sorting>
|
||||
<format>
|
||||
<enforce-code-style-case value="true" />
|
||||
</format>
|
||||
</code-completion-settings>
|
||||
<execution-engine-settings>
|
||||
<statement-execution>
|
||||
<fetch-block-size value="100" />
|
||||
<execution-timeout value="20" />
|
||||
<debug-execution-timeout value="600" />
|
||||
<focus-result value="false" />
|
||||
<prompt-execution value="false" />
|
||||
</statement-execution>
|
||||
<script-execution>
|
||||
<command-line-interfaces />
|
||||
<execution-timeout value="300" />
|
||||
</script-execution>
|
||||
<method-execution>
|
||||
<execution-timeout value="30" />
|
||||
<debug-execution-timeout value="600" />
|
||||
<parameter-history-size value="10" />
|
||||
</method-execution>
|
||||
</execution-engine-settings>
|
||||
<operation-settings>
|
||||
<transactions>
|
||||
<uncommitted-changes>
|
||||
<on-project-close value="ASK" />
|
||||
<on-disconnect value="ASK" />
|
||||
<on-autocommit-toggle value="ASK" />
|
||||
</uncommitted-changes>
|
||||
<multiple-uncommitted-changes>
|
||||
<on-commit value="ASK" />
|
||||
<on-rollback value="ASK" />
|
||||
</multiple-uncommitted-changes>
|
||||
</transactions>
|
||||
<session-browser>
|
||||
<disconnect-session value="ASK" />
|
||||
<kill-session value="ASK" />
|
||||
<reload-on-filter-change value="false" />
|
||||
</session-browser>
|
||||
<compiler>
|
||||
<compile-type value="KEEP" />
|
||||
<compile-dependencies value="ASK" />
|
||||
<always-show-controls value="false" />
|
||||
</compiler>
|
||||
<debugger>
|
||||
<debugger-type value="ASK" />
|
||||
<use-generic-runners value="true" />
|
||||
</debugger>
|
||||
</operation-settings>
|
||||
<ddl-file-settings>
|
||||
<extensions>
|
||||
<mapping file-type-id="VIEW" extensions="vw" />
|
||||
<mapping file-type-id="TRIGGER" extensions="trg" />
|
||||
<mapping file-type-id="PROCEDURE" extensions="prc" />
|
||||
<mapping file-type-id="FUNCTION" extensions="fnc" />
|
||||
<mapping file-type-id="PACKAGE" extensions="pkg" />
|
||||
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
|
||||
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
|
||||
<mapping file-type-id="TYPE" extensions="tpe" />
|
||||
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
|
||||
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
|
||||
</extensions>
|
||||
<general>
|
||||
<lookup-ddl-files value="true" />
|
||||
<create-ddl-files value="false" />
|
||||
<synchronize-ddl-files value="true" />
|
||||
<use-qualified-names value="false" />
|
||||
<make-scripts-rerunnable value="true" />
|
||||
</general>
|
||||
</ddl-file-settings>
|
||||
<general-settings>
|
||||
<regional-settings>
|
||||
<date-format value="MEDIUM" />
|
||||
<number-format value="UNGROUPED" />
|
||||
<locale value="SYSTEM_DEFAULT" />
|
||||
<use-custom-formats value="false" />
|
||||
</regional-settings>
|
||||
<environment>
|
||||
<environment-types>
|
||||
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
|
||||
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
|
||||
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
|
||||
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
|
||||
</environment-types>
|
||||
<visibility-settings>
|
||||
<connection-tabs value="true" />
|
||||
<dialog-headers value="true" />
|
||||
<object-editor-tabs value="true" />
|
||||
<script-editor-tabs value="false" />
|
||||
<execution-result-tabs value="true" />
|
||||
</visibility-settings>
|
||||
</environment>
|
||||
</general-settings>
|
||||
</component>
|
||||
<component name="DBNavigator.Project.StatementExecutionManager">
|
||||
<execution-variables />
|
||||
</component>
|
||||
</project>
|
||||
1
.idea/misc.xml
generated
@@ -3,4 +3,5 @@
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<type id="android" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Android API 25 Platform" project-jdk-type="Android SDK" />
|
||||
</project>
|
||||
1
.idea/modules.xml
generated
@@ -3,6 +3,7 @@
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/flutter_openim_sdk.iml" filepath="$PROJECT_DIR$/.idea/flutter_openim_sdk.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/android/flutter_openim_sdk_android.iml" filepath="$PROJECT_DIR$/android/flutter_openim_sdk_android.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
109
CHANGELOG.md
@@ -1,7 +1,116 @@
|
||||
## 2.0.0+6
|
||||
|
||||
1.Fix bug</br>
|
||||
2.Adapter ios emulator</br>
|
||||
3.New modify group nickname</br>
|
||||
4.Update at message</br>
|
||||
5.ConverstaionInfo new add isNotInGroup field</br>
|
||||
6.New at type</br>
|
||||
7.New work moments</br>
|
||||
8.New global search</br>
|
||||
9.New getHistoryMessageListReverse method</br>
|
||||
10.New getAtAllTag method</br>
|
||||
11.New resetConversationGroupAtType method</br>
|
||||
12.New searchGroups method</br>
|
||||
|
||||
## 2.0.0+5
|
||||
|
||||
1.New notification parse </br>
|
||||
2.New deleteConversationFromLocalAndSvr method </br>
|
||||
3.New deleteMessageFromLocalAndSvr method </br>
|
||||
4.New deleteAllMsgFromLocal method </br>
|
||||
5.New deleteAllMsgFromLocalAndSvr method </br>
|
||||
6.New clearC2CHistoryMessageFromLocalAndSvr method </br>
|
||||
7.New clearGroupHistoryMessageFromLocalAndSvr method </br>
|
||||
8.New markMessageAsReadByConID method </br>
|
||||
9.New wakeUp method </br>
|
||||
10.New deleteAllConversationFromLocal method </br>
|
||||
|
||||
## 2.0.0+4
|
||||
|
||||
1.New dismiss group </br>
|
||||
2.New search local message </br>
|
||||
3.New private chat </br>
|
||||
4.New group mute
|
||||
|
||||
## 2.0.0+3
|
||||
|
||||
1.Fix bug </br>
|
||||
|
||||
## 2.0.0+2
|
||||
|
||||
1.Fix some one crash </br>
|
||||
2.New add signaling function </br>
|
||||
3.New add group have read receipt
|
||||
|
||||
## 2.0.0+1
|
||||
|
||||
1.Fix multi-terminal synchronization bug fix for retracted messages </br>
|
||||
2.Fix sending picture flashback bug </br>
|
||||
3.Fix other bug
|
||||
|
||||
## 2.0.0
|
||||
|
||||
1.Refactor mobile sdk, server sdk (2022-2-21)
|
||||
|
||||
## 1.1.1
|
||||
|
||||
1.Update sdk maven url
|
||||
|
||||
## 1.1.0
|
||||
|
||||
1.Fix the problem of missing id in ios message progress
|
||||
|
||||
## 1.0.9
|
||||
|
||||
1.Upgrade sdk to 1.4.5.
|
||||
|
||||
## 1.0.8
|
||||
|
||||
1.Upgrade sdk to 1.4.4. </br>
|
||||
2.New and changed conversation return changed data and no longer return all data. </br>
|
||||
3.New conversation paging method.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
Upgrade sdk to 1.3.4 </br>
|
||||
New add method setConversationRecvMessageOpt and getConversationRecvMessageOpt
|
||||
|
||||
## 1.0.6
|
||||
|
||||
Upgrade sdk to 1.2.9
|
||||
|
||||
## 1.0.5
|
||||
|
||||
Upgrade sdk to 1.2.8
|
||||
|
||||
## 1.0.4
|
||||
|
||||
New add clear c2c message and group message </br>
|
||||
Update sdk to 1.1.9
|
||||
|
||||
## 1.0.3
|
||||
|
||||
Fix android message error bug </br>
|
||||
Update SDK to 1.1.5 </br>
|
||||
|
||||
## 1.0.2
|
||||
|
||||
Upgrade sdk </br>
|
||||
|
||||
1. Android to 1.1.3 </br>
|
||||
2. Ios replace framework </br>
|
||||
|
||||
## 1.0.1
|
||||
|
||||
Fix bug
|
||||
|
||||
## 1.0.0
|
||||
|
||||
Fix bug
|
||||
|
||||
## 0.0.9+5
|
||||
|
||||
1. Android upgrade sdk to 0.0.17 </br>
|
||||
2. New add createFileMessageFromFullPath method
|
||||
|
||||
|
||||
299
README.md
@@ -1,308 +1,23 @@
|
||||
# flutter_openim_sdk
|
||||
[](https://pub.flutter-io.cn/packages/flutter_openim_sdk)
|
||||
[](https://pub.dev/packages/flutter_openim_sdk)
|
||||
[](https://github.com/OpenIMSDK/Open-IM-SDK-Flutter/blob/main/LICENSE)
|
||||
|
||||
### [Download demo](https://github.com/OpenIMSDK/Open-IM-Flutter-Demo.git)
|
||||
A flutter im plugin for android and ios.
|
||||
|
||||
### [OpenIM-Flutter-Widget](https://github.com/hrxiang/OpenIM-Flutter-Widget.git)
|
||||
#### [中文文档](README.zh-cn.md) | [demo(体验app源代码)](https://github.com/OpenIMSDK/Open-IM-Flutter-Demo.git) | [widget(聊天UI库)](https://github.com/hrxiang/flutter_openim_widget.git)
|
||||
|
||||
[](README.zh-cn.md)
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
A flutter IM plugin for android and ios.
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
||||
#### 1,Add dependency in yaml
|
||||
|
||||
flutter_openim_sdk: ^1.0.0
|
||||
flutter_openim_sdk: latest
|
||||
|
||||
#### 2,Import package
|
||||
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
#### 3, Init config
|
||||
|
||||
```
|
||||
// Initialize SDK
|
||||
OpenIM.iMManager
|
||||
..initSDK(
|
||||
platform: IMPlatform.ios,
|
||||
ipApi: 'Api interface address',
|
||||
ipWs: 'WebSocket address',
|
||||
dbPath: 'Database directory',
|
||||
listener: OnInitSDKListener(
|
||||
connecting: () {},
|
||||
connectFailed: (code, error) {},
|
||||
connectSuccess: () {},
|
||||
kickedOffline: () {},
|
||||
userSigExpired: () {},
|
||||
selfInfoUpdated: (user) {},
|
||||
),
|
||||
)
|
||||
|
||||
// Add message listener (remove when not in use)
|
||||
..messageManager.addAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
recvMessageRevoked: (id) {},
|
||||
recvC2CReadReceipt: (list) {},
|
||||
recvNewMessage: (msg) {},
|
||||
))
|
||||
|
||||
// Set up message sending progress listener
|
||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
||||
progressCallback: (id, progress) {},
|
||||
))
|
||||
|
||||
// Set up friend relationship listener
|
||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
||||
blackListAdd: (u) {},
|
||||
blackListDeleted: (u) {},
|
||||
friendApplicationListAccept: (u) {},
|
||||
friendApplicationListAdded: (u) {},
|
||||
friendApplicationListDeleted: (u) {},
|
||||
friendApplicationListReject: (u) {},
|
||||
friendInfoChanged: (u) {},
|
||||
friendListAdded: (u) {},
|
||||
friendListDeleted: (u) {},
|
||||
))
|
||||
|
||||
// Set up conversation listener
|
||||
..conversationManager.setConversationListener(OnConversationListener(
|
||||
conversationChanged: (list) {},
|
||||
newConversation: (list) {},
|
||||
totalUnreadMsgCountChanged: (count) {},
|
||||
syncServerFailed: () {},
|
||||
syncServerFinish: () {},
|
||||
syncServerStart: () {},
|
||||
))
|
||||
|
||||
// Set up group listener
|
||||
..groupManager.setGroupListener(OnGroupListener(
|
||||
applicationProcessed: (groupId, opUser, agreeOrReject, opReason) {},
|
||||
groupCreated: (groupId) {},
|
||||
groupInfoChanged: (groupId, info) {},
|
||||
memberEnter: (groupId, list) {},
|
||||
memberInvited: (groupId, opUser, list) {},
|
||||
memberKicked: (groupId, opUser, list) {},
|
||||
memberLeave: (groupId, info) {},
|
||||
receiveJoinApplication: (groupId, info, opReason) {},
|
||||
));
|
||||
```
|
||||
|
||||
#### 4, Log in
|
||||
|
||||
```
|
||||
OpenIM.iMManager.login(uid: uid, token: token).then((value){
|
||||
// login successful
|
||||
});
|
||||
```
|
||||
|
||||
#### 5,Get a list of conversations
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getAllConversationList().then((list) {
|
||||
// Return to the conversation list
|
||||
});
|
||||
```
|
||||
|
||||
#### 6,Get contact list
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.getFriendList().then((list) {
|
||||
// Return to friends list
|
||||
});
|
||||
```
|
||||
|
||||
#### 7,Get chat history
|
||||
|
||||
```
|
||||
List<Message> chatMsgList = List.empty(growable: true);
|
||||
|
||||
/// Custom message listener, the arrival of a new message will trigger the onNewMessage method callback
|
||||
class CustomAdvancedMsgListener extends AdvancedMsgListener {
|
||||
final ValueChanged<Message>? onNewMessage;
|
||||
|
||||
CustomAdvancedMsgListener({
|
||||
this.onNewMessage,
|
||||
});
|
||||
|
||||
@override
|
||||
void onRecvNewMessage(Message msg) {
|
||||
if (null != onNewMessage) onNewMessage!(msg);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- History news
|
||||
|
||||
```
|
||||
// If userID is not null and groupID is null, get a single chat message list
|
||||
// If the userID is null and the groupID is not null, get a group chat message list
|
||||
OpenIM.iMManager.messageManager.getHistoryMessageList(
|
||||
userID: uid,//User id
|
||||
startMsg: startMsg,//Last message, take chatMsgList[0]
|
||||
groupID: gid,//Group id
|
||||
count: 12,//Page Size
|
||||
)
|
||||
.then((list) => chatMsgList.addAll(list));
|
||||
|
||||
```
|
||||
|
||||
- New news
|
||||
|
||||
```
|
||||
// Create a message listener
|
||||
// After entering the chat page, you need to listen for new messages and then render the UI
|
||||
// Each chat window has a unique uid (user id) or gid (group id)
|
||||
// Determine whether the received message belongs to the current window according to uid or gid
|
||||
var msgListener = CustomAdvancedMsgListener(onNewMessage: (message) {
|
||||
// If the sender user id is equal to the user id of the current chat page,
|
||||
// or the group id is equal to the current group id of the current chat page
|
||||
if (message.sendID == uid || message.groupID == gid) {
|
||||
if (!chatMsgList.contains(message)) {
|
||||
// New message in current chat page
|
||||
chatMsgList.add(event.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add message listener
|
||||
OpenIM.iMManager.messageManager.addAdvancedMsgListener(msgListener);
|
||||
|
||||
// Remove message monitoring
|
||||
// After adding a message listener, if the page disposes, please remove the listener
|
||||
// OpenIM.iMManager.messageManager.removeAdvancedMsgListener(msgListener);
|
||||
```
|
||||
|
||||
#### 8,Send a message
|
||||
|
||||
```
|
||||
// Create message
|
||||
var message = await OpenIM.iMManager.messageManager.createTextMessage(
|
||||
text: 'I am the content of the message',
|
||||
);
|
||||
// Send
|
||||
OpenIM.iMManager.messageManager.sendMessage(
|
||||
message: message,
|
||||
onlineUserOnly: false,
|
||||
userID: uid, // Single chat value is not null
|
||||
groupID: gid, // The group chat value is not null
|
||||
).then((v) {
|
||||
// Sent successfully
|
||||
}).catchError((e){
|
||||
// Failed to send
|
||||
});
|
||||
```
|
||||
|
||||
#### 9,Sign out
|
||||
|
||||
```
|
||||
OpenIM.iMManager.logout();
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### OpenIM.iMManager
|
||||
|
||||
| method | description |
|
||||
| ---------------- | ------------------------------- |
|
||||
| initSDK | Initialize SDK |
|
||||
| unInitSDK | |
|
||||
| login | Log in |
|
||||
| logout | Sign out |
|
||||
| getLoginStatus | Login status |
|
||||
| getLoginUid | Current user id |
|
||||
| getLoginUserInfo | Current user information |
|
||||
| setSelfInfo | Modify current user information |
|
||||
| getUsersInfo | Get user information by user id |
|
||||
| forceReConn | Force reconnection |
|
||||
|
||||
|
||||
|
||||
#### OpenIM.iMManager.conversationManager
|
||||
|
||||
| method | description |
|
||||
| ----------------------- | --------------------------- |
|
||||
| setConversationListener | Listener |
|
||||
| getAllConversationList | Get all conversation |
|
||||
| getSingleConversation | Get a single conversation |
|
||||
| getMultipleConversation | Get multiple conversation |
|
||||
| deleteConversation | Delete conversation |
|
||||
| setConversationDraft | Set conversation draftText |
|
||||
| pinConversation | Top conversation |
|
||||
|
||||
|
||||
|
||||
#### OpenIM.iMManager.friendshipManager
|
||||
|
||||
| method | description |
|
||||
| ------------------------ | --------------------------- |
|
||||
| setFriendshipListener | Listener |
|
||||
| getFriendsInfo | Get friend information |
|
||||
| addFriend | Add friends |
|
||||
| getFriendApplicationList | Get friend application list |
|
||||
| getFriendList | Get friends list |
|
||||
| setFriendInfo | Edit friend notes |
|
||||
| addToBlackList | Add to blacklist |
|
||||
| getBlackList | Get blacklist list |
|
||||
| deleteFromBlackList | Remove from blacklist |
|
||||
| checkFriend | Check friendship |
|
||||
| deleteFromFriendList | Remove friend |
|
||||
| acceptFriendApplication | Accept friend application |
|
||||
| refuseFriendApplication | Reject friend application |
|
||||
|
||||
|
||||
|
||||
#### OpenIM.iMManager.messageManager
|
||||
|
||||
| method | description |
|
||||
| ------------------------------------------- | --------------------------------- |
|
||||
| addAdvancedMsgListener | Add message listener |
|
||||
| removeAdvancedMsgListener | Remove message listener |
|
||||
| setMsgSendProgressListener | Message sending progress listener |
|
||||
| sendMessage | Send a message |
|
||||
| getHistoryMessageList | Get history news |
|
||||
| revokeMessage | Revoke message |
|
||||
| deleteMessageFromLocalStorage | Delete message |
|
||||
| insertSingleMessageToLocalStorage | Insert message |
|
||||
| findMessages | Query the message by id |
|
||||
| markSingleMessageHasRead | Mark single chat messages as read |
|
||||
| markGroupMessageHasRead | Mark group chat messages as read |
|
||||
| <font color=red>markC2CMessageAsRead</font> | Mark c2c message as read |
|
||||
| <font color=red>typingStatusUpdate</font> | Typing prompt |
|
||||
| createTextMessage | Create text message |
|
||||
| createTextAtMessage | Create @ message |
|
||||
| createImageMessage | Create picture message |
|
||||
| createSoundMessage | Create voice message |
|
||||
| createVideoMessage | Create video message |
|
||||
| createFileMessage | Create file message |
|
||||
| createMergerMessage | Create merge message |
|
||||
| createForwardMessage | Create a forwarded message |
|
||||
| getTotalUnreadMsgCount | Get unread message count |
|
||||
|
||||
|
||||
|
||||
#### OpenIM.iMManager.groupManager
|
||||
|
||||
| method | description |
|
||||
| ----------------------- | ------------------------------- |
|
||||
| setGroupListener | Listener |
|
||||
| inviteUserToGroup | Invite into the group |
|
||||
| kickGroupMember | Remove group members |
|
||||
| getGroupMembersInfo | Get group member information |
|
||||
| getGroupMemberList | Get group members |
|
||||
| getJoinedGroupList | Get joined groups |
|
||||
| isJoinedGroup | Check you have joined the group |
|
||||
| createGroup | Create a group |
|
||||
| setGroupInfo | Set group information |
|
||||
| getGroupsInfo | Get group information |
|
||||
| joinGroup | Join group |
|
||||
| quitGroup | Exit group |
|
||||
| transferGroupOwner | Group permission transfer |
|
||||
| getGroupApplicationList | Get group application list |
|
||||
| acceptGroupApplication | Accept group invitation |
|
||||
| refuseGroupApplication | Decline group invitation |
|
||||
|
||||
1983
README.zh-cn.md
@@ -9,15 +9,14 @@ buildscript {
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||
maven {
|
||||
allowInsecureProtocol = true
|
||||
url 'http://47.112.160.66:8081/repository/maven-releases'
|
||||
url 'http://121.37.25.71:8081/repository/maven-releases/'
|
||||
}
|
||||
// maven { url 'https://127.0.0.1:8081/repository/maven-releases' }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.1'
|
||||
classpath 'com.android.tools.build:gradle:3.5.4'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,9 +28,8 @@ rootProject.allprojects {
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||
maven {
|
||||
allowInsecureProtocol = true
|
||||
url 'http://47.112.160.66:8081/repository/maven-releases'
|
||||
url 'http://121.37.25.71:8081/repository/maven-releases/'
|
||||
}
|
||||
// maven { url 'http://127.0.0.1:8081/repository/maven-releases' }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -51,5 +49,5 @@ android {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation 'io.openim:client-sdk:1.0.9@aar'
|
||||
implementation 'io.openim:client-sdk:2.0.51@aar'
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import io.flutter.Log;
|
||||
@@ -19,7 +18,9 @@ import io.openim.flutter_openim_sdk.manager.FriendshipManager;
|
||||
import io.openim.flutter_openim_sdk.manager.GroupManager;
|
||||
import io.openim.flutter_openim_sdk.manager.IMManager;
|
||||
import io.openim.flutter_openim_sdk.manager.MessageManager;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import io.openim.flutter_openim_sdk.manager.SignalingManager;
|
||||
import io.openim.flutter_openim_sdk.manager.UserManager;
|
||||
import io.openim.flutter_openim_sdk.manager.WorkMomentsManager;
|
||||
|
||||
|
||||
/**
|
||||
@@ -33,20 +34,26 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
|
||||
public static MethodChannel channel;
|
||||
private static IMManager imManager;
|
||||
private static UserManager userManager;
|
||||
private static FriendshipManager friendshipManager;
|
||||
private static MessageManager messageManager;
|
||||
private static ConversationManager conversationManager;
|
||||
private static GroupManager groupManager;
|
||||
private static SignalingManager signalingManager;
|
||||
private static WorkMomentsManager workMomentsManager;
|
||||
|
||||
public FlutterOpenimSdkPlugin() {
|
||||
}
|
||||
|
||||
private FlutterOpenimSdkPlugin(Context context) {
|
||||
FlutterOpenimSdkPlugin.imManager = new IMManager();
|
||||
FlutterOpenimSdkPlugin.userManager = new UserManager();
|
||||
FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager();
|
||||
FlutterOpenimSdkPlugin.messageManager = new MessageManager();
|
||||
FlutterOpenimSdkPlugin.conversationManager = new ConversationManager();
|
||||
FlutterOpenimSdkPlugin.groupManager = new GroupManager();
|
||||
FlutterOpenimSdkPlugin.signalingManager = new SignalingManager();
|
||||
FlutterOpenimSdkPlugin.workMomentsManager = new WorkMomentsManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,18 +75,12 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
|
||||
void parse(@NonNull MethodCall call, @NonNull Result result) {
|
||||
try {
|
||||
String managerName = CommonUtil.getParamValue(call, "ManagerName");
|
||||
String managerName = call.argument("ManagerName");
|
||||
Field field = FlutterOpenimSdkPlugin.class.getDeclaredField(managerName);
|
||||
Method method = field.get(new Object()).getClass().getDeclaredMethod(call.method, MethodCall.class, Result.class);
|
||||
Log.i("F-OpenIMSDK(flutter call native)", "{ class:" + managerName + ", method:" + method.getName() + " }");
|
||||
method.invoke(field.get(new Object()), call, result);
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnAdvancedMsgListener;
|
||||
|
||||
public class AdvancedMsgListener implements OnAdvancedMsgListener {
|
||||
final Map<String, String> values = new HashMap<>();
|
||||
|
||||
public AdvancedMsgListener(String listenerId) {
|
||||
this.values.put("id", listenerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
values.put("haveReadMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvMessageRevoked(String s) {
|
||||
values.put("revokedMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
values.put("newMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Base;
|
||||
|
||||
public class BaseListener implements Base {
|
||||
|
||||
MethodChannel.Result result;
|
||||
|
||||
public BaseListener(MethodChannel.Result result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(long l, String s) {
|
||||
Log.e("F-OpenIMSD(callback)", s);
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
Log.i("F-OpenIMSDK(callback)", s);
|
||||
CommonUtil.runMainThreadReturn(result, s);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnFriendshipListener;
|
||||
|
||||
public class FriendshipListener implements OnFriendshipListener {
|
||||
|
||||
@Override
|
||||
public void onBlackListAdd(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlackListAdd", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlackListDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlackListDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListAccept(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAccept", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListReject(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListReject", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendListAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendListAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendListDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendListDeleted", s);
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnGroupListener;
|
||||
|
||||
public class GroupListener implements OnGroupListener {
|
||||
@Override
|
||||
public void onApplicationProcessed(String s, String s1, int i, String s2) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("opUser", s1);
|
||||
map.put("agreeOrReject", i);
|
||||
map.put("opReason", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onApplicationProcessed", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupCreated(String s) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
CommonUtil.emitEvent("groupListener", "onGroupCreated", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupInfoChanged(String s, String s1) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("groupInfo", s1);
|
||||
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberEnter(String s, String s1) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("memberList", s1);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberEnter", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberInvited(String s, String s1, String s2) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("opUser", s1);
|
||||
map.put("memberList", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberInvited", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberKicked(String s, String s1, String s2) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("opUser", s1);
|
||||
map.put("memberList", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberKicked", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberLeave(String s, String s1) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("member", s1);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberLeave", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveJoinApplication(String s, String s1, String s2) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("member", s1);
|
||||
map.put("opReason", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onReceiveJoinApplication", map);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.SendMsgCallBack;
|
||||
|
||||
public class MsgSendProgressListener implements SendMsgCallBack {
|
||||
final private MethodChannel.Result result;
|
||||
final private MethodCall call;
|
||||
final Map<String, Object> values = new HashMap<>();
|
||||
|
||||
public MsgSendProgressListener(MethodChannel.Result result, MethodCall call) {
|
||||
this.result = result;
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(long l, String s) {
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(long l) {
|
||||
values.put("clientMsgID", CommonUtil.getSendMessageClientMsgID(call));
|
||||
values.put("progress", l);
|
||||
CommonUtil.emitEvent("msgSendProgressListener", "onProgress", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
CommonUtil.runMainThreadReturn(result, s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsgListener {
|
||||
private final String id;
|
||||
|
||||
public OnAdvancedMsgListener(String listenerId) {
|
||||
this.id = listenerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("c2cMessageReadReceipt", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvGroupReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("groupMessageReadReceipt", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvGroupReadReceipt", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvMessageRevoked(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("revokedMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("newMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk_callback.Base;
|
||||
|
||||
public class OnBaseListener implements Base {
|
||||
|
||||
MethodChannel.Result result;
|
||||
MethodCall call;
|
||||
|
||||
public OnBaseListener(MethodChannel.Result result, MethodCall call) {
|
||||
this.result = result;
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int l, String s) {
|
||||
Log.i("F-OpenIMSDK(flutter call native)", "method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
Log.i("F-OpenIMSDK(flutter call native)", "method: 【 " + call.method + " 】, onSuccess: " + s);
|
||||
CommonUtil.runMainThreadReturn(result, s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
|
||||
public class OnConnListener implements open_im_sdk_callback.OnConnListener {
|
||||
|
||||
@Override
|
||||
public void onConnectFailed(int i, String s) {
|
||||
CommonUtil.emitEvent("connectListener", "onConnectFailed", i, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
CommonUtil.emitEvent("connectListener", "onConnectSuccess", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnecting() {
|
||||
CommonUtil.emitEvent("connectListener", "onConnecting", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKickedOffline() {
|
||||
CommonUtil.emitEvent("connectListener", "onKickedOffline", null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUserTokenExpired() {
|
||||
CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnConversationListener;
|
||||
|
||||
public class ConversationListener implements OnConversationListener {
|
||||
|
||||
public class OnConversationListener implements open_im_sdk_callback.OnConversationListener {
|
||||
|
||||
@Override
|
||||
public void onConversationChanged(String s) {
|
||||
@@ -0,0 +1,51 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnFriendshipListener implements open_im_sdk_callback.OnFriendshipListener {
|
||||
|
||||
@Override
|
||||
public void onBlackAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlackDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationAccepted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationRejected(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnGroupListener implements open_im_sdk_callback.OnGroupListener {
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationAccepted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationAdded(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationDeleted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationRejected(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMemberAdded(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupMemberAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMemberDeleted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupMemberDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMemberInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupMemberInfoChanged", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinedGroupAdded(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onJoinedGroupAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinedGroupDeleted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onJoinedGroupDeleted", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk_callback.SendMsgCallBack;
|
||||
|
||||
public class OnMsgSendListener implements SendMsgCallBack {
|
||||
final private MethodChannel.Result result;
|
||||
private Object clientMsgID;
|
||||
|
||||
public OnMsgSendListener(MethodChannel.Result result, MethodCall call) {
|
||||
this.result = result;
|
||||
Map<String, Object> args = call.argument("message");
|
||||
if (null != args) {
|
||||
this.clientMsgID = args.get("clientMsgID");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int l, String s) {
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(long l) {
|
||||
if (null != clientMsgID) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("clientMsgID", clientMsgID);
|
||||
values.put("progress", l);
|
||||
CommonUtil.emitEvent("msgSendProgressListener", "onProgress", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
CommonUtil.runMainThreadReturn(result, s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnSignalingListener implements open_im_sdk_callback.OnSignalingListener {
|
||||
|
||||
@Override
|
||||
public void onInvitationCancelled(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInvitationCancelled", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInvitationTimeout(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInvitationTimeout", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeAccepted(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeAcceptedByOtherDevice(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeAcceptedByOtherDevice", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeRejected(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeRejectedByOtherDevice(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeRejectedByOtherDevice", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveNewInvitation(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onReceiveNewInvitation", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHangUp(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onHangUp", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnUserListener implements open_im_sdk_callback.OnUserListener {
|
||||
|
||||
@Override
|
||||
public void onSelfInfoUpdated(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnWorkMomentsListener implements open_im_sdk_callback.OnWorkMomentsListener {
|
||||
|
||||
|
||||
@Override
|
||||
public void onRecvNewNotification() {
|
||||
CommonUtil.emitEvent("workMomentsListener", "OnRecvNewNotification", null);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.IMSDKListener;
|
||||
|
||||
public class SDKListener implements IMSDKListener {
|
||||
|
||||
@Override
|
||||
public void onConnectFailed(long l, String s) {
|
||||
CommonUtil.emitEvent("initSDKListener", "onConnectFailed", l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onConnectSuccess", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnecting() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onConnecting", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKickedOffline() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onKickedOffline", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfInfoUpdated(String s) {
|
||||
CommonUtil.emitEvent("initSDKListener", "onSelfInfoUpdated", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserTokenExpired() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onUserTokenExpired", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.openim.flutter_openim_sdk.util.JsonUtil;
|
||||
|
||||
class BaseManager {
|
||||
|
||||
static String jsonValue(MethodCall methodCall, String key) {
|
||||
return JsonUtil.toString(methodCall.argument(key));
|
||||
}
|
||||
|
||||
static String jsonValue(MethodCall methodCall) {
|
||||
return JsonUtil.toString(methodCall.arguments);
|
||||
}
|
||||
|
||||
static <T> T value(MethodCall methodCall, String key) {
|
||||
return methodCall.argument(key);
|
||||
}
|
||||
|
||||
static Long int2long(MethodCall methodCall, String key) {
|
||||
Integer i = value(methodCall, key);
|
||||
return Long.valueOf(i);
|
||||
}
|
||||
}
|
||||
@@ -2,68 +2,156 @@ package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.ConversationListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnConversationListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class ConversationManager {
|
||||
public class ConversationManager extends BaseManager {
|
||||
|
||||
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationListener(new ConversationListener());
|
||||
Open_im_sdk.setConversationListener(new OnConversationListener());
|
||||
}
|
||||
|
||||
|
||||
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAllConversationList(new BaseListener(result));
|
||||
Open_im_sdk.getAllConversationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getConversationListSplit(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getOneConversation(
|
||||
CommonUtil.getConversationSourceId(methodCall),
|
||||
CommonUtil.getConversationSessionType(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "sessionType"),
|
||||
value(methodCall, "sourceID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getMultipleConversation(
|
||||
CommonUtil.getConversationIds(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversation(CommonUtil.getConversationId(methodCall), new BaseListener(result));
|
||||
Open_im_sdk.deleteConversation(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationDraft(
|
||||
CommonUtil.getConversationId(methodCall),
|
||||
CommonUtil.getConversationDraft(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "draftText")
|
||||
);
|
||||
}
|
||||
|
||||
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.pinConversation(
|
||||
CommonUtil.getConversationId(methodCall),
|
||||
CommonUtil.isPinnedConversation(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isPinned")
|
||||
);
|
||||
}
|
||||
|
||||
public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markSingleMessageHasRead(new BaseListener(result), CommonUtil.getSingleMessageUserid(methodCall));
|
||||
}
|
||||
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.markSingleMessageHasRead(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// value(methodCall, "userID")
|
||||
// );
|
||||
// }
|
||||
|
||||
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markGroupMessageHasRead(new BaseListener(result), CommonUtil.getGroupMessageGroupid(methodCall));
|
||||
Open_im_sdk.markGroupMessageHasRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result));
|
||||
Open_im_sdk.getTotalUnreadMsgCount(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.getConversationIDBySessionType(CommonUtil.getConversationSourceId(methodCall),
|
||||
CommonUtil.getConversationSessionType(methodCall)));
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getConversationIDBySessionType(
|
||||
value(methodCall, "sourceID"),
|
||||
int2long(methodCall, "sessionType")));
|
||||
}
|
||||
|
||||
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationRecvMessageOpt(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList"),
|
||||
int2long(methodCall, "status")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getConversationRecvMessageOpt(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void setOneConversationPrivateChat(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setOneConversationPrivateChat(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isPrivate")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversationFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversationFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllConversationFromLocal(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteAllConversationFromLocal(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void resetConversationGroupAtType(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.resetConversationGroupAtType(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getAtAllTag(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getAtAllTag());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,75 +2,114 @@ package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.FriendshipListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnFriendshipListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class FriendshipManager {
|
||||
public class FriendshipManager extends BaseManager {
|
||||
|
||||
|
||||
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendListener(new FriendshipListener());
|
||||
Open_im_sdk.setFriendListener(new OnFriendshipListener());
|
||||
}
|
||||
|
||||
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendsInfo(new BaseListener(result), CommonUtil.getUidList(methodCall));
|
||||
Open_im_sdk.getDesignatedFriendsInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addFriend(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
||||
Open_im_sdk.addFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationList(new BaseListener(result));
|
||||
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvFriendApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendFriendApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendList(new BaseListener(result));
|
||||
Open_im_sdk.getFriendList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setFriendInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendInfo(CommonUtil.getSDKJsonParam(methodCall), new BaseListener(result));
|
||||
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendRemark(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void addToBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addToBlackList(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
||||
public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addBlack(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void getBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getBlackList(new BaseListener(result));
|
||||
public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getBlackList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteFromBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteFromBlackList(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
||||
public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.removeBlack(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.checkFriend(new BaseListener(result), CommonUtil.getUidList(methodCall));
|
||||
Open_im_sdk.checkFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteFromFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteFromFriendList(CommonUtil.getJsonUid(methodCall), new BaseListener(result));
|
||||
public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.acceptFriendApplication(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
||||
Open_im_sdk.acceptFriendApplication(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.refuseFriendApplication(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
||||
Open_im_sdk.refuseFriendApplication(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
// public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncFriendApplication();
|
||||
// }
|
||||
//
|
||||
// public void forceSyncFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncFriend();
|
||||
// }
|
||||
//
|
||||
// public void forceSyncBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncBlackList();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -2,125 +2,192 @@ package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.GroupListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnGroupListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class GroupManager {
|
||||
public class GroupManager extends BaseManager {
|
||||
|
||||
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupListener(new GroupListener());
|
||||
Open_im_sdk.setGroupListener(new OnGroupListener());
|
||||
}
|
||||
|
||||
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.inviteUserToGroup(
|
||||
CommonUtil.getGid(methodCall),
|
||||
CommonUtil.getGroupOpReason(methodCall),
|
||||
CommonUtil.getUidList(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.kickGroupMember(
|
||||
CommonUtil.getGid(methodCall),
|
||||
CommonUtil.getGroupOpReason(methodCall),
|
||||
CommonUtil.getUidList(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMembersInfo(
|
||||
CommonUtil.getGid(methodCall),
|
||||
CommonUtil.getUidList(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMemberList(
|
||||
CommonUtil.getGid(methodCall),
|
||||
CommonUtil.getGroupListFilter(methodCall),
|
||||
CommonUtil.getGroupListNext(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "filter"),
|
||||
value(methodCall, "offset"),
|
||||
value(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getJoinedGroupList(new BaseListener(result));
|
||||
Open_im_sdk.getJoinedGroupList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.createGroup(
|
||||
CommonUtil.getGroupInfo(methodCall),
|
||||
CommonUtil.getGroupMemberRoleList(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gInfo"),
|
||||
jsonValue(methodCall, "memberList")
|
||||
);
|
||||
}
|
||||
|
||||
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupInfo(
|
||||
CommonUtil.getGroupInfo(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "gInfo")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupsInfo(
|
||||
CommonUtil.getGidList(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.joinGroup(
|
||||
CommonUtil.getGid(methodCall),
|
||||
CommonUtil.getGroupOpReason(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason")
|
||||
);
|
||||
}
|
||||
|
||||
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.quitGroup(
|
||||
CommonUtil.getGid(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid")
|
||||
);
|
||||
}
|
||||
|
||||
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.transferGroupOwner(
|
||||
CommonUtil.getGid(methodCall),
|
||||
CommonUtil.getUid(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationList(new BaseListener(result));
|
||||
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvGroupApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendGroupApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.acceptGroupApplication(
|
||||
CommonUtil.getGroupApplicationInfo(methodCall),
|
||||
CommonUtil.getGroupOpReason(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "handleMsg")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.refuseGroupApplication(
|
||||
CommonUtil.getGroupApplicationInfo(methodCall),
|
||||
CommonUtil.getGroupOpReason(methodCall),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "handleMsg")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// public void forceSyncApplyGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncApplyGroupRequest();
|
||||
// }
|
||||
//
|
||||
// public void forceSyncGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncGroupRequest();
|
||||
// }
|
||||
//
|
||||
// public void forceSyncJoinedGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncJoinedGroup();
|
||||
// }
|
||||
//
|
||||
// public void forceSyncJoinedGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncJoinedGroupMember();
|
||||
// }
|
||||
public void dismissGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.dismissGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid")
|
||||
);
|
||||
}
|
||||
|
||||
public void changeGroupMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.changeGroupMute(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "mute")
|
||||
);
|
||||
}
|
||||
|
||||
public void changeGroupMemberMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.changeGroupMemberMute(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
int2long(methodCall, "seconds")
|
||||
);
|
||||
}
|
||||
|
||||
public void setGroupMemberNickname(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupMemberNickname(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "groupNickname")
|
||||
);
|
||||
}
|
||||
|
||||
public void searchGroups(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.searchGroups(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "searchParam")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,51 +2,46 @@ package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.SDKListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnConnListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class IMManager {
|
||||
public class IMManager extends BaseManager {
|
||||
|
||||
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(CommonUtil.getSDKJsonParam(methodCall), new SDKListener()));
|
||||
// CommonUtil.runMainThreadReturn(result, null);
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(
|
||||
new OnConnListener(),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall))
|
||||
);
|
||||
}
|
||||
|
||||
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.login(CommonUtil.getUid(methodCall), CommonUtil.getToken(methodCall), new BaseListener(result));
|
||||
Open_im_sdk.login(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "token")
|
||||
);
|
||||
}
|
||||
|
||||
public void logout(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.logout(new BaseListener(result));
|
||||
Open_im_sdk.logout(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus());
|
||||
}
|
||||
|
||||
// public void getLoginUid(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid());
|
||||
// }
|
||||
|
||||
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUsersInfo(CommonUtil.getUidList(methodCall), new BaseListener(result));
|
||||
public void wakeUp(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.wakeUp(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSelfInfo(CommonUtil.getSDKJsonParam(methodCall), new BaseListener(result));
|
||||
}
|
||||
|
||||
public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.forceSyncLoginUerInfo();
|
||||
}
|
||||
|
||||
// public void forceReConn(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceReConn();
|
||||
// }
|
||||
|
||||
public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSdkLog(CommonUtil.getSDKLog(methodCall));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.AdvancedMsgListener;
|
||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.MsgSendProgressListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnAdvancedMsgListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
|
||||
public class MessageManager {
|
||||
public class MessageManager extends BaseManager {
|
||||
private final static String KEY_ID = "id";
|
||||
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
|
||||
private static boolean initializedListener = false;
|
||||
/* private static boolean initializedListener = false;
|
||||
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
|
||||
|
||||
protected void clearListeners() {
|
||||
initializedListener = false;
|
||||
listeners.clear();
|
||||
}
|
||||
|
||||
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
|
||||
@Override
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
@@ -44,6 +45,7 @@ public class MessageManager {
|
||||
|
||||
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
|
||||
listeners.put(key, new AdvancedMsgListener(key));
|
||||
if (!initializedListener) {
|
||||
initializedListener = true;
|
||||
@@ -56,9 +58,9 @@ public class MessageManager {
|
||||
listeners.remove(key);
|
||||
if (listeners.isEmpty()) {
|
||||
initializedListener = false;
|
||||
// Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
|
||||
}
|
||||
Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
|
||||
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
@@ -77,169 +79,314 @@ public class MessageManager {
|
||||
}
|
||||
|
||||
*/
|
||||
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
|
||||
}
|
||||
|
||||
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
MsgSendProgressListener listener = new MsgSendProgressListener(result, methodCall);
|
||||
Open_im_sdk.sendMessage(listener,
|
||||
CommonUtil.getSendMessageContent(methodCall),
|
||||
CommonUtil.getSendMessageReceiver(methodCall),
|
||||
CommonUtil.geSendMessageGroupId(methodCall),
|
||||
CommonUtil.getSendMessageOnlineOnly(methodCall));
|
||||
Open_im_sdk.sendMessage(
|
||||
new OnMsgSendListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "offlinePushInfo")
|
||||
);
|
||||
}
|
||||
|
||||
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getHistoryMessageList(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
||||
Open_im_sdk.getHistoryMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.revokeMessage(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
||||
Open_im_sdk.revokeMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessageFromLocalStorage(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
||||
Open_im_sdk.deleteMessageFromLocalStorage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.deleteMessages(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
||||
}
|
||||
// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.deleteMessages(new OnBaseListener(result, methodCall), CommonUtil.getSDKJsonParam(methodCall));
|
||||
// }
|
||||
|
||||
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.insertSingleMessageToLocalStorage(new BaseListener(result),
|
||||
CommonUtil.getSingleMessageContent(methodCall),
|
||||
CommonUtil.getSingleMessageUserid(methodCall),
|
||||
CommonUtil.getSingleMessageSender(methodCall));
|
||||
Open_im_sdk.insertSingleMessageToLocalStorage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "receiverID"),
|
||||
value(methodCall, "senderID")
|
||||
);
|
||||
}
|
||||
|
||||
public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.findMessages(new BaseListener(result), CommonUtil.getMessageIdList(methodCall));
|
||||
public void insertGroupMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.insertGroupMessageToLocalStorage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "senderID")
|
||||
);
|
||||
}
|
||||
|
||||
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markC2CMessageAsRead(new BaseListener(result),
|
||||
CommonUtil.getSingleMessageUserid(methodCall),
|
||||
CommonUtil.getMessageIdList(methodCall));
|
||||
Open_im_sdk.markC2CMessageAsRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void markGroupMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markGroupMessageAsRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.typingStatusUpdate(CommonUtil.getSingleMessageUserid(methodCall),
|
||||
CommonUtil.getSingleMessageTyping(methodCall));
|
||||
Open_im_sdk.typingStatusUpdate(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "msgTip")
|
||||
);
|
||||
}
|
||||
|
||||
public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createTextMessage(
|
||||
CommonUtil.getMessageText(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "text")));
|
||||
}
|
||||
|
||||
public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createTextAtMessage(
|
||||
CommonUtil.getMessageText(methodCall),
|
||||
CommonUtil.getAtUserList(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "text"),
|
||||
jsonValue(methodCall, "atUserIDList"),
|
||||
jsonValue(methodCall, "atUserInfoList"),
|
||||
jsonValue(methodCall, "quoteMessage")
|
||||
));
|
||||
}
|
||||
|
||||
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createImageMessage(
|
||||
CommonUtil.getImagePath(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "imagePath")));
|
||||
}
|
||||
|
||||
public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createImageMessageFromFullPath(
|
||||
CommonUtil.getImagePath(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "imagePath")));
|
||||
}
|
||||
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createSoundMessage(
|
||||
CommonUtil.getSoundPath(methodCall),
|
||||
CommonUtil.getSoundDuration(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "soundPath"),
|
||||
int2long(methodCall, "duration")));
|
||||
}
|
||||
|
||||
public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createSoundMessageFromFullPath(
|
||||
CommonUtil.getSoundPath(methodCall),
|
||||
CommonUtil.getSoundDuration(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "soundPath"),
|
||||
int2long(methodCall, "duration")));
|
||||
}
|
||||
|
||||
public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createVideoMessage(
|
||||
CommonUtil.getVideoPath(methodCall),
|
||||
CommonUtil.getVideoType(methodCall),
|
||||
CommonUtil.getVideoDuration(methodCall),
|
||||
CommonUtil.getVideoSnapshotPath(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "videoPath"),
|
||||
value(methodCall, "videoType"),
|
||||
int2long(methodCall, "duration"),
|
||||
value(methodCall, "snapshotPath")));
|
||||
}
|
||||
|
||||
public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createVideoMessageFromFullPath(
|
||||
CommonUtil.getVideoPath(methodCall),
|
||||
CommonUtil.getVideoType(methodCall),
|
||||
CommonUtil.getVideoDuration(methodCall),
|
||||
CommonUtil.getVideoSnapshotPath(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "videoPath"),
|
||||
value(methodCall, "videoType"),
|
||||
int2long(methodCall, "duration"),
|
||||
value(methodCall, "snapshotPath")));
|
||||
}
|
||||
|
||||
public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createFileMessage(
|
||||
CommonUtil.getFilePath(methodCall),
|
||||
CommonUtil.getFileName(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "filePath"),
|
||||
value(methodCall, "fileName")));
|
||||
}
|
||||
|
||||
public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createFileMessageFromFullPath(
|
||||
CommonUtil.getFilePath(methodCall),
|
||||
CommonUtil.getFileName(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "filePath"),
|
||||
value(methodCall, "fileName")));
|
||||
}
|
||||
|
||||
public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createMergerMessage(
|
||||
CommonUtil.getMergerMessageList(methodCall),
|
||||
CommonUtil.getMergerMessageTitle(methodCall),
|
||||
CommonUtil.getSummaryList(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "messageList"),
|
||||
value(methodCall, "title"),
|
||||
jsonValue(methodCall, "summaryList")));
|
||||
}
|
||||
|
||||
|
||||
public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createForwardMessage(
|
||||
CommonUtil.getForwardMessage(methodCall)));
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message")));
|
||||
}
|
||||
|
||||
public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage(
|
||||
CommonUtil.getMessageDes(methodCall),
|
||||
CommonUtil.getLocationLongitude(methodCall),
|
||||
CommonUtil.getLocationLatitude(methodCall)
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "description"),
|
||||
value(methodCall, "longitude"),
|
||||
value(methodCall, "latitude")
|
||||
));
|
||||
}
|
||||
|
||||
public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage(
|
||||
CommonUtil.getCustomMessageData(methodCall),
|
||||
CommonUtil.getCustomMessageExt(methodCall),
|
||||
CommonUtil.getMessageDes(methodCall)
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "data"),
|
||||
value(methodCall, "extension"),
|
||||
value(methodCall, "description")
|
||||
));
|
||||
}
|
||||
|
||||
public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage(
|
||||
CommonUtil.getQuoteMessageText(methodCall),
|
||||
CommonUtil.getQuoteMessageBody(methodCall)
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "quoteText"),
|
||||
jsonValue(methodCall, "quoteMessage")
|
||||
));
|
||||
}
|
||||
|
||||
public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage(
|
||||
CommonUtil.getCardMessage(methodCall)
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "cardMessage")
|
||||
));
|
||||
}
|
||||
|
||||
public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.forceSyncMsg();
|
||||
public void createFaceMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createFaceMessage(
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "index"),
|
||||
value(methodCall, "data")
|
||||
));
|
||||
}
|
||||
|
||||
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearC2CHistoryMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearGroupHistoryMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void searchLocalMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.searchLocalMessages(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "filter")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessageFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllMsgFromLocal(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteAllMsgFromLocal(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllMsgFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteAllMsgFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void markMessageAsReadByConID(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markMessageAsReadByConID(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearC2CHistoryMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearC2CHistoryMessageFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearGroupHistoryMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearGroupHistoryMessageFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getHistoryMessageListReverse(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getHistoryMessageListReverse(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnSignalingListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class SignalingManager extends BaseManager {
|
||||
|
||||
public void setSignalingListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSignalingListener(new OnSignalingListener());
|
||||
}
|
||||
|
||||
public void signalingInvite(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingInvite(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingInviteInGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingInviteInGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingAccept(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingAccept(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingReject(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingReject(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingCancel(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingCancel(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingHungUp(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingHungUp(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnUserListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class UserManager extends BaseManager {
|
||||
|
||||
public void setUserListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setUserListener(new OnUserListener());
|
||||
}
|
||||
|
||||
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUsersInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList"));
|
||||
}
|
||||
|
||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSelfInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall));
|
||||
}
|
||||
|
||||
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSelfUserInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnWorkMomentsListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class WorkMomentsManager extends BaseManager {
|
||||
|
||||
public void setWorkMomentsListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setWorkMomentsListener(new OnWorkMomentsListener());
|
||||
}
|
||||
|
||||
public void getWorkMomentsUnReadCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getWorkMomentsUnReadCount(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"));
|
||||
}
|
||||
|
||||
public void getWorkMomentsNotification(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getWorkMomentsNotification(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count"));
|
||||
}
|
||||
|
||||
public void clearWorkMomentsNotification(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearWorkMomentsNotification(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"));
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@ package io.openim.flutter_openim_sdk.util;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import androidx.collection.ArrayMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
||||
|
||||
@@ -15,18 +15,6 @@ import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
||||
public class CommonUtil {
|
||||
private final static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||
|
||||
public static <T> T getParamValue(MethodCall methodCall, String param) {
|
||||
return methodCall.argument(param);
|
||||
}
|
||||
|
||||
public static String getSDKJsonParam(MethodCall methodCall, String key) {
|
||||
return JsonUtil.toString(methodCall.argument(key));
|
||||
}
|
||||
|
||||
public static String getSDKJsonParam(MethodCall methodCall) {
|
||||
return JsonUtil.toString(methodCall.arguments);
|
||||
}
|
||||
|
||||
public static void runMainThreadReturn(final MethodChannel.Result result, final Object param) {
|
||||
MAIN_HANDLER.post(() -> result.success(param));
|
||||
}
|
||||
@@ -44,9 +32,9 @@ public class CommonUtil {
|
||||
runMainThreadReturnError(result, String.valueOf(errorCode), errorMessage, errorDetails);
|
||||
}
|
||||
|
||||
public synchronized static <T> void emitEvent(String method, String type, Long errCode, String errMsg, T data) {
|
||||
public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
|
||||
runMainThread(() -> {
|
||||
HashMap<String, Object> res = new HashMap<>();
|
||||
Map<String, Object> res = new ArrayMap<>();
|
||||
if (null != type) {
|
||||
res.put("type", type);
|
||||
}
|
||||
@@ -67,288 +55,4 @@ public class CommonUtil {
|
||||
public static <T> void emitEvent(String method, String type, T data) {
|
||||
emitEvent(method, type, null, null, data);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
//////////////////////////////////////
|
||||
public static String getUid(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_UID);
|
||||
}
|
||||
|
||||
public static String getJsonUid(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_UID);
|
||||
}
|
||||
|
||||
public static String getToken(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_TOKEN);
|
||||
}
|
||||
|
||||
public static String getUidList(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_USER_IDS);
|
||||
}
|
||||
|
||||
public static String getMessageText(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_TEXT);
|
||||
}
|
||||
|
||||
public static String getAtUserList(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_AT_USER_LIST);
|
||||
}
|
||||
|
||||
public static String getImagePath(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_IMAGE_PATH);
|
||||
}
|
||||
|
||||
public static String getSoundPath(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SOUND_PATH);
|
||||
}
|
||||
|
||||
public static long getSoundDuration(MethodCall methodCall) {
|
||||
Integer i = getParamValue(methodCall, KEY_SOUND_DURATION);
|
||||
return Long.valueOf(i);
|
||||
}
|
||||
|
||||
public static String getVideoPath(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_VIDEO_PATH);
|
||||
}
|
||||
|
||||
public static String getVideoType(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_VIDEO_TYPE);
|
||||
}
|
||||
|
||||
public static long getVideoDuration(MethodCall methodCall) {
|
||||
Integer i = getParamValue(methodCall, KEY_VIDEO_DURATION);
|
||||
return Long.valueOf(i);
|
||||
}
|
||||
|
||||
public static String getVideoSnapshotPath(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_VIDEO_SNAPSHOT_PATH);
|
||||
}
|
||||
|
||||
public static String getFilePath(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_FILE_PATH);
|
||||
}
|
||||
|
||||
public static String getFileName(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_FILE_NAME);
|
||||
}
|
||||
|
||||
public static String getMergerMessageList(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_MERGER_MESSAGE_LIST);
|
||||
}
|
||||
|
||||
public static String getMergerMessageTitle(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_MERGER_MESSAGE_TITLE);
|
||||
}
|
||||
|
||||
public static String getSummaryList(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_SUMMARY_LIST);
|
||||
}
|
||||
|
||||
public static String getForwardMessage(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_FORWARD_MESSAGE);
|
||||
}
|
||||
|
||||
public static String getSendMessageContent(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_SEND_MESSAGE_CONTENT);
|
||||
}
|
||||
|
||||
public static Object getSendMessageClientMsgID(MethodCall methodCall) {
|
||||
Map<String, Object> map = getParamValue(methodCall, KEY_SEND_MESSAGE_CONTENT);
|
||||
return map.get(KEY_SEND_MESSAGE_CONTENT_CLIENT_ID);
|
||||
}
|
||||
|
||||
public static String getSendMessageReceiver(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SEND_MESSAGE_RECEIVER);
|
||||
}
|
||||
|
||||
public static String geSendMessageGroupId(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SEND_MESSAGE_GROUP_ID);
|
||||
}
|
||||
|
||||
public static boolean getSendMessageOnlineOnly(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SEND_MESSAGE_ONLINE_ONLY);
|
||||
}
|
||||
|
||||
public static String getSingleMessageContent(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SINGLE_MESSAGE_CONTENT);
|
||||
}
|
||||
|
||||
public static String getSingleMessageUserid(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SINGLE_MESSAGE_USERID);
|
||||
}
|
||||
|
||||
public static String getGroupMessageGroupid(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_GROUP_MESSAGE_GROUPID);
|
||||
}
|
||||
|
||||
public static String getSingleMessageSender(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SINGLE_MESSAGE_SENDER);
|
||||
}
|
||||
|
||||
public static String getSingleMessageTyping(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SINGLE_MESSAGE_TYPING);
|
||||
}
|
||||
|
||||
public static String getMessageIdList(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_FIND_MESSAGE_IDS);
|
||||
}
|
||||
|
||||
public static String getConversationId(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_CONVERSATION_ID);
|
||||
}
|
||||
|
||||
public static String getConversationIds(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_CONVERSATION_IDS);
|
||||
}
|
||||
|
||||
public static String getConversationSourceId(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_CONVERSATION_SOURCE_ID);
|
||||
}
|
||||
|
||||
public static int getConversationSessionType(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_CONVERSATION_SESSION_TYPE);
|
||||
}
|
||||
|
||||
public static String getConversationDraft(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_CONVERSATION_DRAFT);
|
||||
}
|
||||
|
||||
public static boolean isPinnedConversation(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_CONVERSATION_PINNED);
|
||||
}
|
||||
|
||||
public static String getGid(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_GROUP_ID);
|
||||
}
|
||||
|
||||
public static String getGidList(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_GROUP_IDS);
|
||||
}
|
||||
|
||||
public static String getGroupOpReason(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_GROUP_OP_REASON);
|
||||
}
|
||||
|
||||
public static int getGroupListFilter(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_GROUP_LIST_FILTER);
|
||||
}
|
||||
|
||||
public static int getGroupListNext(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_GROUP_LIST_NEXT);
|
||||
}
|
||||
|
||||
public static String getGroupInfo(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_GROUP_INFO);
|
||||
}
|
||||
|
||||
public static String getGroupMemberRoleList(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_GROUP_MEMBER_ROLE_LIST);
|
||||
}
|
||||
|
||||
public static String getGroupApplicationInfo(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_GROUP_APPLICATION_INFO);
|
||||
}
|
||||
|
||||
|
||||
public static double getLocationLatitude(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_LOCATION_MESSAGE_LA);
|
||||
}
|
||||
|
||||
public static double getLocationLongitude(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_LOCATION_MESSAGE_LO);
|
||||
}
|
||||
|
||||
public static String getMessageDes(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_MESSAGE_DES);
|
||||
}
|
||||
|
||||
public static String getCustomMessageData(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_CUSTOM_MESSAGE_DATA);
|
||||
}
|
||||
|
||||
public static String getCustomMessageExt(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_CUSTOM_MESSAGE_EXT);
|
||||
}
|
||||
|
||||
public static String getQuoteMessageText(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_QUOTE_MESSAGE_TEXT);
|
||||
}
|
||||
|
||||
public static String getQuoteMessageBody(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_QUOTE_MESSAGE_BODY);
|
||||
}
|
||||
|
||||
public static String getCardMessage(MethodCall methodCall) {
|
||||
return getSDKJsonParam(methodCall, KEY_CARD_MESSAGE);
|
||||
}
|
||||
|
||||
public static int getSDKLog(MethodCall methodCall) {
|
||||
return getParamValue(methodCall, KEY_SDK_LOG);
|
||||
}
|
||||
|
||||
//login
|
||||
final static String KEY_UID = "uid";
|
||||
final static String KEY_TOKEN = "token";
|
||||
//create message body
|
||||
final static String KEY_TEXT = "text";
|
||||
final static String KEY_AT_USER_LIST = "atUserList";
|
||||
final static String KEY_IMAGE_PATH = "imagePath";
|
||||
final static String KEY_SOUND_PATH = "soundPath";
|
||||
final static String KEY_SOUND_DURATION = "duration";
|
||||
final static String KEY_VIDEO_PATH = "videoPath";
|
||||
final static String KEY_VIDEO_TYPE = "videoType";
|
||||
final static String KEY_VIDEO_DURATION = "duration";
|
||||
final static String KEY_VIDEO_SNAPSHOT_PATH = "snapshotPath";
|
||||
final static String KEY_FILE_PATH = "filePath";
|
||||
final static String KEY_FILE_NAME = "fileName";
|
||||
final static String KEY_MERGER_MESSAGE_LIST = "messageList";
|
||||
final static String KEY_MERGER_MESSAGE_TITLE = "title";
|
||||
final static String KEY_SUMMARY_LIST = "summaryList";
|
||||
final static String KEY_FORWARD_MESSAGE = "message";
|
||||
final static String KEY_LOCATION_MESSAGE_LO = "longitude";
|
||||
final static String KEY_LOCATION_MESSAGE_LA = "latitude";
|
||||
final static String KEY_MESSAGE_DES = "description";
|
||||
final static String KEY_CUSTOM_MESSAGE_DATA = "data";
|
||||
final static String KEY_CUSTOM_MESSAGE_EXT = "extension";
|
||||
final static String KEY_QUOTE_MESSAGE_TEXT = "quoteText";
|
||||
final static String KEY_QUOTE_MESSAGE_BODY = "quoteMessage";
|
||||
final static String KEY_CARD_MESSAGE = "cardMessage";
|
||||
//send message
|
||||
final static String KEY_SEND_MESSAGE_CONTENT = "message";
|
||||
final static String KEY_SEND_MESSAGE_CONTENT_CLIENT_ID = "clientMsgID";
|
||||
final static String KEY_SEND_MESSAGE_RECEIVER = "receiver";
|
||||
final static String KEY_SEND_MESSAGE_GROUP_ID = "groupID";
|
||||
final static String KEY_SEND_MESSAGE_ONLINE_ONLY = "onlineUserOnly";
|
||||
//single chat
|
||||
final static String KEY_SINGLE_MESSAGE_CONTENT = "message";
|
||||
final static String KEY_SINGLE_MESSAGE_USERID = "userID";
|
||||
final static String KEY_SINGLE_MESSAGE_SENDER = "sender";
|
||||
final static String KEY_SINGLE_MESSAGE_TYPING = "typing";
|
||||
//group chat
|
||||
final static String KEY_GROUP_MESSAGE_GROUPID = "groupID";
|
||||
// find message
|
||||
final static String KEY_FIND_MESSAGE_IDS = "messageIDList";
|
||||
// conversation
|
||||
final static String KEY_CONVERSATION_ID = "conversationID";
|
||||
final static String KEY_CONVERSATION_IDS = "conversationIDList";
|
||||
final static String KEY_CONVERSATION_DRAFT = "draftText";
|
||||
final static String KEY_CONVERSATION_PINNED = "isPinned";
|
||||
final static String KEY_CONVERSATION_SOURCE_ID = "sourceID";
|
||||
final static String KEY_CONVERSATION_SESSION_TYPE = "sessionType";
|
||||
// user info
|
||||
final static String KEY_USER_IDS = "uidList";
|
||||
// group
|
||||
final static String KEY_GROUP_ID = "gid";
|
||||
final static String KEY_GROUP_IDS = "gidList";
|
||||
final static String KEY_GROUP_OP_REASON = "reason";
|
||||
// final static String KEY_GROUP_USER_ID = "uid";
|
||||
// final static String KEY_GROUP_USER_IDS = "uidList";
|
||||
final static String KEY_GROUP_LIST_FILTER = "filter";
|
||||
final static String KEY_GROUP_LIST_NEXT = "next";
|
||||
final static String KEY_GROUP_INFO = "gInfo";
|
||||
final static String KEY_GROUP_MEMBER_ROLE_LIST = "memberList";
|
||||
final static String KEY_GROUP_APPLICATION_INFO = "application";
|
||||
//
|
||||
final static String KEY_SDK_LOG = "sdkLog";
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@ import org.json.JSONObject;
|
||||
|
||||
public class JsonUtil {
|
||||
public static String toString(Object o) {
|
||||
if (o == null) return null;
|
||||
if (o instanceof String) {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
buffer.append("\"");
|
||||
buffer.append(o);
|
||||
buffer.append("\"");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objectVersion = 51;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
@@ -121,7 +121,6 @@
|
||||
3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */,
|
||||
076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -139,7 +138,6 @@
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -156,7 +154,7 @@
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1020;
|
||||
LastUpgradeCheck = 1300;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
@@ -198,23 +196,6 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -303,6 +284,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = arm64;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
@@ -353,12 +335,17 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -371,6 +358,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = arm64;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
@@ -426,6 +414,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = arm64;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
@@ -467,7 +456,8 @@
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -477,12 +467,17 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -496,12 +491,17 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
LastUpgradeVersion = "1300"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 0 B |
@@ -1,7 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
@@ -15,7 +13,6 @@ class MyApp extends StatefulWidget {
|
||||
class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
void initState() {
|
||||
_initSDK();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -28,81 +25,10 @@ class _MyAppState extends State<MyApp> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
TextButton(onPressed: _login, child: Text('login')),
|
||||
TextButton(onPressed: () {}, child: Text('login')),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _login() {
|
||||
if (OpenIM.iMManager.isInitialized)
|
||||
OpenIM.iMManager.login(uid: '', token: '');
|
||||
}
|
||||
|
||||
void _initSDK() async {
|
||||
// Initialize SDK
|
||||
OpenIM.iMManager
|
||||
..initSDK(
|
||||
platform: Platform.isAndroid ? IMPlatform.android : IMPlatform.ios,
|
||||
ipApi: '',
|
||||
ipWs: '',
|
||||
dbPath: '',
|
||||
listener: OnInitSDKListener(
|
||||
onConnecting: () {},
|
||||
onConnectFailed: (code, error) {},
|
||||
onConnectSuccess: () {},
|
||||
onKickedOffline: () {},
|
||||
onUserSigExpired: () {},
|
||||
onSelfInfoUpdated: (user) {},
|
||||
),
|
||||
)
|
||||
|
||||
// Add message listener (remove when not in use)
|
||||
..messageManager.addAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
onRecvMessageRevoked: (msgId) {},
|
||||
onRecvC2CReadReceipt: (list) {},
|
||||
onRecvNewMessage: (msg) {},
|
||||
))
|
||||
|
||||
// Set up message sending progress listener
|
||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
||||
onProgress: (msgId, progress) {},
|
||||
))
|
||||
|
||||
// Set up friend relationship listener
|
||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
||||
onBlackListAdd: (u) {},
|
||||
onBlackListDeleted: (u) {},
|
||||
onFriendApplicationListAccept: (u) {},
|
||||
onFriendApplicationListAdded: (u) {},
|
||||
onFriendApplicationListDeleted: (u) {},
|
||||
onFriendApplicationListReject: (u) {},
|
||||
onFriendInfoChanged: (u) {},
|
||||
onFriendListAdded: (u) {},
|
||||
onFriendListDeleted: (u) {},
|
||||
))
|
||||
|
||||
// Set up conversation listener
|
||||
..conversationManager.setConversationListener(OnConversationListener(
|
||||
onConversationChanged: (list) {},
|
||||
onNewConversation: (list) {},
|
||||
onTotalUnreadMessageCountChanged: (count) {},
|
||||
onSyncServerFailed: () {},
|
||||
onSyncServerFinish: () {},
|
||||
onSyncServerStart: () {},
|
||||
))
|
||||
|
||||
// Set up group listener
|
||||
..groupManager.setGroupListener(OnGroupListener(
|
||||
onApplicationProcessed: (groupId, opUser, agreeOrReject, opReason) {},
|
||||
onGroupCreated: (groupId) {},
|
||||
onGroupInfoChanged: (groupId, info) {},
|
||||
onMemberEnter: (groupId, list) {},
|
||||
onMemberInvited: (groupId, opUser, list) {},
|
||||
onMemberKicked: (groupId, opUser, list) {},
|
||||
onMemberLeave: (groupId, info) {},
|
||||
onReceiveJoinApplication: (groupId, info, opReason) {},
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.8.1"
|
||||
version: "2.8.2"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -21,7 +21,7 @@ packages:
|
||||
name: characters
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -68,7 +68,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.9+1"
|
||||
version: "2.0.0+6"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -80,7 +80,14 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.12.10"
|
||||
version: "0.12.11"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -141,7 +148,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.4.2"
|
||||
version: "0.4.8"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -155,7 +162,7 @@ packages:
|
||||
name: vector_math
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.1"
|
||||
sdks:
|
||||
dart: ">=2.12.0 <3.0.0"
|
||||
dart: ">=2.14.0 <3.0.0"
|
||||
flutter: ">=1.20.0"
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
//
|
||||
// BaseCallback.swift
|
||||
// flutter_openim_sdk
|
||||
//
|
||||
// Created by willem on 2021/10/9.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class BaseCallback: NSObject, Open_im_sdkBaseProtocol {
|
||||
public class BaseCallback: NSObject, Open_im_sdk_callbackBaseProtocol {
|
||||
|
||||
private let result:FlutterResult
|
||||
|
||||
@@ -16,7 +9,7 @@ public class BaseCallback: NSObject, Open_im_sdkBaseProtocol {
|
||||
self.result = result
|
||||
}
|
||||
|
||||
public func onError(_ errCode: Int, errMsg: String?) {
|
||||
public func onError(_ errCode: Int32, errMsg: String?) {
|
||||
print("BaseResult: " + errMsg!)
|
||||
safeMainAsync { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class CommonUtil {
|
||||
|
||||
public static func emitEvent(channel: FlutterMethodChannel, method: String, type: String, errCode: Int?, errMsg: String?, data: Any?){
|
||||
public static func emitEvent(channel: FlutterMethodChannel, method: String, type: String, errCode: Int32?, errMsg: String?, data: Any?){
|
||||
safeMainAsync {
|
||||
var res: [String: Any] = [:]
|
||||
res["type"] = type
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
//
|
||||
// JsonUtil.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/28.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class JsonUtil {
|
||||
|
||||
public static func toString(object: AnyObject?)->String {
|
||||
|
||||
if object is NSNull {
|
||||
return ""
|
||||
}
|
||||
|
||||
if object == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
if object is String{
|
||||
let s = object as! String
|
||||
let b = s.replacingOccurrences(of: "\"", with: "\\\"")
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// BaseServiceManager.swift
|
||||
// flutter_openim_sdk
|
||||
//
|
||||
// Created by willem on 2021/10/9.
|
||||
//
|
||||
|
||||
import Flutter
|
||||
import OpenIMCore
|
||||
import UIKit
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// ConversationManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/29.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -12,18 +5,25 @@ public class ConversationManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
|
||||
self["setConversationListener"] = setConversationListener
|
||||
self["getAllConversationList"] = getAllConversationList
|
||||
self["getConversationListSplit"] = getConversationListSplit
|
||||
self["getOneConversation"] = getOneConversation
|
||||
self["getMultipleConversation"] = getMultipleConversation
|
||||
self["deleteConversation"] = deleteConversation
|
||||
self["setConversationDraft"] = setConversationDraft
|
||||
self["pinConversation"] = pinConversation
|
||||
self["markSingleMessageHasRead"] = markSingleMessageHasRead
|
||||
// self["markSingleMessageHasRead"] = markSingleMessageHasRead
|
||||
self["markGroupMessageHasRead"] = markGroupMessageHasRead
|
||||
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
||||
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
||||
self["setOneConversationPrivateChat"] = setOneConversationPrivateChat
|
||||
self["deleteConversationFromLocalAndSvr"] = deleteConversationFromLocalAndSvr
|
||||
self["deleteAllConversationFromLocal"] = deleteAllConversationFromLocal
|
||||
self["resetConversationGroupAtType"] = resetConversationGroupAtType
|
||||
self["getAtAllTag"] = getAtAllTag
|
||||
}
|
||||
|
||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -32,49 +32,81 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetAllConversationList(BaseCallback(result: result))
|
||||
Open_im_sdkGetAllConversationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetOneConversation(methodCall[string: "sourceID"], methodCall[int: "sessionType"], BaseCallback(result: result))
|
||||
Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "sessionType"], methodCall[string: "sourceID"])
|
||||
}
|
||||
|
||||
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetMultipleConversation(methodCall[jsonString: "conversationIDList"], BaseCallback(result: result))
|
||||
Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversation(methodCall[string: "conversationID"], BaseCallback(result: result))
|
||||
Open_im_sdkDeleteConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationDraft(methodCall[string: "conversationID"], methodCall[string: "draftText"], BaseCallback(result: result))
|
||||
Open_im_sdkSetConversationDraft(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "draftText"])
|
||||
}
|
||||
|
||||
func pinConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkPinConversation(methodCall[string: "conversationID"], methodCall[bool: "isPinned"], BaseCallback(result: result))
|
||||
Open_im_sdkPinConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "isPinned"])
|
||||
}
|
||||
|
||||
func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"])
|
||||
}
|
||||
// func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"])
|
||||
// }
|
||||
|
||||
func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "groupID"])
|
||||
Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result))
|
||||
Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let conversationID = Open_im_sdkGetConversationIDBySessionType(methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
||||
callBack(result, conversationID)
|
||||
}
|
||||
|
||||
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"], methodCall[int: "status"])
|
||||
}
|
||||
|
||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func setOneConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetOneConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
||||
}
|
||||
|
||||
func deleteConversationFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversationFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteAllConversationFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func resetConversationGroupAtType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkResetConversationGroupAtType(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func getAtAllTag(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkGetAtAllTag())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ConversationListener: NSObject, Open_im_sdkOnConversationListenerProtocol {
|
||||
public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// FriendshipManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/29.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -15,14 +8,15 @@ public class FriendshipManager: BaseServiceManager {
|
||||
self["setFriendListener"] = setFriendListener
|
||||
self["getFriendsInfo"] = getFriendsInfo
|
||||
self["addFriend"] = addFriend
|
||||
self["getFriendApplicationList"] = getFriendApplicationList
|
||||
self["getRecvFriendApplicationList"] = getRecvFriendApplicationList
|
||||
self["getSendFriendApplicationList"] = getSendFriendApplicationList
|
||||
self["getFriendList"] = getFriendList
|
||||
self["setFriendInfo"] = setFriendInfo
|
||||
self["addToBlackList"] = addToBlackList
|
||||
self["getBlackList"] = getBlackList
|
||||
self["deleteFromBlackList"] = deleteFromBlackList
|
||||
self["setFriendRemark"] = setFriendRemark
|
||||
self["addBlacklist"] = addBlacklist
|
||||
self["getBlacklist"] = getBlacklist
|
||||
self["removeBlacklist"] = removeBlacklist
|
||||
self["checkFriend"] = checkFriend
|
||||
self["deleteFromFriendList"] = deleteFromFriendList
|
||||
self["deleteFriend"] = deleteFriend
|
||||
self["acceptFriendApplication"] = acceptFriendApplication
|
||||
self["refuseFriendApplication"] = refuseFriendApplication
|
||||
// self["forceSyncFriendApplication"] = forceSyncFriendApplication
|
||||
@@ -36,51 +30,55 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendsInfo(BaseCallback(result: result), methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetDesignatedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationList(BaseCallback(result: result))
|
||||
func getRecvFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getSendFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendList(BaseCallback(result: result))
|
||||
Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func setFriendInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetFriendInfo(methodCall.toJsonString(), BaseCallback(result: result))
|
||||
func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func addToBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddToBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func getBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetBlackList(BaseCallback(result: result))
|
||||
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetBlackList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func deleteFromBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFromBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func deleteFromFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFromFriendList(methodCall[jsonString: "uid"], BaseCallback(result: result))
|
||||
func deleteFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
// func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -99,48 +97,47 @@ public class FriendshipManager: BaseServiceManager {
|
||||
// }
|
||||
}
|
||||
|
||||
public class FriendshipListener: NSObject, Open_im_sdkOnFriendshipListenerProtocol {
|
||||
public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol {
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onBlackListAdd(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListAdd", errCode: nil, errMsg: nil, data: userInfo)
|
||||
public func onBlackAdded(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistAdded", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onBlackListDeleted(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListDeleted", errCode: nil, errMsg: nil, data: userInfo)
|
||||
public func onBlackDeleted(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistDeleted", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListAccept(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAccept", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationAccepted(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAccepted", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListAdded(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAdded", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationAdded(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAdded", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListDeleted(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListDeleted", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationDeleted(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationDeleted", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListReject(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListReject", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationRejected(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationRejected", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendInfoChanged(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendListAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListAdded", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
public func onFriendAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendListDeleted(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListDeleted", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
public func onFriendDeleted(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendDeleted", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// GroupManager.swift
|
||||
// flutter_openim_sdk
|
||||
//
|
||||
// Created by z1u24 on 2021/7/5.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -24,13 +17,15 @@ public class GroupManager: BaseServiceManager {
|
||||
self["joinGroup"] = joinGroup
|
||||
self["quitGroup"] = quitGroup
|
||||
self["transferGroupOwner"] = transferGroupOwner
|
||||
self["getGroupApplicationList"] = getGroupApplicationList
|
||||
self["getRecvGroupApplicationList"] = getRecvGroupApplicationList
|
||||
self["getSendGroupApplicationList"] = getSendGroupApplicationList
|
||||
self["acceptGroupApplication"] = acceptGroupApplication
|
||||
self["refuseGroupApplication"] = refuseGroupApplication
|
||||
// self["forceSyncApplyGroupRequest"] = forceSyncApplyGroupRequest
|
||||
// self["forceSyncGroupRequest"] = forceSyncGroupRequest
|
||||
// self["forceSyncJoinedGroup"] = forceSyncJoinedGroup
|
||||
// self["forceSyncJoinedGroupMember"] = forceSyncJoinedGroupMember
|
||||
self["dismissGroup"] = dismissGroup
|
||||
self["changeGroupMute"] = changeGroupMute
|
||||
self["changeGroupMemberMute"] = changeGroupMemberMute
|
||||
self["setGroupMemberNickname"] = setGroupMemberNickname
|
||||
self["searchGroups"] = searchGroups
|
||||
}
|
||||
|
||||
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -39,86 +34,90 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInviteUserToGroup(methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkKickGroupMember(methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMembersInfo(methodCall[string: "gid"], methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
Open_im_sdkGetGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMemberList(methodCall[string: "gid"], methodCall[int32: "filter"],
|
||||
methodCall[int32: "next"], BaseCallback(result: result))
|
||||
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[int32: "filter"],
|
||||
methodCall[int32: "offset"], methodCall[int32: "count"])
|
||||
}
|
||||
|
||||
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result))
|
||||
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCreateGroup(methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"], BaseCallback(result: result))
|
||||
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"])
|
||||
}
|
||||
|
||||
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupInfo(methodCall[jsonString: "gInfo"], BaseCallback(result: result))
|
||||
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "gInfo"])
|
||||
}
|
||||
|
||||
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupsInfo(methodCall[jsonString: "gidList"], BaseCallback(result: result))
|
||||
Open_im_sdkGetGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gidList"])
|
||||
}
|
||||
|
||||
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkJoinGroup(methodCall[string: "gid"], methodCall[string: "reason"], BaseCallback(result: result))
|
||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"])
|
||||
}
|
||||
|
||||
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkQuitGroup(methodCall[string: "gid"], BaseCallback(result: result))
|
||||
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||
}
|
||||
|
||||
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkTransferGroupOwner(methodCall[string: "gid"], methodCall[string: "uid"], BaseCallback(result: result))
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func getGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupApplicationList(BaseCallback(result: result))
|
||||
func getRecvGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getSendGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result))
|
||||
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||
}
|
||||
|
||||
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRefuseGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result))
|
||||
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||
}
|
||||
|
||||
// func forceSyncApplyGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceSyncApplyGroupRequest()
|
||||
// callBack(result)
|
||||
// }
|
||||
//
|
||||
// func forceSyncGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceSyncGroupRequest()
|
||||
// callBack(result)
|
||||
// }
|
||||
//
|
||||
// func forceSyncJoinedGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceSyncJoinedGroup()
|
||||
// callBack(result)
|
||||
// }
|
||||
//
|
||||
// func forceSyncJoinedGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceSyncJoinedGroupMember()
|
||||
// callBack(result)
|
||||
// }
|
||||
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||
}
|
||||
|
||||
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[bool: "mute"])
|
||||
}
|
||||
|
||||
func changeGroupMemberMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string:"uid"],methodCall[int:"seconds"])
|
||||
}
|
||||
|
||||
func setGroupMemberNickname(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupMemberNickname(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string:"uid"],methodCall[string:"groupNickname"])
|
||||
}
|
||||
|
||||
func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSearchGroups(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||
}
|
||||
}
|
||||
public class GroupListener: NSObject, Open_im_sdkOnGroupListenerProtocol {
|
||||
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
@@ -126,73 +125,43 @@ public class GroupListener: NSObject, Open_im_sdkOnGroupListenerProtocol {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onApplicationProcessed(_ groupId: String?, opUser: String?, agreeOrReject AgreeOrReject: Int32, opReason: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = groupId
|
||||
values["opUser"] = opUser
|
||||
values["agreeOrReject"] = AgreeOrReject
|
||||
values["opReason"] = opReason
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationAccepted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
// public func onApplicationProcessed(_ s: String?,s1: String?,i: Int?,s2: String?) {
|
||||
// let values: NSMutableDictionary = NSMutableDictionary(capacity: 0)
|
||||
// values.setValue(s, forKey: "groupId")
|
||||
// values.setValue(s1, forKey: "opUser")
|
||||
// values.setValue(i, forKey: "agreeOrReject")
|
||||
// values.setValue(s2, forKey: "opReason")
|
||||
// CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values)
|
||||
// }
|
||||
|
||||
public func onGroupCreated(_ s: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupCreated", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onGroupInfoChanged(_ s: String?, groupInfo s1: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["groupInfo"] = s1
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberEnter(_ s: String?, memberList s1: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["memberList"] = s1
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberEnter", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationRejected(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberInvited(_ s: String?,opUser s1: String?, memberList s2: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["opUser"] = s1
|
||||
values["memberList"] = s2
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberInvited", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberKicked(_ s: String?,opUser s1: String?,memberList s2: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["opUser"] = s1
|
||||
values["memberList"] = s2
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberKicked", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupMemberAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberLeave(_ s: String?,member s1: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["member"] = s1
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberLeave", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupMemberDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onReceiveJoinApplication(_ s: String?,member s1: String?,opReason s2: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["member"] = s1
|
||||
values["opReason"] = s2
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinApplication", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupMemberInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onJoinedGroupAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onJoinedGroupDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// IMManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/28.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -12,86 +5,59 @@ public class IMMananger: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
|
||||
self["initSDK"] = initSDK
|
||||
self["login"] = login
|
||||
self["logout"] = logout
|
||||
self["getLoginStatus"] = getLoginStatus
|
||||
// self["getLoginUid"] = getLoginUid
|
||||
self["getUsersInfo"] = getUsersInfo
|
||||
self["setSelfInfo"] = setSelfInfo
|
||||
self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo
|
||||
// self["forceReConn"] = forceReConn
|
||||
self["wakeUp"] = wakeUp
|
||||
}
|
||||
|
||||
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInitSDK(methodCall.toJsonString(), SDKListener(channel: self.channel))
|
||||
callBack(result)
|
||||
callBack(result,Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
||||
}
|
||||
|
||||
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkLogin(methodCall[string: "uid"], methodCall[string: "token"], BaseCallback(result: result))
|
||||
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"], methodCall[string: "token"])
|
||||
}
|
||||
|
||||
func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkLogout(BaseCallback(result: result))
|
||||
Open_im_sdkLogout(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
callBack(result, Open_im_sdkGetLoginStatus())
|
||||
}
|
||||
|
||||
// func getLoginUid(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// callBack(result, Open_im_sdkGetLoginUser())
|
||||
// }
|
||||
|
||||
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
func wakeUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkWakeUp(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result))
|
||||
}
|
||||
|
||||
func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkForceSyncLoginUerInfo()
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
// func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceReConn()
|
||||
// callBack(result)
|
||||
// }
|
||||
}
|
||||
|
||||
public class SDKListener: NSObject, Open_im_sdkIMSDKListenerProtocol {
|
||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onConnectFailed(_ errCode: Int, errMsg: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
|
||||
public func onConnectFailed(_ errCode: Int32, errMsg: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
|
||||
}
|
||||
|
||||
public func onConnectSuccess() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onConnecting() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnecting", errCode: nil, errMsg: nil, data: nil)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnecting", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onKickedOffline() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onUserTokenExpired() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,21 @@
|
||||
//
|
||||
// MessageManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/29.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class MessageManager: BaseServiceManager {
|
||||
private let KEY_ID: String = "id"
|
||||
private var listeners: [String: AdvancedMsgListener] = [:]
|
||||
// private var listeners: [String: AdvancedMsgListener] = [:]
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
|
||||
self["addAdvancedMsgListener"] = addAdvancedMsgListener
|
||||
self["removeAdvancedMsgListener"] = removeAdvancedMsgListener
|
||||
self["setAdvancedMsgListener"] = setAdvancedMsgListener
|
||||
self["sendMessage"] = sendMessage
|
||||
self["getHistoryMessageList"] = getHistoryMessageList
|
||||
self["revokeMessage"] = revokeMessage
|
||||
self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage
|
||||
self["deleteMessages"] = deleteMessages
|
||||
self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage
|
||||
self["findMessages"] = findMessages
|
||||
self["insertGroupMessageToLocalStorage"] = insertGroupMessageToLocalStorage
|
||||
self["markC2CMessageAsRead"] = markC2CMessageAsRead
|
||||
self["markGroupMessageAsRead"] = markGroupMessageAsRead
|
||||
self["typingStatusUpdate"] = typingStatusUpdate
|
||||
self["createTextMessage"] = createTextMessage
|
||||
self["createTextAtMessage"] = createTextAtMessage
|
||||
@@ -35,219 +26,256 @@ public class MessageManager: BaseServiceManager {
|
||||
self["createVideoMessage"] = createVideoMessage
|
||||
self["createVideoMessageFromFullPath"] = createVideoMessageFromFullPath
|
||||
self["createFileMessage"] = createFileMessage
|
||||
self["createFileMessageFromFullPath"] = createFileMessageFromFullPath
|
||||
self["createMergerMessage"] = createMergerMessage
|
||||
self["createForwardMessage"] = createForwardMessage
|
||||
self["createLocationMessage"] = createLocationMessage
|
||||
self["createCustomMessage"] = createCustomMessage
|
||||
self["createQuoteMessage"] = createQuoteMessage
|
||||
self["createCardMessage"] = createCardMessage
|
||||
self["forceSyncMsg"] = forceSyncMsg
|
||||
self["createFaceMessage"] = createFaceMessage
|
||||
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
||||
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
||||
self["searchLocalMessages"] = searchLocalMessages
|
||||
self["deleteMessageFromLocalAndSvr"] = deleteMessageFromLocalAndSvr
|
||||
self["deleteAllMsgFromLocal"] = deleteAllMsgFromLocal
|
||||
self["deleteAllMsgFromLocalAndSvr"] = deleteAllMsgFromLocalAndSvr
|
||||
self["markMessageAsReadByConID"] = markMessageAsReadByConID
|
||||
self["clearC2CHistoryMessageFromLocalAndSvr"] = clearC2CHistoryMessageFromLocalAndSvr
|
||||
self["clearGroupHistoryMessageFromLocalAndSvr"] = clearGroupHistoryMessageFromLocalAndSvr
|
||||
self["getHistoryMessageListReverse"] = getHistoryMessageListReverse
|
||||
}
|
||||
|
||||
func addAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let key = methodCall[string: KEY_ID]
|
||||
if listeners[key] == nil {
|
||||
let lis = AdvancedMsgListener(channel: channel, id: key)
|
||||
listeners[key] = lis
|
||||
Open_im_sdkAddAdvancedMsgListener(lis)
|
||||
print("=================add msg listener======\n\(lis)")
|
||||
}
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func removeAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let key = methodCall[string: KEY_ID]
|
||||
if let lis = listeners[key] {
|
||||
listeners[key] = nil
|
||||
// Open_im_sdkRemoveAdvancedMsgListener(lis)
|
||||
}
|
||||
Open_im_sdkSetAdvancedMsgListener(lis)
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel)
|
||||
sendMsgProgressListener.setCall(methodCall: methodCall)
|
||||
sendMsgProgressListener.setResult(result: result)
|
||||
print("===============sendMessage===============")
|
||||
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[jsonString: "message"], methodCall[string: "receiver"],
|
||||
methodCall[string: "groupID"], methodCall[bool: "onlineUserOnly"])
|
||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
|
||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
|
||||
}
|
||||
|
||||
func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
// deprecated
|
||||
func deleteMessages(methodCall: FlutterMethodCall, result: FlutterResult){
|
||||
}
|
||||
|
||||
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[jsonString: "message"],
|
||||
methodCall[string: "userID"], methodCall[string: "sender"])
|
||||
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
|
||||
methodCall[string: "receiverID"], methodCall[string: "senderID"])
|
||||
}
|
||||
|
||||
func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"])
|
||||
func insertGroupMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInsertGroupMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
|
||||
methodCall[string: "groupID"], methodCall[string: "senderID"])
|
||||
}
|
||||
|
||||
func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "userID"], methodCall[jsonString: "messageIDList"])
|
||||
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func markGroupMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkGroupMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkTypingStatusUpdate(methodCall[string: "userID"], methodCall[string: "typing"])
|
||||
callBack(result)
|
||||
Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"])
|
||||
}
|
||||
|
||||
func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "text"]))
|
||||
callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "operationID"], methodCall[string: "text"]))
|
||||
}
|
||||
|
||||
func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "text"], methodCall[jsonString: "atUserList"]))
|
||||
callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "operationID"], methodCall[string: "text"],
|
||||
methodCall[jsonString: "atUserIDList"], methodCall[jsonString: "atUserInfoList"], methodCall[jsonString: "quoteMessage"]))
|
||||
}
|
||||
|
||||
func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "imagePath"]))
|
||||
callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "operationID"], methodCall[string: "imagePath"]))
|
||||
}
|
||||
|
||||
func createImageMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "imagePath"]))
|
||||
callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "imagePath"]))
|
||||
}
|
||||
|
||||
func createSoundMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
}
|
||||
|
||||
func createSoundMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
}
|
||||
|
||||
func createVideoMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
}
|
||||
|
||||
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
}
|
||||
|
||||
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateMergerMessage(methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
||||
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
||||
methodCall[jsonString: "summaryList"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createForwardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateForwardMessage(methodCall[jsonString: "message"]))
|
||||
callBack(result, Open_im_sdkCreateForwardMessage(methodCall[string: "operationID"], methodCall[jsonString: "message"]))
|
||||
}
|
||||
|
||||
func createLocationMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "description"],
|
||||
let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "operationID"], methodCall[string: "description"],
|
||||
methodCall[double: "longitude"], methodCall[double: "latitude"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createCustomMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "data"],
|
||||
let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "operationID"], methodCall[string: "data"],
|
||||
methodCall[string: "extension"], methodCall[string: "description"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createQuoteMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"])
|
||||
let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "operationID"], methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateCardMessage(methodCall[jsonString: "cardMessage"]))
|
||||
callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
|
||||
}
|
||||
|
||||
func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkForceSyncMsg()
|
||||
callBack(result)
|
||||
func createFaceMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFaceMessage(methodCall[string: "operationID"], methodCall[int: "index"], methodCall[string: "data"]))
|
||||
}
|
||||
|
||||
public class SendMsgProgressListener: NSObject, Open_im_sdkSendMsgCallBackProtocol {
|
||||
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func searchLocalMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSearchLocalMessages(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "filter"])
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteAllMsgFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteAllMsgFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func markMessageAsReadByConID(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkMarkMessageAsReadByConID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func clearC2CHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearC2CHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func clearGroupHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearGroupHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func getHistoryMessageListReverse(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetHistoryMessageListReverse(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
||||
private let channel: FlutterMethodChannel
|
||||
private var result: FlutterResult?
|
||||
private var call: FlutterMethodCall?
|
||||
private var values: [String: Any] = [:]
|
||||
private let result: FlutterResult
|
||||
private let call: FlutterMethodCall
|
||||
|
||||
init(channel: FlutterMethodChannel) {
|
||||
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
func setResult(result: @escaping FlutterResult){
|
||||
self.result = result
|
||||
}
|
||||
|
||||
func setCall(methodCall: FlutterMethodCall){
|
||||
self.call = methodCall
|
||||
}
|
||||
|
||||
public func onError(_ errCode: Int, errMsg: String?) {
|
||||
print("=================onError============\nerrcode:\(errCode),errMsg:\(errMsg!)")
|
||||
DispatchQueue.main.async { self.result!(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||
public func onError(_ errCode: Int32, errMsg: String?) {
|
||||
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||
}
|
||||
|
||||
public func onProgress(_ progress: Int) {
|
||||
guard let call = call else {
|
||||
return
|
||||
}
|
||||
print("=================onProgress============\nprogress:\(progress)")
|
||||
values["clientMsgID"] = call[string: "clientMsgID"]
|
||||
var values: [String: Any] = [:]
|
||||
let message = call[dict: "message"]
|
||||
values["clientMsgID"] = message["clientMsgID"]
|
||||
values["progress"] = progress
|
||||
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onSuccess(_ data: String?) {
|
||||
print("=================onSuccess============\nsuccess:\(data!)")
|
||||
DispatchQueue.main.async { self.result!(data) }
|
||||
DispatchQueue.main.async { self.result(data) }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class AdvancedMsgListener: NSObject, Open_im_sdkOnAdvancedMsgListenerProtocol {
|
||||
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
|
||||
private let channel: FlutterMethodChannel
|
||||
private var values: [String: Any] = [:]
|
||||
private let id: String
|
||||
|
||||
init(channel: FlutterMethodChannel, id: String) {
|
||||
self.channel = channel
|
||||
values["id"] = id
|
||||
self.id = id
|
||||
}
|
||||
|
||||
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
|
||||
values["haveReadMessage"] = msgReceiptList
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["c2cMessageReadReceipt"] = msgReceiptList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvGroupReadReceipt(_ groupMsgReceiptList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["groupMessageReadReceipt"] = groupMsgReceiptList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvGroupReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvMessageRevoked(_ msgId: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["revokedMessage"] = msgId
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["newMessage"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
86
ios/Classes/Module/SignalingManager.swift
Normal file
@@ -0,0 +1,86 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class SignalingManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setSignalingListener"] = setSignalingListener
|
||||
self["signalingInvite"] = signalingInvite
|
||||
self["signalingInviteInGroup"] = signalingInviteInGroup
|
||||
self["signalingAccept"] = signalingAccept
|
||||
self["signalingReject"] = signalingReject
|
||||
self["signalingCancel"] = signalingCancel
|
||||
self["signalingHungUp"] = signalingHungUp
|
||||
}
|
||||
|
||||
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetSignalingListener(SignalingListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func signalingInvite(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingInvite(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingInviteInGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingInviteInGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingAccept(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingAccept(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingReject(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingReject(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingCancel(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingCancel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingHungUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingHungUp(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
}
|
||||
public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onInvitationCancelled(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInvitationCancelled", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInvitationTimeout(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInvitationTimeout", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeAccepted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeAccepted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeAccepted(byOtherDevice s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeAcceptedByOtherDevice", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeRejected(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeRejected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeRejected(byOtherDevice s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeRejectedByOtherDevice", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onReceiveNewInvitation(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onReceiveNewInvitation", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onHangUp(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onHangUp", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
}
|
||||
43
ios/Classes/Module/UserManager.swift
Normal file
@@ -0,0 +1,43 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class UserManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setUserListener"] = setUserListener
|
||||
self["getUsersInfo"] = getUsersInfo
|
||||
self["setSelfInfo"] = setSelfInfo
|
||||
self["getSelfUserInfo"] = getSelfUserInfo
|
||||
}
|
||||
|
||||
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetUserListener(UserListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetSelfInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||
}
|
||||
}
|
||||
44
ios/Classes/Module/WorkMomentsManager.swift
Normal file
@@ -0,0 +1,44 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class WorkMomentsManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setWorkMomentsListener"] = setWorkMomentsListener
|
||||
self["getWorkMomentsUnReadCount"] = getWorkMomentsUnReadCount
|
||||
self["getWorkMomentsNotification"] = getWorkMomentsNotification
|
||||
self["clearWorkMomentsNotification"] = clearWorkMomentsNotification
|
||||
}
|
||||
|
||||
func setWorkMomentsListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetWorkMomentsListener(WorkMomentsListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func getWorkMomentsUnReadCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetWorkMomentsUnReadCount(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
func clearWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkClearWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class WorkMomentsListener: NSObject, Open_im_sdk_callbackOnWorkMomentsListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onRecvNewNotification() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "workMomentsListener", type: "OnRecvNewNotification", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,12 +2,14 @@ import Flutter
|
||||
import UIKit
|
||||
|
||||
public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
|
||||
let imManager: IMMananger
|
||||
let conversationManager: ConversationManager
|
||||
let friendshipManager: FriendshipManager
|
||||
let messageManager: MessageManager
|
||||
let groupManager: GroupManager
|
||||
let userManger: UserManager
|
||||
let signalingManager: SignalingManager
|
||||
let workMomentsManager: WorkMomentsManager
|
||||
|
||||
init(channel: FlutterMethodChannel) {
|
||||
self.imManager = IMMananger(channel: channel)
|
||||
@@ -15,6 +17,9 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
self.friendshipManager = FriendshipManager(channel: channel)
|
||||
self.messageManager = MessageManager(channel: channel)
|
||||
self.groupManager = GroupManager(channel: channel)
|
||||
self.userManger = UserManager(channel: channel)
|
||||
self.signalingManager = SignalingManager(channel: channel)
|
||||
self.workMomentsManager = WorkMomentsManager(channel: channel)
|
||||
}
|
||||
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
@@ -36,6 +41,12 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
friendshipManager.handleMethod(call: call, result: result)
|
||||
case "groupManager":
|
||||
groupManager.handleMethod(call: call, result: result)
|
||||
case "userManager":
|
||||
userManger.handleMethod(call: call, result: result)
|
||||
case "signalingManager":
|
||||
signalingManager.handleMethod(call: call, result: result)
|
||||
case "workMomentsManager":
|
||||
workMomentsManager.handleMethod(call: call, result: result)
|
||||
default:
|
||||
print("Handle ManagerName Error: \(managerName) not found")
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
// Objective-C API for talking to the following Go packages
|
||||
//
|
||||
// open_im_sdk/open_im_sdk
|
||||
//
|
||||
// File is generated by gomobile bind. Do not edit.
|
||||
#ifndef __OpenIMCore_FRAMEWORK_H__
|
||||
#define __OpenIMCore_FRAMEWORK_H__
|
||||
|
||||
#include "Open_im_sdk.objc.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
#endif
|
||||
@@ -1,29 +0,0 @@
|
||||
// Objective-C API for talking to Go package.
|
||||
// gobind -lang=objc
|
||||
//
|
||||
// File is generated by gobind. Do not edit.
|
||||
|
||||
#ifndef __Universe_H__
|
||||
#define __Universe_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
|
||||
@protocol Universeerror;
|
||||
@class Universeerror;
|
||||
|
||||
@protocol Universeerror <NSObject>
|
||||
- (NSString* _Nonnull)error;
|
||||
@end
|
||||
|
||||
@class Universeerror;
|
||||
|
||||
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (NSString* _Nonnull)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
#ifndef __GO_REF_HDR__
|
||||
#define __GO_REF_HDR__
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
|
||||
// GoSeqRef is an object tagged with an integer for passing back and
|
||||
// forth across the language boundary. A GoSeqRef may represent either
|
||||
// an instance of a Go object, or an Objective-C object passed to Go.
|
||||
// The explicit allocation of a GoSeqRef is used to pin a Go object
|
||||
// when it is passed to Objective-C. The Go seq package maintains a
|
||||
// reference to the Go object in a map keyed by the refnum along with
|
||||
// a reference count. When the reference count reaches zero, the Go
|
||||
// seq package will clear the corresponding entry in the map.
|
||||
@interface GoSeqRef : NSObject {
|
||||
}
|
||||
@property(readonly) int32_t refnum;
|
||||
@property(strong) id obj; // NULL when representing a Go object.
|
||||
|
||||
// new GoSeqRef object to proxy a Go object. The refnum must be
|
||||
// provided from Go side.
|
||||
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
|
||||
|
||||
- (int32_t)incNum;
|
||||
|
||||
@end
|
||||
|
||||
@protocol goSeqRefInterface
|
||||
-(GoSeqRef*) _ref;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,8 +0,0 @@
|
||||
framework module "OpenIMCore" {
|
||||
header "ref.h"
|
||||
header "Open_im_sdk.objc.h"
|
||||
header "Universe.objc.h"
|
||||
header "OpenIMCore.h"
|
||||
|
||||
export *
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<?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>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -17,7 +17,9 @@ A new Flutter project.
|
||||
s.dependency 'Flutter'
|
||||
s.platform = :ios, '8.0'
|
||||
|
||||
s.vendored_frameworks = 'Framework/*.framework'
|
||||
s.dependency 'OpenIMSDKCore','2.0.8'
|
||||
s.static_framework = true
|
||||
# s.vendored_frameworks = 'Framework/*.framework'
|
||||
# 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'
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
library flutter_openim_sdk;
|
||||
|
||||
export 'src/enum/conversation_type.dart';
|
||||
export 'src/enum/group_role.dart';
|
||||
export 'src/enum/group_at_type.dart';
|
||||
export 'src/enum/group_role_level.dart';
|
||||
export 'src/enum/im_platform.dart';
|
||||
export 'src/enum/listener_type.dart';
|
||||
export 'src/enum/message_status.dart';
|
||||
export 'src/enum/message_type.dart';
|
||||
export 'src/listener/advanced_msg_listener.dart';
|
||||
export 'src/listener/connect_listener.dart';
|
||||
export 'src/listener/conversation_listener.dart';
|
||||
export 'src/listener/friendship_listener.dart';
|
||||
export 'src/listener/group_listener.dart';
|
||||
export 'src/listener/impl/advanced_msg_listener.dart';
|
||||
export 'src/listener/impl/conversation_listener.dart';
|
||||
export 'src/listener/impl/friendship_listener.dart';
|
||||
export 'src/listener/impl/group_listener.dart';
|
||||
export 'src/listener/impl/init_sdk_listener.dart';
|
||||
export 'src/listener/impl/msg_send_progress_listener.dart';
|
||||
export 'src/listener/init_sdk_listener.dart';
|
||||
export 'src/listener/msg_send_progress_listener.dart';
|
||||
export 'src/listener/signaling_listener.dart';
|
||||
export 'src/listener/user_listener.dart';
|
||||
export 'src/listener/workmoments_listener.dart';
|
||||
export 'src/manager/im_conversation_manager.dart';
|
||||
export 'src/manager/im_friendship_manager.dart';
|
||||
export 'src/manager/im_group_manager.dart';
|
||||
@@ -25,9 +23,15 @@ export 'src/manager/im_manager.dart';
|
||||
export 'src/manager/im_message_manager.dart';
|
||||
export 'src/manager/im_offline_push_manager.dart';
|
||||
export 'src/manager/im_signaling_manager.dart';
|
||||
export 'src/manager/v2/im_message_manager_v2.dart';
|
||||
export 'src/manager/im_user_manager.dart';
|
||||
export 'src/manager/im_workmoments_manager.dart';
|
||||
export 'src/models/conversation_info.dart';
|
||||
export 'src/models/group_info.dart';
|
||||
export 'src/models/message.dart';
|
||||
export 'src/models/notification_info.dart';
|
||||
export 'src/models/search_info.dart';
|
||||
export 'src/models/signaling_info.dart';
|
||||
export 'src/models/user_info.dart';
|
||||
export 'src/models/workmoments_info.dart';
|
||||
export 'src/openim.dart';
|
||||
export 'src/utils.dart';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class ConversationType {
|
||||
static const single_chat = 1;
|
||||
static const group_chat = 2;
|
||||
static const single = 1;
|
||||
static const group = 2;
|
||||
static const notification = 4;
|
||||
}
|
||||
|
||||
6
lib/src/enum/group_at_type.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
class GroupAtType {
|
||||
static const atNormal = 0;
|
||||
static const atMe = 1;
|
||||
static const atAll = 2;
|
||||
static const atAllAtMe = 3;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
class GroupRole {
|
||||
static const member = 0;
|
||||
static const owner = 1;
|
||||
static const admin = 2;
|
||||
}
|
||||
7
lib/src/enum/group_role_level.dart
Normal file
@@ -0,0 +1,7 @@
|
||||
/// 1 ordinary member, 2 group owners, 3 administrators
|
||||
/// 1普通成员, 2群主,3管理员
|
||||
class GroupRoleLevel {
|
||||
static const member = 1;
|
||||
static const owner = 2;
|
||||
static const admin = 3;
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
class ListenerType {
|
||||
static const simpleMsgListener = 'simpleMsgListener';
|
||||
static const initSDKListener = 'initSDKListener';
|
||||
static const groupListener = 'groupListener';
|
||||
static const advancedMsgListener = 'advancedMsgListener';
|
||||
static const conversationListener = 'conversationListener';
|
||||
static const friendListener = 'friendListener';
|
||||
static const signalingListener = 'signalingListener';
|
||||
static const msgSendProgressListener = "msgSendProgressListener";
|
||||
static final simpleMsgListener = 'simpleMsgListener';
|
||||
static final connectListener = 'connectListener';
|
||||
static final userListener = 'userListener';
|
||||
static final groupListener = 'groupListener';
|
||||
static final advancedMsgListener = 'advancedMsgListener';
|
||||
static final conversationListener = 'conversationListener';
|
||||
static final friendListener = 'friendListener';
|
||||
static final signalingListener = 'signalingListener';
|
||||
static final msgSendProgressListener = "msgSendProgressListener";
|
||||
static final workMomentsListener = "workMomentsListener";
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ class MessageType {
|
||||
static const file = 105;
|
||||
static const at_text = 106;
|
||||
static const merger = 107;
|
||||
// static const forward = 108;
|
||||
static const card = 108;
|
||||
static const location = 109;
|
||||
static const custom = 110;
|
||||
@@ -15,26 +14,55 @@ class MessageType {
|
||||
static const has_read_receipt = 112;
|
||||
static const typing = 113;
|
||||
static const quote = 114;
|
||||
static const custom_face = 115;
|
||||
|
||||
///
|
||||
static const accept_friend = 201;
|
||||
static const add_friend = 202;
|
||||
static const refuse_friend_application = 203;
|
||||
static const set_self_info = 204;
|
||||
static const revoke_message = 205;
|
||||
static const c2c_message_as_read = 206;
|
||||
static const notificationBegin = 1000;
|
||||
|
||||
static const kick_online = 303;
|
||||
static const friendNotificationBegin = 1200;
|
||||
static const friendApplicationApprovedNotification = 1201;
|
||||
static const friendApplicationRejectedNotification = 1202;
|
||||
static const friendApplicationNotification = 1203;
|
||||
static const friendAddedNotification = 1204;
|
||||
static const friendDeletedNotification = 1205;
|
||||
static const friendRemarkSetNotification = 1206;
|
||||
static const blackAddedNotification = 1207;
|
||||
static const blackDeletedNotification = 1208;
|
||||
static const friendNotificationEnd = 1299;
|
||||
|
||||
///
|
||||
static const transfer_group_owner = 501;
|
||||
static const create_group = 502;
|
||||
// static const create_group = 503;
|
||||
static const join_group = 504;
|
||||
static const quit_group = 505;
|
||||
static const set_group_info = 506;
|
||||
static const accept_group_application = 507;
|
||||
static const refuse_group_application = 508;
|
||||
static const kick_group_member = 509;
|
||||
static const invited_user_to_group = 510;
|
||||
static const conversationChangeNotification = 1300;
|
||||
|
||||
static const userNotificationBegin = 1301;
|
||||
static const userInfoUpdatedNotification = 1303;
|
||||
static const userNotificationEnd = 1399;
|
||||
|
||||
static const oaNotification = 1400;
|
||||
|
||||
static const groupNotificationBegin = 1500;
|
||||
static const groupCreatedNotification = 1501;
|
||||
static const groupInfoSetNotification = 1502;
|
||||
static const joinGroupApplicationNotification = 1503;
|
||||
static const memberQuitNotification = 1504;
|
||||
static const groupApplicationAcceptedNotification = 1505;
|
||||
static const groupApplicationRejectedNotification = 1506;
|
||||
static const groupOwnerTransferredNotification = 1507;
|
||||
static const memberKickedNotification = 1508;
|
||||
static const memberInvitedNotification = 1509;
|
||||
static const memberEnterNotification = 1510;
|
||||
static const dismissGroupNotification = 1511;
|
||||
static const groupNotificationEnd = 1599;
|
||||
|
||||
static const groupMemberMutedNotification = 1512;
|
||||
static const groupMemberCancelMutedNotification = 1513;
|
||||
static const groupMutedNotification = 1514;
|
||||
static const groupCancelMutedNotification = 1515;
|
||||
static const groupMemberInfoChangedNotification = 1516;
|
||||
|
||||
static const signalingNotificationBegin = 1600;
|
||||
static const signalingNotification = 1601;
|
||||
static const signalingNotificationEnd = 1699;
|
||||
|
||||
static const burnAfterReadingNotification = 1701;
|
||||
|
||||
static const notificationEnd = 2000;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,40 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class AdvancedMsgListener {
|
||||
/// Uniquely identifies
|
||||
final String id;
|
||||
class OnAdvancedMsgListener {
|
||||
/// Message read receipt
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CMessageReadReceipt;
|
||||
|
||||
AdvancedMsgListener() : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
|
||||
|
||||
/// A friend revoked a message
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
|
||||
/// Receive new message
|
||||
void recvNewMessage(Message msg);
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
|
||||
/// Message read receipt
|
||||
void recvC2CReadReceipt(List<HaveReadInfo> list);
|
||||
/// Uniquely identifies
|
||||
String id;
|
||||
|
||||
/// A friend withdrew a message
|
||||
void recvMessageRevoked(String msgId);
|
||||
OnAdvancedMsgListener({
|
||||
this.onRecvC2CMessageReadReceipt,
|
||||
this.onRecvGroupMessageReadReceipt,
|
||||
this.onRecvMessageRevoked,
|
||||
this.onRecvNewMessage,
|
||||
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
|
||||
void recvC2CMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvC2CMessageReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
void recvGroupMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvGroupMessageReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
void recvMessageRevoked(String msgId) {
|
||||
onRecvMessageRevoked?.call(msgId);
|
||||
}
|
||||
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,45 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnInitSDKListener extends InitSDKListener {
|
||||
class OnConnectListener {
|
||||
/// SDK failed to connect to the server
|
||||
Function(int? code, String? errorMsg)? onConnectFailed;
|
||||
|
||||
/// SDK has successfully connected to the server
|
||||
Function()? onConnectSuccess;
|
||||
|
||||
/// SDK is connecting to the server
|
||||
Function()? onConnecting;
|
||||
|
||||
/// The current user is kicked offline.
|
||||
/// At this time, the UI can prompt the user and call IMManager's login() function to log in again.
|
||||
Function()? onKickedOffline;
|
||||
Function(UserInfo info)? onSelfInfoUpdated;
|
||||
|
||||
/// Ticket expired when online.
|
||||
/// At this time, you need to generate a new userSig and call IMManager's login() function to log in again
|
||||
Function()? onUserSigExpired;
|
||||
|
||||
OnInitSDKListener({
|
||||
OnConnectListener({
|
||||
this.onConnectFailed,
|
||||
this.onConnectSuccess,
|
||||
this.onConnecting,
|
||||
this.onKickedOffline,
|
||||
this.onSelfInfoUpdated,
|
||||
this.onUserSigExpired,
|
||||
});
|
||||
|
||||
@override
|
||||
void connectFailed(int? code, String? errorMsg) {
|
||||
if (null != onConnectFailed) onConnectFailed!(code, errorMsg);
|
||||
}
|
||||
|
||||
@override
|
||||
void connectSuccess() {
|
||||
if (null != onConnectSuccess) onConnectSuccess!();
|
||||
}
|
||||
|
||||
@override
|
||||
void connecting() {
|
||||
if (null != onConnecting) onConnecting!.call();
|
||||
}
|
||||
|
||||
@override
|
||||
void kickedOffline() {
|
||||
if (null != onKickedOffline) onKickedOffline!();
|
||||
}
|
||||
|
||||
@override
|
||||
void selfInfoUpdated(UserInfo info) {
|
||||
if (null != onSelfInfoUpdated) onSelfInfoUpdated!(info);
|
||||
}
|
||||
|
||||
@override
|
||||
void userSigExpired() {
|
||||
if (null != onUserSigExpired) onUserSigExpired!();
|
||||
}
|
||||
@@ -1,15 +1,44 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class ConversationListener {
|
||||
void conversationChanged(List<ConversationInfo> list);
|
||||
class OnConversationListener {
|
||||
Function(List<ConversationInfo> list)? onConversationChanged;
|
||||
Function(List<ConversationInfo> list)? onNewConversation;
|
||||
Function(int count)? onTotalUnreadMessageCountChanged;
|
||||
Function()? onSyncServerFailed;
|
||||
Function()? onSyncServerFinish;
|
||||
Function()? onSyncServerStart;
|
||||
|
||||
void newConversation(List<ConversationInfo> list);
|
||||
OnConversationListener({
|
||||
this.onConversationChanged,
|
||||
this.onNewConversation,
|
||||
this.onTotalUnreadMessageCountChanged,
|
||||
this.onSyncServerFailed,
|
||||
this.onSyncServerFinish,
|
||||
this.onSyncServerStart,
|
||||
});
|
||||
|
||||
void syncServerFailed();
|
||||
void conversationChanged(List<ConversationInfo> list) {
|
||||
if (onConversationChanged != null) onConversationChanged!(list);
|
||||
}
|
||||
|
||||
void syncServerFinish();
|
||||
void newConversation(List<ConversationInfo> list) {
|
||||
if (onNewConversation != null) onNewConversation!(list);
|
||||
}
|
||||
|
||||
void syncServerStart();
|
||||
void syncServerFailed() {
|
||||
if (onSyncServerFailed != null) onSyncServerFailed!();
|
||||
}
|
||||
|
||||
void totalUnreadMessageCountChanged(int i);
|
||||
void syncServerFinish() {
|
||||
if (onSyncServerFinish != null) onSyncServerFinish!();
|
||||
}
|
||||
|
||||
void syncServerStart() {
|
||||
if (onSyncServerStart != null) onSyncServerStart!();
|
||||
}
|
||||
|
||||
void totalUnreadMessageCountChanged(int i) {
|
||||
if (onTotalUnreadMessageCountChanged != null)
|
||||
onTotalUnreadMessageCountChanged!(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,61 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class FriendshipListener {
|
||||
void blackListAdd(UserInfo u);
|
||||
class OnFriendshipListener {
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationRejected;
|
||||
Function(FriendInfo i)? onFriendAdded;
|
||||
Function(FriendInfo i)? onFriendDeleted;
|
||||
Function(FriendInfo i)? onFriendInfoChanged;
|
||||
Function(BlacklistInfo i)? onBlacklistAdded;
|
||||
Function(BlacklistInfo i)? onBlacklistDeleted;
|
||||
|
||||
void blackListDeleted(UserInfo u);
|
||||
OnFriendshipListener({
|
||||
this.onBlacklistAdded,
|
||||
this.onBlacklistDeleted,
|
||||
this.onFriendAdded,
|
||||
this.onFriendApplicationAccepted,
|
||||
this.onFriendApplicationAdded,
|
||||
this.onFriendApplicationDeleted,
|
||||
this.onFriendApplicationRejected,
|
||||
this.onFriendDeleted,
|
||||
this.onFriendInfoChanged,
|
||||
});
|
||||
|
||||
void friendApplicationListAccept(UserInfo u);
|
||||
void blacklistAdded(BlacklistInfo u) {
|
||||
onBlacklistAdded?.call(u);
|
||||
}
|
||||
|
||||
void friendApplicationListAdded(UserInfo u);
|
||||
void blacklistDeleted(BlacklistInfo u) {
|
||||
onBlacklistDeleted?.call(u);
|
||||
}
|
||||
|
||||
void friendApplicationListDeleted(UserInfo u);
|
||||
void friendAdded(FriendInfo u) {
|
||||
onFriendAdded?.call(u);
|
||||
}
|
||||
|
||||
void friendApplicationListReject(UserInfo u);
|
||||
void friendApplicationAccepted(FriendApplicationInfo u) {
|
||||
onFriendApplicationAccepted?.call(u);
|
||||
}
|
||||
|
||||
void friendInfoChanged(UserInfo u);
|
||||
void friendApplicationAdded(FriendApplicationInfo u) {
|
||||
onFriendApplicationAdded?.call(u);
|
||||
}
|
||||
|
||||
void friendListAdded(UserInfo u);
|
||||
void friendApplicationDeleted(FriendApplicationInfo u) {
|
||||
onFriendApplicationDeleted?.call(u);
|
||||
}
|
||||
|
||||
void friendListDeleted(UserInfo u);
|
||||
void friendApplicationRejected(FriendApplicationInfo u) {
|
||||
onFriendApplicationRejected?.call(u);
|
||||
}
|
||||
|
||||
void friendDeleted(FriendInfo u) {
|
||||
onFriendDeleted?.call(u);
|
||||
}
|
||||
|
||||
void friendInfoChanged(FriendInfo u) {
|
||||
onFriendInfoChanged?.call(u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,67 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class GroupListener {
|
||||
void memberEnter(String groupId, List<GroupMembersInfo> list);
|
||||
class OnGroupListener {
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationDeleted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationRejected;
|
||||
Function(GroupInfo info)? onGroupInfoChanged;
|
||||
Function(GroupMembersInfo info)? onGroupMemberAdded;
|
||||
Function(GroupMembersInfo info)? onGroupMemberDeleted;
|
||||
Function(GroupMembersInfo info)? onGroupMemberInfoChanged;
|
||||
Function(GroupInfo info)? onJoinedGroupAdded;
|
||||
Function(GroupInfo info)? onJoinedGroupDeleted;
|
||||
|
||||
void memberLeave(String groupId, GroupMembersInfo info);
|
||||
OnGroupListener({
|
||||
this.onGroupApplicationAccepted,
|
||||
this.onGroupApplicationAdded,
|
||||
this.onGroupApplicationDeleted,
|
||||
this.onGroupApplicationRejected,
|
||||
this.onGroupInfoChanged,
|
||||
this.onGroupMemberAdded,
|
||||
this.onGroupMemberDeleted,
|
||||
this.onGroupMemberInfoChanged,
|
||||
this.onJoinedGroupAdded,
|
||||
this.onJoinedGroupDeleted,
|
||||
});
|
||||
|
||||
void memberInvited(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list);
|
||||
void groupApplicationAccepted(GroupApplicationInfo info) {
|
||||
onGroupApplicationAccepted?.call(info);
|
||||
}
|
||||
|
||||
void memberKicked(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list);
|
||||
void groupApplicationAdded(GroupApplicationInfo info) {
|
||||
onGroupApplicationAdded?.call(info);
|
||||
}
|
||||
|
||||
void groupCreated(String groupId);
|
||||
void groupApplicationDeleted(GroupApplicationInfo info) {
|
||||
onGroupApplicationDeleted?.call(info);
|
||||
}
|
||||
|
||||
void groupInfoChanged(String groupId, GroupInfo info);
|
||||
void groupApplicationRejected(GroupApplicationInfo info) {
|
||||
onGroupApplicationRejected?.call(info);
|
||||
}
|
||||
|
||||
void receiveJoinApplication(
|
||||
String groupId, GroupMembersInfo info, String opReason);
|
||||
void groupInfoChanged(GroupInfo info) {
|
||||
onGroupInfoChanged?.call(info);
|
||||
}
|
||||
|
||||
void applicationProcessed(String groupId, GroupMembersInfo opUser,
|
||||
int agreeOrReject, String opReason);
|
||||
void groupMemberAdded(GroupMembersInfo info) {
|
||||
onGroupMemberAdded?.call(info);
|
||||
}
|
||||
|
||||
void groupMemberDeleted(GroupMembersInfo info) {
|
||||
onGroupMemberDeleted?.call(info);
|
||||
}
|
||||
|
||||
void groupMemberInfoChanged(GroupMembersInfo info) {
|
||||
onGroupMemberInfoChanged?.call(info);
|
||||
}
|
||||
|
||||
void joinedGroupAdded(GroupInfo info) {
|
||||
onJoinedGroupAdded?.call(info);
|
||||
}
|
||||
|
||||
void joinedGroupDeleted(GroupInfo info) {
|
||||
onJoinedGroupDeleted?.call(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnAdvancedMsgListener extends AdvancedMsgListener {
|
||||
Function(List<HaveReadInfo> list)? onRecvC2CReadReceipt;
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
|
||||
OnAdvancedMsgListener({
|
||||
this.onRecvC2CReadReceipt,
|
||||
this.onRecvMessageRevoked,
|
||||
this.onRecvNewMessage,
|
||||
});
|
||||
|
||||
@override
|
||||
void recvC2CReadReceipt(List<HaveReadInfo> list) {
|
||||
if (null != onRecvC2CReadReceipt) onRecvC2CReadReceipt!(list);
|
||||
}
|
||||
|
||||
@override
|
||||
void recvMessageRevoked(String msgId) {
|
||||
if (null != onRecvMessageRevoked) onRecvMessageRevoked!(msgId);
|
||||
}
|
||||
|
||||
@override
|
||||
void recvNewMessage(Message msg) {
|
||||
if (null != onRecvNewMessage) onRecvNewMessage!(msg);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnConversationListener extends ConversationListener {
|
||||
Function(List<ConversationInfo> list)? onConversationChanged;
|
||||
Function(List<ConversationInfo> list)? onNewConversation;
|
||||
Function(int count)? onTotalUnreadMessageCountChanged;
|
||||
Function()? onSyncServerFailed;
|
||||
Function()? onSyncServerFinish;
|
||||
Function()? onSyncServerStart;
|
||||
|
||||
OnConversationListener({
|
||||
this.onConversationChanged,
|
||||
this.onNewConversation,
|
||||
this.onTotalUnreadMessageCountChanged,
|
||||
this.onSyncServerFailed,
|
||||
this.onSyncServerFinish,
|
||||
this.onSyncServerStart,
|
||||
});
|
||||
|
||||
@override
|
||||
void conversationChanged(List<ConversationInfo> list) {
|
||||
if (onConversationChanged != null) onConversationChanged!(list);
|
||||
}
|
||||
|
||||
@override
|
||||
void newConversation(List<ConversationInfo> list) {
|
||||
if (onNewConversation != null) onNewConversation!(list);
|
||||
}
|
||||
|
||||
@override
|
||||
void syncServerFailed() {
|
||||
if (onSyncServerFailed != null) onSyncServerFailed!();
|
||||
}
|
||||
|
||||
@override
|
||||
void syncServerFinish() {
|
||||
if (onSyncServerFinish != null) onSyncServerFinish!();
|
||||
}
|
||||
|
||||
@override
|
||||
void syncServerStart() {
|
||||
if (onSyncServerStart != null) onSyncServerStart!();
|
||||
}
|
||||
|
||||
@override
|
||||
void totalUnreadMessageCountChanged(int i) {
|
||||
if (onTotalUnreadMessageCountChanged != null)
|
||||
onTotalUnreadMessageCountChanged!(i);
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnFriendshipListener extends FriendshipListener {
|
||||
Function(UserInfo u)? onBlackListAdd;
|
||||
Function(UserInfo u)? onBlackListDeleted;
|
||||
Function(UserInfo u)? onFriendApplicationListAccept;
|
||||
Function(UserInfo u)? onFriendApplicationListAdded;
|
||||
Function(UserInfo u)? onFriendApplicationListDeleted;
|
||||
Function(UserInfo u)? onFriendApplicationListReject;
|
||||
Function(UserInfo u)? onFriendInfoChanged;
|
||||
Function(UserInfo u)? onFriendListAdded;
|
||||
Function(UserInfo u)? onFriendListDeleted;
|
||||
|
||||
OnFriendshipListener({
|
||||
this.onBlackListAdd,
|
||||
this.onBlackListDeleted,
|
||||
this.onFriendApplicationListAccept,
|
||||
this.onFriendApplicationListAdded,
|
||||
this.onFriendApplicationListDeleted,
|
||||
this.onFriendApplicationListReject,
|
||||
this.onFriendInfoChanged,
|
||||
this.onFriendListAdded,
|
||||
this.onFriendListDeleted,
|
||||
});
|
||||
|
||||
@override
|
||||
void blackListAdd(UserInfo u) {
|
||||
if (null != onBlackListAdd) onBlackListAdd!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void blackListDeleted(UserInfo u) {
|
||||
if (null != onBlackListDeleted) onBlackListDeleted!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListAccept(UserInfo u) {
|
||||
if (null != onFriendApplicationListAccept)
|
||||
onFriendApplicationListAccept!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListAdded(UserInfo u) {
|
||||
if (null != onFriendApplicationListAdded) onFriendApplicationListAdded!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListDeleted(UserInfo u) {
|
||||
if (null != onFriendApplicationListDeleted)
|
||||
onFriendApplicationListDeleted!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListReject(UserInfo u) {
|
||||
if (null != onFriendApplicationListReject)
|
||||
onFriendApplicationListReject!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendInfoChanged(UserInfo u) {
|
||||
if (null != onFriendInfoChanged) onFriendInfoChanged!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendListAdded(UserInfo u) {
|
||||
if (null != onFriendListAdded) onFriendListAdded!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendListDeleted(UserInfo u) {
|
||||
if (null != onFriendListDeleted) onFriendListDeleted!(u);
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnGroupListener extends GroupListener {
|
||||
Function(String groupId, GroupMembersInfo opUser, int agreeOrReject,
|
||||
String opReason)? onApplicationProcessed;
|
||||
Function(String groupId)? onGroupCreated;
|
||||
Function(String groupId, GroupInfo info)? onGroupInfoChanged;
|
||||
Function(String groupId, List<GroupMembersInfo> list)? onMemberEnter;
|
||||
Function(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)?
|
||||
onMemberInvited;
|
||||
Function(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)?
|
||||
onMemberKicked;
|
||||
Function(String groupId, GroupMembersInfo info)? onMemberLeave;
|
||||
Function(String groupId, GroupMembersInfo info, String opReason)?
|
||||
onReceiveJoinApplication;
|
||||
|
||||
OnGroupListener({
|
||||
this.onApplicationProcessed,
|
||||
this.onGroupCreated,
|
||||
this.onGroupInfoChanged,
|
||||
this.onMemberEnter,
|
||||
this.onMemberInvited,
|
||||
this.onMemberKicked,
|
||||
this.onMemberLeave,
|
||||
this.onReceiveJoinApplication,
|
||||
});
|
||||
|
||||
@override
|
||||
void applicationProcessed(String groupId, GroupMembersInfo opUser,
|
||||
int agreeOrReject, String opReason) {
|
||||
if (null != onApplicationProcessed)
|
||||
onApplicationProcessed!(groupId, opUser, agreeOrReject, opReason);
|
||||
}
|
||||
|
||||
@override
|
||||
void groupCreated(String groupId) {
|
||||
if (null != onGroupCreated) onGroupCreated!(groupId);
|
||||
}
|
||||
|
||||
@override
|
||||
void groupInfoChanged(String groupId, GroupInfo info) {
|
||||
if (null != onGroupInfoChanged) onGroupInfoChanged!(groupId, info);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberEnter(String groupId, List<GroupMembersInfo> list) {
|
||||
if (null != onMemberEnter) onMemberEnter!(groupId, list);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberInvited(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) {
|
||||
if (null != onMemberInvited) onMemberInvited!(groupId, opUser, list);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberKicked(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) {
|
||||
if (null != onMemberKicked) onMemberKicked!(groupId, opUser, list);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberLeave(String groupId, GroupMembersInfo info) {
|
||||
if (null != onMemberLeave) onMemberLeave!(groupId, info);
|
||||
}
|
||||
|
||||
@override
|
||||
void receiveJoinApplication(
|
||||
String groupId, GroupMembersInfo info, String opReason) {
|
||||
if (null != onReceiveJoinApplication)
|
||||
onReceiveJoinApplication!(groupId, info, opReason);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnMsgSendProgressListener extends MsgSendProgressListener {
|
||||
Function(String msgID, int progress)? onProgress;
|
||||
|
||||
OnMsgSendProgressListener({this.onProgress});
|
||||
|
||||
void progress(String msgID, int progress) {
|
||||
if (null != onProgress) onProgress!(msgID, progress);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class InitSDKListener {
|
||||
/// SDK is connecting to the server
|
||||
void connecting();
|
||||
|
||||
/// SDK has successfully connected to the server
|
||||
void connectSuccess();
|
||||
|
||||
/// SDK failed to connect to the server
|
||||
void connectFailed(int? code, String? errorMsg);
|
||||
|
||||
/// The current user is kicked offline.
|
||||
/// At this time, the UI can prompt the user and call IMManager's login() function to log in again.
|
||||
void kickedOffline();
|
||||
|
||||
/// Ticket expired when online.
|
||||
/// At this time, you need to generate a new userSig and call IMManager's login() function to log in again
|
||||
void userSigExpired();
|
||||
|
||||
/// The information of the logged-in user has been updated
|
||||
void selfInfoUpdated(UserInfo info);
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
abstract class MsgSendProgressListener {
|
||||
void progress(String msgID, int progress);
|
||||
class OnMsgSendProgressListener {
|
||||
Function(String clientMsgID, int progress)? onProgress;
|
||||
|
||||
OnMsgSendProgressListener({this.onProgress});
|
||||
|
||||
void progress(String clientMsgID, int progress) {
|
||||
if (null != onProgress) onProgress!(clientMsgID, progress);
|
||||
}
|
||||
}
|
||||
|
||||