Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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>
|
||||||
54
CHANGELOG.md
@@ -1,7 +1,61 @@
|
|||||||
|
## 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
|
## 1.0.0
|
||||||
|
|
||||||
Fix bug
|
Fix bug
|
||||||
|
|
||||||
## 0.0.9+5
|
## 0.0.9+5
|
||||||
|
|
||||||
1. Android upgrade sdk to 0.0.17 </br>
|
1. Android upgrade sdk to 0.0.17 </br>
|
||||||
2. New add createFileMessageFromFullPath method
|
2. New add createFileMessageFromFullPath method
|
||||||
|
|
||||||
|
|||||||
275
README.md
@@ -1,25 +1,24 @@
|
|||||||
# flutter_openim_sdk
|
# 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)
|
||||||
|
|
||||||
[](README.zh-cn.md)
|
#### [demo](https://github.com/OpenIMSDK/Open-IM-Flutter-Demo.git) | [widget](https://github.com/hrxiang/flutter_openim_widget.git)
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
A flutter IM plugin for android and ios.
|
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
|
||||||
#### 1,Add dependency in yaml
|
#### 1,Add dependency in yaml
|
||||||
|
|
||||||
flutter_openim_sdk: ^1.0.0
|
flutter_openim_sdk: latest
|
||||||
|
|
||||||
#### 2,Import package
|
#### 2,Import package
|
||||||
|
|
||||||
@@ -31,65 +30,65 @@ A flutter IM plugin for android and ios.
|
|||||||
// Initialize SDK
|
// Initialize SDK
|
||||||
OpenIM.iMManager
|
OpenIM.iMManager
|
||||||
..initSDK(
|
..initSDK(
|
||||||
platform: IMPlatform.ios,
|
platform: Platform.isAndroid ? IMPlatform.android : IMPlatform.ios,
|
||||||
ipApi: 'Api interface address',
|
ipApi: '',
|
||||||
ipWs: 'WebSocket address',
|
ipWs: '',
|
||||||
dbPath: 'Database directory',
|
dbPath: '',
|
||||||
listener: OnInitSDKListener(
|
listener: OnInitSDKListener(
|
||||||
connecting: () {},
|
onConnecting: () {},
|
||||||
connectFailed: (code, error) {},
|
onConnectFailed: (code, error) {},
|
||||||
connectSuccess: () {},
|
onConnectSuccess: () {},
|
||||||
kickedOffline: () {},
|
onKickedOffline: () {},
|
||||||
userSigExpired: () {},
|
onUserSigExpired: () {},
|
||||||
selfInfoUpdated: (user) {},
|
onSelfInfoUpdated: (user) {},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add message listener (remove when not in use)
|
// Add message listener (remove when not in use)
|
||||||
..messageManager.addAdvancedMsgListener(OnAdvancedMsgListener(
|
..messageManager.addAdvancedMsgListener(OnAdvancedMsgListener(
|
||||||
recvMessageRevoked: (id) {},
|
onRecvMessageRevoked: (msgId) {},
|
||||||
recvC2CReadReceipt: (list) {},
|
onRecvC2CReadReceipt: (list) {},
|
||||||
recvNewMessage: (msg) {},
|
onRecvNewMessage: (msg) {},
|
||||||
))
|
))
|
||||||
|
|
||||||
// Set up message sending progress listener
|
// Set up message sending progress listener
|
||||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
||||||
progressCallback: (id, progress) {},
|
onProgress: (msgId, progress) {},
|
||||||
))
|
))
|
||||||
|
|
||||||
// Set up friend relationship listener
|
// Set up friend relationship listener
|
||||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
||||||
blackListAdd: (u) {},
|
onBlackListAdd: (u) {},
|
||||||
blackListDeleted: (u) {},
|
onBlackListDeleted: (u) {},
|
||||||
friendApplicationListAccept: (u) {},
|
onFriendApplicationListAccept: (u) {},
|
||||||
friendApplicationListAdded: (u) {},
|
onFriendApplicationListAdded: (u) {},
|
||||||
friendApplicationListDeleted: (u) {},
|
onFriendApplicationListDeleted: (u) {},
|
||||||
friendApplicationListReject: (u) {},
|
onFriendApplicationListReject: (u) {},
|
||||||
friendInfoChanged: (u) {},
|
onFriendInfoChanged: (u) {},
|
||||||
friendListAdded: (u) {},
|
onFriendListAdded: (u) {},
|
||||||
friendListDeleted: (u) {},
|
onFriendListDeleted: (u) {},
|
||||||
))
|
))
|
||||||
|
|
||||||
// Set up conversation listener
|
// Set up conversation listener
|
||||||
..conversationManager.setConversationListener(OnConversationListener(
|
..conversationManager.setConversationListener(OnConversationListener(
|
||||||
conversationChanged: (list) {},
|
onConversationChanged: (list) {},
|
||||||
newConversation: (list) {},
|
onNewConversation: (list) {},
|
||||||
totalUnreadMsgCountChanged: (count) {},
|
onTotalUnreadMessageCountChanged: (count) {},
|
||||||
syncServerFailed: () {},
|
onSyncServerFailed: () {},
|
||||||
syncServerFinish: () {},
|
onSyncServerFinish: () {},
|
||||||
syncServerStart: () {},
|
onSyncServerStart: () {},
|
||||||
))
|
))
|
||||||
|
|
||||||
// Set up group listener
|
// Set up group listener
|
||||||
..groupManager.setGroupListener(OnGroupListener(
|
..groupManager.setGroupListener(OnGroupListener(
|
||||||
applicationProcessed: (groupId, opUser, agreeOrReject, opReason) {},
|
onApplicationProcessed: (groupId, opUser, agreeOrReject, opReason) {},
|
||||||
groupCreated: (groupId) {},
|
onGroupCreated: (groupId) {},
|
||||||
groupInfoChanged: (groupId, info) {},
|
onGroupInfoChanged: (groupId, info) {},
|
||||||
memberEnter: (groupId, list) {},
|
onMemberEnter: (groupId, list) {},
|
||||||
memberInvited: (groupId, opUser, list) {},
|
onMemberInvited: (groupId, opUser, list) {},
|
||||||
memberKicked: (groupId, opUser, list) {},
|
onMemberKicked: (groupId, opUser, list) {},
|
||||||
memberLeave: (groupId, info) {},
|
onMemberLeave: (groupId, info) {},
|
||||||
receiveJoinApplication: (groupId, info, opReason) {},
|
onReceiveJoinApplication: (groupId, info, opReason) {},
|
||||||
));
|
));
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -97,7 +96,7 @@ A flutter IM plugin for android and ios.
|
|||||||
|
|
||||||
```
|
```
|
||||||
OpenIM.iMManager.login(uid: uid, token: token).then((value){
|
OpenIM.iMManager.login(uid: uid, token: token).then((value){
|
||||||
// login successful
|
// login success
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -105,40 +104,18 @@ A flutter IM plugin for android and ios.
|
|||||||
|
|
||||||
```
|
```
|
||||||
OpenIM.iMManager.conversationManager.getAllConversationList().then((list) {
|
OpenIM.iMManager.conversationManager.getAllConversationList().then((list) {
|
||||||
// Return to the conversation list
|
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 6,Get contact list
|
#### 6,Get friend list
|
||||||
|
|
||||||
```
|
```
|
||||||
OpenIM.iMManager.friendshipManager.getFriendList().then((list) {
|
OpenIM.iMManager.friendshipManager.getFriendList().then((list) {
|
||||||
// Return to friends list
|
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 7,Get chat history
|
#### 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 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
|
// If the userID is null and the groupID is not null, get a group chat message list
|
||||||
@@ -146,38 +123,12 @@ class CustomAdvancedMsgListener extends AdvancedMsgListener {
|
|||||||
userID: uid,//User id
|
userID: uid,//User id
|
||||||
startMsg: startMsg,//Last message, take chatMsgList[0]
|
startMsg: startMsg,//Last message, take chatMsgList[0]
|
||||||
groupID: gid,//Group id
|
groupID: gid,//Group id
|
||||||
count: 12,//Page Size
|
count: count,//Page Size
|
||||||
)
|
)
|
||||||
.then((list) => chatMsgList.addAll(list));
|
.then((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
|
#### 8,Send a message
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -192,9 +143,7 @@ OpenIM.iMManager.messageManager.sendMessage(
|
|||||||
userID: uid, // Single chat value is not null
|
userID: uid, // Single chat value is not null
|
||||||
groupID: gid, // The group chat value is not null
|
groupID: gid, // The group chat value is not null
|
||||||
).then((v) {
|
).then((v) {
|
||||||
// Sent successfully
|
|
||||||
}).catchError((e){
|
}).catchError((e){
|
||||||
// Failed to send
|
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -219,34 +168,40 @@ OpenIM.iMManager.logout();
|
|||||||
| getLoginUserInfo | Current user information |
|
| getLoginUserInfo | Current user information |
|
||||||
| setSelfInfo | Modify current user information |
|
| setSelfInfo | Modify current user information |
|
||||||
| getUsersInfo | Get user information by user id |
|
| getUsersInfo | Get user information by user id |
|
||||||
| forceReConn | Force reconnection |
|
| enabledSDKLog | Setup sdk log |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### OpenIM.iMManager.conversationManager
|
#### OpenIM.iMManager.conversationManager
|
||||||
|
|
||||||
| method | description |
|
| method | description |
|
||||||
| ----------------------- | --------------------------- |
|
| ----------------------------- | --------------------------------------- |
|
||||||
| setConversationListener | Listener |
|
| setConversationListener | Listener |
|
||||||
| getAllConversationList | Get all conversation |
|
| getAllConversationList | Get all conversation |
|
||||||
| getSingleConversation | Get a single conversation |
|
| getSingleConversation | Get single conversation |
|
||||||
| getMultipleConversation | Get multiple conversation |
|
| getMultipleConversation | Get multiple conversation |
|
||||||
| deleteConversation | Delete conversation |
|
| deleteConversation | Delete conversation |
|
||||||
| setConversationDraft | Set conversation draftText |
|
| setConversationDraft | Set conversation draftText |
|
||||||
| pinConversation | Top conversation |
|
| pinConversation | Top conversation |
|
||||||
|
| markSingleMessageHasRead | Mark single chat messages as read |
|
||||||
|
| markGroupMessageHasRead | Mark group chat messages as read |
|
||||||
|
| getTotalUnreadMsgCount | Get the total number of unread messages |
|
||||||
|
| getConversationID | Query conversation id |
|
||||||
|
| setConversationRecvMessageOpt | Setup message do not disturb |
|
||||||
|
| getConversationRecvMessageOpt | Message do not disturb status |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### OpenIM.iMManager.friendshipManager
|
#### OpenIM.iMManager.friendshipManager
|
||||||
|
|
||||||
| method | description |
|
| method | description |
|
||||||
| ------------------------ | --------------------------- |
|
| ------------------------ | ------------------------------------------------------------ |
|
||||||
| setFriendshipListener | Listener |
|
| setFriendshipListener | Listener |
|
||||||
| getFriendsInfo | Get friend information |
|
| getFriendsInfo | Get friend information |
|
||||||
| addFriend | Add friends |
|
| addFriend | Send an friend application |
|
||||||
| getFriendApplicationList | Get friend application list |
|
| getFriendApplicationList | Get all friend application, sent to you by others |
|
||||||
| getFriendList | Get friends list |
|
| getFriendList | Find all friends including those who have been added to the blacklist |
|
||||||
| setFriendInfo | Edit friend notes |
|
| setFriendInfo | Modify friend information, only comment can be modified |
|
||||||
| addToBlackList | Add to blacklist |
|
| addToBlackList | Add to blacklist |
|
||||||
| getBlackList | Get blacklist list |
|
| getBlackList | Get blacklist list |
|
||||||
| deleteFromBlackList | Remove from blacklist |
|
| deleteFromBlackList | Remove from blacklist |
|
||||||
@@ -260,9 +215,8 @@ OpenIM.iMManager.logout();
|
|||||||
#### OpenIM.iMManager.messageManager
|
#### OpenIM.iMManager.messageManager
|
||||||
|
|
||||||
| method | description |
|
| method | description |
|
||||||
| ------------------------------------------- | --------------------------------- |
|
| --------------------------------- | --------------------------------- |
|
||||||
| addAdvancedMsgListener | Add message listener |
|
| addAdvancedMsgListener | Add message listener |
|
||||||
| removeAdvancedMsgListener | Remove message listener |
|
|
||||||
| setMsgSendProgressListener | Message sending progress listener |
|
| setMsgSendProgressListener | Message sending progress listener |
|
||||||
| sendMessage | Send a message |
|
| sendMessage | Send a message |
|
||||||
| getHistoryMessageList | Get history news |
|
| getHistoryMessageList | Get history news |
|
||||||
@@ -270,19 +224,26 @@ OpenIM.iMManager.logout();
|
|||||||
| deleteMessageFromLocalStorage | Delete message |
|
| deleteMessageFromLocalStorage | Delete message |
|
||||||
| insertSingleMessageToLocalStorage | Insert message |
|
| insertSingleMessageToLocalStorage | Insert message |
|
||||||
| findMessages | Query the message by id |
|
| findMessages | Query the message by id |
|
||||||
| markSingleMessageHasRead | Mark single chat messages as read |
|
| markC2CMessageAsRead | Mark c2c message as read |
|
||||||
| markGroupMessageHasRead | Mark group chat messages as read |
|
| typingStatusUpdate | Typing prompt |
|
||||||
| <font color=red>markC2CMessageAsRead</font> | Mark c2c message as read |
|
|
||||||
| <font color=red>typingStatusUpdate</font> | Typing prompt |
|
|
||||||
| createTextMessage | Create text message |
|
| createTextMessage | Create text message |
|
||||||
| createTextAtMessage | Create @ message |
|
| createTextAtMessage | Create @ message |
|
||||||
| createImageMessage | Create picture message |
|
| createImageMessage | Create picture message |
|
||||||
|
| createImageMessageFromFullPath | Create picture message |
|
||||||
| createSoundMessage | Create voice message |
|
| createSoundMessage | Create voice message |
|
||||||
|
| createSoundMessageFromFullPath | Create voice message |
|
||||||
| createVideoMessage | Create video message |
|
| createVideoMessage | Create video message |
|
||||||
|
| createVideoMessageFromFullPath | Create video message |
|
||||||
| createFileMessage | Create file message |
|
| createFileMessage | Create file message |
|
||||||
|
| createFileMessageFromFullPath | Create file message |
|
||||||
| createMergerMessage | Create merge message |
|
| createMergerMessage | Create merge message |
|
||||||
| createForwardMessage | Create a forwarded message |
|
| createForwardMessage | Create a forwarded message |
|
||||||
| getTotalUnreadMsgCount | Get unread message count |
|
| createLocationMessage | Create location message |
|
||||||
|
| createCustomMessage | Create custom message |
|
||||||
|
| createQuoteMessage | Create quote message |
|
||||||
|
| createCardMessage | Create card message |
|
||||||
|
| clearC2CHistoryMessage | Clear all message history |
|
||||||
|
| clearGroupHistoryMessage | Clear all message history |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -298,11 +259,91 @@ OpenIM.iMManager.logout();
|
|||||||
| getJoinedGroupList | Get joined groups |
|
| getJoinedGroupList | Get joined groups |
|
||||||
| isJoinedGroup | Check you have joined the group |
|
| isJoinedGroup | Check you have joined the group |
|
||||||
| createGroup | Create a group |
|
| createGroup | Create a group |
|
||||||
| setGroupInfo | Set group information |
|
| setGroupInfo | Edit group information |
|
||||||
| getGroupsInfo | Get group information |
|
| getGroupsInfo | Get group information |
|
||||||
| joinGroup | Join group |
|
| joinGroup | Join group |
|
||||||
| quitGroup | Exit group |
|
| quitGroup | Exit group |
|
||||||
| transferGroupOwner | Group permission transfer |
|
| transferGroupOwner | Group permission transfer |
|
||||||
| getGroupApplicationList | Get group application list |
|
| getGroupApplicationList | Get group application list |
|
||||||
| acceptGroupApplication | Accept group invitation |
|
| acceptGroupApplication | Accept group invitation |
|
||||||
| refuseGroupApplication | Decline group invitation |
|
| refuseGroupApplication | Refuse group application |
|
||||||
|
|
||||||
|
#### Other
|
||||||
|
|
||||||
|
Message type
|
||||||
|
|
||||||
|
```
|
||||||
|
static const text = 101;
|
||||||
|
static const picture = 102;
|
||||||
|
static const voice = 103;
|
||||||
|
static const video = 104;
|
||||||
|
static const file = 105;
|
||||||
|
static const at_text = 106;
|
||||||
|
static const merger = 107;
|
||||||
|
static const card = 108;
|
||||||
|
static const location = 109;
|
||||||
|
static const custom = 110;
|
||||||
|
static const revoke = 111;
|
||||||
|
static const has_read_receipt = 112;
|
||||||
|
static const typing = 113;
|
||||||
|
static const quote = 114;
|
||||||
|
|
||||||
|
///
|
||||||
|
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 kick_online = 303;
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
```
|
||||||
|
|
||||||
|
Platform
|
||||||
|
|
||||||
|
```
|
||||||
|
static const ios = 1;
|
||||||
|
static const android = 2;
|
||||||
|
static const windows = 3;
|
||||||
|
static const xos = 4;
|
||||||
|
static const web = 5;
|
||||||
|
static const mini_web = 6;
|
||||||
|
static const linux = 7;
|
||||||
|
```
|
||||||
|
|
||||||
|
Group member role
|
||||||
|
|
||||||
|
```
|
||||||
|
static const member = 0;
|
||||||
|
static const owner = 1;
|
||||||
|
static const admin = 2;
|
||||||
|
```
|
||||||
|
|
||||||
|
Conversation type
|
||||||
|
|
||||||
|
```
|
||||||
|
static const single_chat = 1;
|
||||||
|
static const group_chat = 2;
|
||||||
|
```
|
||||||
|
|
||||||
|
Message status
|
||||||
|
|
||||||
|
```
|
||||||
|
static const sending = 1;
|
||||||
|
static const succeeded = 2;
|
||||||
|
static const failed = 3;
|
||||||
|
static const deleted = 4;
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
1522
README.zh-cn.md
@@ -3,35 +3,25 @@ version '1.0'
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
|
||||||
maven {
|
maven {
|
||||||
allowInsecureProtocol = true
|
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()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.5.1'
|
classpath 'com.android.tools.build:gradle:3.5.4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.allprojects {
|
rootProject.allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
|
||||||
maven {
|
maven {
|
||||||
allowInsecureProtocol = true
|
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()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
@@ -51,5 +41,5 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.openim:client-sdk:1.0.9@aar'
|
implementation 'io.openim:client-sdk:1.4.5@aar'
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ import android.content.Context;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import io.flutter.Log;
|
import io.flutter.Log;
|
||||||
@@ -19,7 +18,6 @@ import io.openim.flutter_openim_sdk.manager.FriendshipManager;
|
|||||||
import io.openim.flutter_openim_sdk.manager.GroupManager;
|
import io.openim.flutter_openim_sdk.manager.GroupManager;
|
||||||
import io.openim.flutter_openim_sdk.manager.IMManager;
|
import io.openim.flutter_openim_sdk.manager.IMManager;
|
||||||
import io.openim.flutter_openim_sdk.manager.MessageManager;
|
import io.openim.flutter_openim_sdk.manager.MessageManager;
|
||||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,18 +66,12 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
|||||||
|
|
||||||
void parse(@NonNull MethodCall call, @NonNull Result result) {
|
void parse(@NonNull MethodCall call, @NonNull Result result) {
|
||||||
try {
|
try {
|
||||||
String managerName = CommonUtil.getParamValue(call, "ManagerName");
|
String managerName = call.argument("ManagerName");
|
||||||
Field field = FlutterOpenimSdkPlugin.class.getDeclaredField(managerName);
|
Field field = FlutterOpenimSdkPlugin.class.getDeclaredField(managerName);
|
||||||
Method method = field.get(new Object()).getClass().getDeclaredMethod(call.method, MethodCall.class, Result.class);
|
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() + " }");
|
Log.i("F-OpenIMSDK(flutter call native)", "{ class:" + managerName + ", method:" + method.getName() + " }");
|
||||||
method.invoke(field.get(new Object()), call, result);
|
method.invoke(field.get(new Object()), call, result);
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,41 @@
|
|||||||
package io.openim.flutter_openim_sdk.listener;
|
package io.openim.flutter_openim_sdk.listener;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import android.util.ArrayMap;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||||
import open_im_sdk.OnAdvancedMsgListener;
|
import open_im_sdk.OnAdvancedMsgListener;
|
||||||
|
|
||||||
public class AdvancedMsgListener implements OnAdvancedMsgListener {
|
public class AdvancedMsgListener implements OnAdvancedMsgListener {
|
||||||
final Map<String, String> values = new HashMap<>();
|
// final Map<String, String> values = new HashMap<>();
|
||||||
|
private final String id;
|
||||||
|
|
||||||
public AdvancedMsgListener(String listenerId) {
|
public AdvancedMsgListener(String listenerId) {
|
||||||
this.values.put("id", listenerId);
|
this.id = listenerId;
|
||||||
|
// this.values.put("id", listenerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecvC2CReadReceipt(String s) {
|
public void onRecvC2CReadReceipt(String s) {
|
||||||
|
final Map<String, String> values = new ArrayMap<>();
|
||||||
|
values.put("id", id);
|
||||||
values.put("haveReadMessage", s);
|
values.put("haveReadMessage", s);
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecvMessageRevoked(String s) {
|
public void onRecvMessageRevoked(String s) {
|
||||||
|
final Map<String, String> values = new ArrayMap<>();
|
||||||
|
values.put("id", id);
|
||||||
values.put("revokedMessage", s);
|
values.put("revokedMessage", s);
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecvNewMessage(String s) {
|
public void onRecvNewMessage(String s) {
|
||||||
|
final Map<String, String> values = new ArrayMap<>();
|
||||||
|
values.put("id", id);
|
||||||
values.put("newMessage", s);
|
values.put("newMessage", s);
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ public class BaseListener implements Base {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(long l, String s) {
|
public void onError(long l, String s) {
|
||||||
Log.e("F-OpenIMSD(callback)", s);
|
// Log.e("F-OpenIMSD(callback)", s);
|
||||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String s) {
|
public void onSuccess(String s) {
|
||||||
Log.i("F-OpenIMSDK(callback)", s);
|
// Log.i("F-OpenIMSDK(callback)", s);
|
||||||
CommonUtil.runMainThreadReturn(result, s);
|
CommonUtil.runMainThreadReturn(result, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package io.openim.flutter_openim_sdk.listener;
|
package io.openim.flutter_openim_sdk.listener;
|
||||||
|
|
||||||
|
import android.util.ArrayMap;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -9,7 +11,7 @@ import open_im_sdk.OnGroupListener;
|
|||||||
public class GroupListener implements OnGroupListener {
|
public class GroupListener implements OnGroupListener {
|
||||||
@Override
|
@Override
|
||||||
public void onApplicationProcessed(String s, String s1, int i, String s2) {
|
public void onApplicationProcessed(String s, String s1, int i, String s2) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
map.put("opUser", s1);
|
map.put("opUser", s1);
|
||||||
map.put("agreeOrReject", i);
|
map.put("agreeOrReject", i);
|
||||||
@@ -19,14 +21,14 @@ public class GroupListener implements OnGroupListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGroupCreated(String s) {
|
public void onGroupCreated(String s) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
CommonUtil.emitEvent("groupListener", "onGroupCreated", map);
|
CommonUtil.emitEvent("groupListener", "onGroupCreated", map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGroupInfoChanged(String s, String s1) {
|
public void onGroupInfoChanged(String s, String s1) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
map.put("groupInfo", s1);
|
map.put("groupInfo", s1);
|
||||||
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", map);
|
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", map);
|
||||||
@@ -34,7 +36,7 @@ public class GroupListener implements OnGroupListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMemberEnter(String s, String s1) {
|
public void onMemberEnter(String s, String s1) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
map.put("memberList", s1);
|
map.put("memberList", s1);
|
||||||
CommonUtil.emitEvent("groupListener", "onMemberEnter", map);
|
CommonUtil.emitEvent("groupListener", "onMemberEnter", map);
|
||||||
@@ -42,7 +44,7 @@ public class GroupListener implements OnGroupListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMemberInvited(String s, String s1, String s2) {
|
public void onMemberInvited(String s, String s1, String s2) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
map.put("opUser", s1);
|
map.put("opUser", s1);
|
||||||
map.put("memberList", s2);
|
map.put("memberList", s2);
|
||||||
@@ -51,7 +53,7 @@ public class GroupListener implements OnGroupListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMemberKicked(String s, String s1, String s2) {
|
public void onMemberKicked(String s, String s1, String s2) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
map.put("opUser", s1);
|
map.put("opUser", s1);
|
||||||
map.put("memberList", s2);
|
map.put("memberList", s2);
|
||||||
@@ -60,7 +62,7 @@ public class GroupListener implements OnGroupListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMemberLeave(String s, String s1) {
|
public void onMemberLeave(String s, String s1) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
map.put("member", s1);
|
map.put("member", s1);
|
||||||
CommonUtil.emitEvent("groupListener", "onMemberLeave", map);
|
CommonUtil.emitEvent("groupListener", "onMemberLeave", map);
|
||||||
@@ -68,7 +70,7 @@ public class GroupListener implements OnGroupListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceiveJoinApplication(String s, String s1, String s2) {
|
public void onReceiveJoinApplication(String s, String s1, String s2) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new ArrayMap<>();
|
||||||
map.put("groupId", s);
|
map.put("groupId", s);
|
||||||
map.put("member", s1);
|
map.put("member", s1);
|
||||||
map.put("opReason", s2);
|
map.put("opReason", s2);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package io.openim.flutter_openim_sdk.listener;
|
package io.openim.flutter_openim_sdk.listener;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import android.util.ArrayMap;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.flutter.plugin.common.MethodCall;
|
import io.flutter.plugin.common.MethodCall;
|
||||||
@@ -10,12 +11,14 @@ import open_im_sdk.SendMsgCallBack;
|
|||||||
|
|
||||||
public class MsgSendProgressListener implements SendMsgCallBack {
|
public class MsgSendProgressListener implements SendMsgCallBack {
|
||||||
final private MethodChannel.Result result;
|
final private MethodChannel.Result result;
|
||||||
final private MethodCall call;
|
// final private MethodCall call;
|
||||||
final Map<String, Object> values = new HashMap<>();
|
final private Object clientMsgID;
|
||||||
|
|
||||||
public MsgSendProgressListener(MethodChannel.Result result, MethodCall call) {
|
public MsgSendProgressListener(MethodChannel.Result result, MethodCall call) {
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.call = call;
|
// this.call = call;
|
||||||
|
Map<String, Object> args = call.argument("message");
|
||||||
|
this.clientMsgID = args.get("clientMsgID");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -25,7 +28,8 @@ public class MsgSendProgressListener implements SendMsgCallBack {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onProgress(long l) {
|
public void onProgress(long l) {
|
||||||
values.put("clientMsgID", CommonUtil.getSendMessageClientMsgID(call));
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
|
values.put("clientMsgID", clientMsgID);
|
||||||
values.put("progress", l);
|
values.put("progress", l);
|
||||||
CommonUtil.emitEvent("msgSendProgressListener", "onProgress", values);
|
CommonUtil.emitEvent("msgSendProgressListener", "onProgress", values);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import io.openim.flutter_openim_sdk.listener.ConversationListener;
|
|||||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||||
import open_im_sdk.Open_im_sdk;
|
import open_im_sdk.Open_im_sdk;
|
||||||
|
|
||||||
public class ConversationManager {
|
public class ConversationManager extends BaseManager {
|
||||||
|
|
||||||
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
|
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setConversationListener(new ConversationListener());
|
Open_im_sdk.setConversationListener(new ConversationListener());
|
||||||
@@ -17,43 +17,55 @@ public class ConversationManager {
|
|||||||
Open_im_sdk.getAllConversationList(new BaseListener(result));
|
Open_im_sdk.getAllConversationList(new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getConversationListSplit(new BaseListener(result),
|
||||||
|
int2long(methodCall, "offset"),
|
||||||
|
int2long(methodCall, "count"));
|
||||||
|
}
|
||||||
|
|
||||||
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getOneConversation(
|
Open_im_sdk.getOneConversation(
|
||||||
CommonUtil.getConversationSourceId(methodCall),
|
value(methodCall, "sourceID"),
|
||||||
CommonUtil.getConversationSessionType(methodCall),
|
int2long(methodCall, "sessionType"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getMultipleConversation(
|
Open_im_sdk.getMultipleConversation(
|
||||||
CommonUtil.getConversationIds(methodCall),
|
jsonValue(methodCall, "conversationIDList"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.deleteConversation(CommonUtil.getConversationId(methodCall), new BaseListener(result));
|
Open_im_sdk.deleteConversation(
|
||||||
|
value(methodCall, "conversationID"),
|
||||||
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setConversationDraft(
|
Open_im_sdk.setConversationDraft(
|
||||||
CommonUtil.getConversationId(methodCall),
|
value(methodCall, "conversationID"),
|
||||||
CommonUtil.getConversationDraft(methodCall),
|
value(methodCall, "draftText"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.pinConversation(
|
Open_im_sdk.pinConversation(
|
||||||
CommonUtil.getConversationId(methodCall),
|
value(methodCall, "conversationID"),
|
||||||
CommonUtil.isPinnedConversation(methodCall),
|
value(methodCall, "isPinned"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.markSingleMessageHasRead(new BaseListener(result), CommonUtil.getSingleMessageUserid(methodCall));
|
Open_im_sdk.markSingleMessageHasRead(
|
||||||
|
new BaseListener(result),
|
||||||
|
value(methodCall, "userID"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.markGroupMessageHasRead(new BaseListener(result), CommonUtil.getGroupMessageGroupid(methodCall));
|
Open_im_sdk.markGroupMessageHasRead(
|
||||||
|
new BaseListener(result),
|
||||||
|
value(methodCall, "groupID"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -61,9 +73,23 @@ public class ConversationManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
|
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getConversationIDBySessionType(
|
||||||
Open_im_sdk.getConversationIDBySessionType(CommonUtil.getConversationSourceId(methodCall),
|
value(methodCall, "sourceID"),
|
||||||
CommonUtil.getConversationSessionType(methodCall)));
|
int2long(methodCall, "sessionType")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.setConversationRecvMessageOpt(
|
||||||
|
new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "conversationIDList"),
|
||||||
|
int2long(methodCall, "status")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getConversationRecvMessageOpt(
|
||||||
|
new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "conversationIDList")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import io.flutter.plugin.common.MethodCall;
|
|||||||
import io.flutter.plugin.common.MethodChannel;
|
import io.flutter.plugin.common.MethodChannel;
|
||||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||||
import io.openim.flutter_openim_sdk.listener.FriendshipListener;
|
import io.openim.flutter_openim_sdk.listener.FriendshipListener;
|
||||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
|
||||||
import open_im_sdk.Open_im_sdk;
|
import open_im_sdk.Open_im_sdk;
|
||||||
|
|
||||||
public class FriendshipManager {
|
public class FriendshipManager extends BaseManager {
|
||||||
|
|
||||||
|
|
||||||
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
|
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -15,11 +14,13 @@ public class FriendshipManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getFriendsInfo(new BaseListener(result), CommonUtil.getUidList(methodCall));
|
Open_im_sdk.getFriendsInfo(new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "uidList"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
|
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.addFriend(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
Open_im_sdk.addFriend(new BaseListener(result),
|
||||||
|
jsonValue(methodCall));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -31,11 +32,13 @@ public class FriendshipManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setFriendInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void setFriendInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setFriendInfo(CommonUtil.getSDKJsonParam(methodCall), new BaseListener(result));
|
Open_im_sdk.setFriendInfo(
|
||||||
|
jsonValue(methodCall), new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addToBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
public void addToBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.addToBlackList(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
Open_im_sdk.addToBlackList(new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "uid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -43,23 +46,28 @@ public class FriendshipManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void deleteFromBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteFromBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.deleteFromBlackList(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
Open_im_sdk.deleteFromBlackList(new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "uid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
|
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.checkFriend(new BaseListener(result), CommonUtil.getUidList(methodCall));
|
Open_im_sdk.checkFriend(new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "uidList"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteFromFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteFromFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.deleteFromFriendList(CommonUtil.getJsonUid(methodCall), new BaseListener(result));
|
Open_im_sdk.deleteFromFriendList(
|
||||||
|
jsonValue(methodCall, "uid"), new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.acceptFriendApplication(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
Open_im_sdk.acceptFriendApplication(new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "uid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.refuseFriendApplication(new BaseListener(result), CommonUtil.getJsonUid(methodCall));
|
Open_im_sdk.refuseFriendApplication(new BaseListener(result),
|
||||||
|
jsonValue(methodCall, "uid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
// public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import io.flutter.plugin.common.MethodCall;
|
|||||||
import io.flutter.plugin.common.MethodChannel;
|
import io.flutter.plugin.common.MethodChannel;
|
||||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||||
import io.openim.flutter_openim_sdk.listener.GroupListener;
|
import io.openim.flutter_openim_sdk.listener.GroupListener;
|
||||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
|
||||||
import open_im_sdk.Open_im_sdk;
|
import open_im_sdk.Open_im_sdk;
|
||||||
|
|
||||||
public class GroupManager {
|
public class GroupManager extends BaseManager {
|
||||||
|
|
||||||
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
|
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setGroupListener(new GroupListener());
|
Open_im_sdk.setGroupListener(new GroupListener());
|
||||||
@@ -15,32 +14,32 @@ public class GroupManager {
|
|||||||
|
|
||||||
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.inviteUserToGroup(
|
Open_im_sdk.inviteUserToGroup(
|
||||||
CommonUtil.getGid(methodCall),
|
value(methodCall, "gid"),
|
||||||
CommonUtil.getGroupOpReason(methodCall),
|
value(methodCall, "reason"),
|
||||||
CommonUtil.getUidList(methodCall),
|
jsonValue(methodCall, "uidList"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.kickGroupMember(
|
Open_im_sdk.kickGroupMember(
|
||||||
CommonUtil.getGid(methodCall),
|
value(methodCall, "gid"),
|
||||||
CommonUtil.getGroupOpReason(methodCall),
|
value(methodCall, "reason"),
|
||||||
CommonUtil.getUidList(methodCall),
|
jsonValue(methodCall, "uidList"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupMembersInfo(
|
Open_im_sdk.getGroupMembersInfo(
|
||||||
CommonUtil.getGid(methodCall),
|
value(methodCall, "gid"),
|
||||||
CommonUtil.getUidList(methodCall),
|
jsonValue(methodCall, "uidList"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupMemberList(
|
Open_im_sdk.getGroupMemberList(
|
||||||
CommonUtil.getGid(methodCall),
|
value(methodCall, "gid"),
|
||||||
CommonUtil.getGroupListFilter(methodCall),
|
value(methodCall, "filter"),
|
||||||
CommonUtil.getGroupListNext(methodCall),
|
value(methodCall, "next"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,40 +50,36 @@ public class GroupManager {
|
|||||||
|
|
||||||
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.createGroup(
|
Open_im_sdk.createGroup(
|
||||||
CommonUtil.getGroupInfo(methodCall),
|
jsonValue(methodCall, "gInfo"),
|
||||||
CommonUtil.getGroupMemberRoleList(methodCall),
|
jsonValue(methodCall, "memberList"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setGroupInfo(
|
Open_im_sdk.setGroupInfo(jsonValue(methodCall, "gInfo"), new BaseListener(result));
|
||||||
CommonUtil.getGroupInfo(methodCall),
|
|
||||||
new BaseListener(result));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupsInfo(
|
Open_im_sdk.getGroupsInfo(jsonValue(methodCall, "gidList"), new BaseListener(result));
|
||||||
CommonUtil.getGidList(methodCall),
|
|
||||||
new BaseListener(result));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.joinGroup(
|
Open_im_sdk.joinGroup(
|
||||||
CommonUtil.getGid(methodCall),
|
value(methodCall, "gid"),
|
||||||
CommonUtil.getGroupOpReason(methodCall),
|
value(methodCall, "reason"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.quitGroup(
|
Open_im_sdk.quitGroup(
|
||||||
CommonUtil.getGid(methodCall),
|
value(methodCall, "gid"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
|
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.transferGroupOwner(
|
Open_im_sdk.transferGroupOwner(
|
||||||
CommonUtil.getGid(methodCall),
|
value(methodCall, "gid"),
|
||||||
CommonUtil.getUid(methodCall),
|
value(methodCall, "uid"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,16 +89,16 @@ public class GroupManager {
|
|||||||
|
|
||||||
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.acceptGroupApplication(
|
Open_im_sdk.acceptGroupApplication(
|
||||||
CommonUtil.getGroupApplicationInfo(methodCall),
|
jsonValue(methodCall, "application"),
|
||||||
CommonUtil.getGroupOpReason(methodCall),
|
value(methodCall, "reason"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.refuseGroupApplication(
|
Open_im_sdk.refuseGroupApplication(
|
||||||
CommonUtil.getGroupApplicationInfo(methodCall),
|
jsonValue(methodCall, "application"),
|
||||||
CommonUtil.getGroupOpReason(methodCall),
|
value(methodCall, "reason"),
|
||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,15 +7,18 @@ import io.openim.flutter_openim_sdk.listener.SDKListener;
|
|||||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||||
import open_im_sdk.Open_im_sdk;
|
import open_im_sdk.Open_im_sdk;
|
||||||
|
|
||||||
public class IMManager {
|
public class IMManager extends BaseManager {
|
||||||
|
|
||||||
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
|
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(CommonUtil.getSDKJsonParam(methodCall), new SDKListener()));
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(
|
||||||
|
jsonValue(methodCall), new SDKListener()));
|
||||||
// CommonUtil.runMainThreadReturn(result, null);
|
// CommonUtil.runMainThreadReturn(result, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
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(
|
||||||
|
value(methodCall, "uid"),
|
||||||
|
value(methodCall, "token"), new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logout(MethodCall methodCall, MethodChannel.Result result) {
|
public void logout(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -31,11 +34,13 @@ public class IMManager {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getUsersInfo(CommonUtil.getUidList(methodCall), new BaseListener(result));
|
Open_im_sdk.getUsersInfo(
|
||||||
|
jsonValue(methodCall, "uidList"), new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setSelfInfo(CommonUtil.getSDKJsonParam(methodCall), new BaseListener(result));
|
Open_im_sdk.setSelfInfo(
|
||||||
|
jsonValue(methodCall), new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -47,6 +52,6 @@ public class IMManager {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
|
public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setSdkLog(CommonUtil.getSDKLog(methodCall));
|
Open_im_sdk.setSdkLog(value(methodCall, "sdkLog"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,12 +13,17 @@ import open_im_sdk.OnAdvancedMsgListener;
|
|||||||
import open_im_sdk.Open_im_sdk;
|
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 String KEY_ID = "id";
|
||||||
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
|
// 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<>();
|
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
// protected void clearListeners() {
|
||||||
|
// initializedListener = false;
|
||||||
|
// listeners.clear();
|
||||||
|
// }
|
||||||
|
|
||||||
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
|
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRecvC2CReadReceipt(String s) {
|
public void onRecvC2CReadReceipt(String s) {
|
||||||
@@ -44,20 +49,21 @@ public class MessageManager {
|
|||||||
|
|
||||||
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
String key = methodCall.argument(KEY_ID);
|
String key = methodCall.argument(KEY_ID);
|
||||||
listeners.put(key, new AdvancedMsgListener(key));
|
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
|
||||||
if (!initializedListener) {
|
// listeners.put(key, new AdvancedMsgListener(key));
|
||||||
initializedListener = true;
|
// if (!initializedListener) {
|
||||||
Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
|
// initializedListener = true;
|
||||||
}
|
// Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
String key = methodCall.argument(KEY_ID);
|
// String key = methodCall.argument(KEY_ID);
|
||||||
listeners.remove(key);
|
// listeners.remove(key);
|
||||||
if (listeners.isEmpty()) {
|
// if (listeners.isEmpty()) {
|
||||||
initializedListener = false;
|
// initializedListener = false;
|
||||||
// Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
|
// Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@@ -81,22 +87,22 @@ public class MessageManager {
|
|||||||
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
MsgSendProgressListener listener = new MsgSendProgressListener(result, methodCall);
|
MsgSendProgressListener listener = new MsgSendProgressListener(result, methodCall);
|
||||||
Open_im_sdk.sendMessage(listener,
|
Open_im_sdk.sendMessage(listener,
|
||||||
CommonUtil.getSendMessageContent(methodCall),
|
jsonValue(methodCall, "message"),
|
||||||
CommonUtil.getSendMessageReceiver(methodCall),
|
value(methodCall, "userID"),
|
||||||
CommonUtil.geSendMessageGroupId(methodCall),
|
value(methodCall, "groupID"),
|
||||||
CommonUtil.getSendMessageOnlineOnly(methodCall));
|
value(methodCall, "onlineUserOnly"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getHistoryMessageList(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
Open_im_sdk.getHistoryMessageList(new BaseListener(result), jsonValue(methodCall));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.revokeMessage(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
Open_im_sdk.revokeMessage(new BaseListener(result), jsonValue(methodCall));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.deleteMessageFromLocalStorage(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
Open_im_sdk.deleteMessageFromLocalStorage(new BaseListener(result), jsonValue(methodCall));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -105,141 +111,151 @@ public class MessageManager {
|
|||||||
|
|
||||||
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.insertSingleMessageToLocalStorage(new BaseListener(result),
|
Open_im_sdk.insertSingleMessageToLocalStorage(new BaseListener(result),
|
||||||
CommonUtil.getSingleMessageContent(methodCall),
|
jsonValue(methodCall, "message"),
|
||||||
CommonUtil.getSingleMessageUserid(methodCall),
|
value(methodCall, "receiverID"),
|
||||||
CommonUtil.getSingleMessageSender(methodCall));
|
value(methodCall, "senderID"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
|
public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.findMessages(new BaseListener(result), CommonUtil.getMessageIdList(methodCall));
|
Open_im_sdk.findMessages(new BaseListener(result), jsonValue(methodCall, "messageIDList"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.markC2CMessageAsRead(new BaseListener(result),
|
Open_im_sdk.markC2CMessageAsRead(new BaseListener(result),
|
||||||
CommonUtil.getSingleMessageUserid(methodCall),
|
value(methodCall, "userID"),
|
||||||
CommonUtil.getMessageIdList(methodCall));
|
jsonValue(methodCall, "messageIDList"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
|
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.typingStatusUpdate(CommonUtil.getSingleMessageUserid(methodCall),
|
Open_im_sdk.typingStatusUpdate(value(methodCall, "userID"),
|
||||||
CommonUtil.getSingleMessageTyping(methodCall));
|
value(methodCall, "typing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createTextMessage(
|
Open_im_sdk.createTextMessage(
|
||||||
CommonUtil.getMessageText(methodCall)));
|
value(methodCall, "text")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createTextAtMessage(
|
Open_im_sdk.createTextAtMessage(
|
||||||
CommonUtil.getMessageText(methodCall),
|
value(methodCall, "text"),
|
||||||
CommonUtil.getAtUserList(methodCall)));
|
jsonValue(methodCall, "atUserList")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createImageMessage(
|
Open_im_sdk.createImageMessage(
|
||||||
CommonUtil.getImagePath(methodCall)));
|
value(methodCall, "imagePath")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createImageMessageFromFullPath(
|
Open_im_sdk.createImageMessageFromFullPath(
|
||||||
CommonUtil.getImagePath(methodCall)));
|
value(methodCall, "imagePath")));
|
||||||
}
|
}
|
||||||
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createSoundMessage(
|
Open_im_sdk.createSoundMessage(
|
||||||
CommonUtil.getSoundPath(methodCall),
|
value(methodCall, "soundPath"),
|
||||||
CommonUtil.getSoundDuration(methodCall)));
|
int2long(methodCall, "duration")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createSoundMessageFromFullPath(
|
Open_im_sdk.createSoundMessageFromFullPath(
|
||||||
CommonUtil.getSoundPath(methodCall),
|
value(methodCall, "soundPath"),
|
||||||
CommonUtil.getSoundDuration(methodCall)));
|
int2long(methodCall, "duration")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createVideoMessage(
|
Open_im_sdk.createVideoMessage(
|
||||||
CommonUtil.getVideoPath(methodCall),
|
value(methodCall, "videoPath"),
|
||||||
CommonUtil.getVideoType(methodCall),
|
value(methodCall, "videoType"),
|
||||||
CommonUtil.getVideoDuration(methodCall),
|
int2long(methodCall, "duration"),
|
||||||
CommonUtil.getVideoSnapshotPath(methodCall)));
|
value(methodCall, "snapshotPath")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createVideoMessageFromFullPath(
|
Open_im_sdk.createVideoMessageFromFullPath(
|
||||||
CommonUtil.getVideoPath(methodCall),
|
value(methodCall, "videoPath"),
|
||||||
CommonUtil.getVideoType(methodCall),
|
value(methodCall, "videoType"),
|
||||||
CommonUtil.getVideoDuration(methodCall),
|
int2long(methodCall, "duration"),
|
||||||
CommonUtil.getVideoSnapshotPath(methodCall)));
|
value(methodCall, "snapshotPath")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createFileMessage(
|
Open_im_sdk.createFileMessage(
|
||||||
CommonUtil.getFilePath(methodCall),
|
value(methodCall, "filePath"),
|
||||||
CommonUtil.getFileName(methodCall)));
|
value(methodCall, "fileName")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createFileMessageFromFullPath(
|
Open_im_sdk.createFileMessageFromFullPath(
|
||||||
CommonUtil.getFilePath(methodCall),
|
value(methodCall, "filePath"),
|
||||||
CommonUtil.getFileName(methodCall)));
|
value(methodCall, "fileName")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createMergerMessage(
|
Open_im_sdk.createMergerMessage(
|
||||||
CommonUtil.getMergerMessageList(methodCall),
|
jsonValue(methodCall, "messageList"),
|
||||||
CommonUtil.getMergerMessageTitle(methodCall),
|
value(methodCall, "title"),
|
||||||
CommonUtil.getSummaryList(methodCall)));
|
jsonValue(methodCall, "summaryList")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result,
|
CommonUtil.runMainThreadReturn(result,
|
||||||
Open_im_sdk.createForwardMessage(
|
Open_im_sdk.createForwardMessage(
|
||||||
CommonUtil.getForwardMessage(methodCall)));
|
jsonValue(methodCall, "message")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage(
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage(
|
||||||
CommonUtil.getMessageDes(methodCall),
|
value(methodCall, "description"),
|
||||||
CommonUtil.getLocationLongitude(methodCall),
|
value(methodCall, "longitude"),
|
||||||
CommonUtil.getLocationLatitude(methodCall)
|
value(methodCall, "latitude")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage(
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage(
|
||||||
CommonUtil.getCustomMessageData(methodCall),
|
value(methodCall, "data"),
|
||||||
CommonUtil.getCustomMessageExt(methodCall),
|
value(methodCall, "extension"),
|
||||||
CommonUtil.getMessageDes(methodCall)
|
value(methodCall, "description")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage(
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage(
|
||||||
CommonUtil.getQuoteMessageText(methodCall),
|
value(methodCall, "quoteText"),
|
||||||
CommonUtil.getQuoteMessageBody(methodCall)
|
jsonValue(methodCall, "quoteMessage")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage(
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage(
|
||||||
CommonUtil.getCardMessage(methodCall)
|
jsonValue(methodCall, "cardMessage")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.forceSyncMsg();
|
Open_im_sdk.forceSyncMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.clearC2CHistoryMessage(new BaseListener(result),
|
||||||
|
value(methodCall, "userID"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.clearGroupHistoryMessage(new BaseListener(result),
|
||||||
|
value(methodCall, "groupID"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ package io.openim.flutter_openim_sdk.util;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import androidx.collection.ArrayMap;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.flutter.Log;
|
import io.flutter.Log;
|
||||||
import io.flutter.plugin.common.MethodCall;
|
|
||||||
import io.flutter.plugin.common.MethodChannel;
|
import io.flutter.plugin.common.MethodChannel;
|
||||||
import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
||||||
|
|
||||||
@@ -15,18 +15,6 @@ import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
|||||||
public class CommonUtil {
|
public class CommonUtil {
|
||||||
private final static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
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) {
|
public static void runMainThreadReturn(final MethodChannel.Result result, final Object param) {
|
||||||
MAIN_HANDLER.post(() -> result.success(param));
|
MAIN_HANDLER.post(() -> result.success(param));
|
||||||
}
|
}
|
||||||
@@ -46,7 +34,7 @@ public class CommonUtil {
|
|||||||
|
|
||||||
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, Long errCode, String errMsg, T data) {
|
||||||
runMainThread(() -> {
|
runMainThread(() -> {
|
||||||
HashMap<String, Object> res = new HashMap<>();
|
Map<String, Object> res = new ArrayMap<>();
|
||||||
if (null != type) {
|
if (null != type) {
|
||||||
res.put("type", type);
|
res.put("type", type);
|
||||||
}
|
}
|
||||||
@@ -67,288 +55,4 @@ public class CommonUtil {
|
|||||||
public static <T> void emitEvent(String method, String type, T data) {
|
public static <T> void emitEvent(String method, String type, T data) {
|
||||||
emitEvent(method, type, null, null, 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";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 46;
|
objectVersion = 51;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
@@ -121,7 +121,6 @@
|
|||||||
3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */,
|
3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */,
|
||||||
076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */,
|
076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */,
|
||||||
);
|
);
|
||||||
name = Pods;
|
|
||||||
path = Pods;
|
path = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -353,12 +352,17 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD)";
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
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_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -467,7 +471,8 @@
|
|||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = iphoneos;
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
};
|
};
|
||||||
@@ -477,12 +482,17 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD)";
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
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_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -496,12 +506,17 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD)";
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
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_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
|||||||
|
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 |
@@ -7,7 +7,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.8.1"
|
version: "2.8.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -21,7 +21,7 @@ packages:
|
|||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -68,7 +68,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.0.9+1"
|
version: "1.0.9"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -80,7 +80,7 @@ packages:
|
|||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
version: "0.12.11"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -141,7 +141,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.4.3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -155,7 +155,7 @@ packages:
|
|||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=1.20.0"
|
flutter: ">=1.20.0"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class ConversationManager: BaseServiceManager {
|
|||||||
|
|
||||||
self["setConversationListener"] = setConversationListener
|
self["setConversationListener"] = setConversationListener
|
||||||
self["getAllConversationList"] = getAllConversationList
|
self["getAllConversationList"] = getAllConversationList
|
||||||
|
self["getConversationListSplit"] = getConversationListSplit
|
||||||
self["getOneConversation"] = getOneConversation
|
self["getOneConversation"] = getOneConversation
|
||||||
self["getMultipleConversation"] = getMultipleConversation
|
self["getMultipleConversation"] = getMultipleConversation
|
||||||
self["deleteConversation"] = deleteConversation
|
self["deleteConversation"] = deleteConversation
|
||||||
@@ -24,6 +25,8 @@ public class ConversationManager: BaseServiceManager {
|
|||||||
self["markGroupMessageHasRead"] = markGroupMessageHasRead
|
self["markGroupMessageHasRead"] = markGroupMessageHasRead
|
||||||
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
||||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||||
|
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
||||||
|
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
||||||
}
|
}
|
||||||
|
|
||||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -35,6 +38,10 @@ public class ConversationManager: BaseServiceManager {
|
|||||||
Open_im_sdkGetAllConversationList(BaseCallback(result: result))
|
Open_im_sdkGetAllConversationList(BaseCallback(result: result))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[int: "offset"], methodCall[int: "count"])
|
||||||
|
}
|
||||||
|
|
||||||
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkGetOneConversation(methodCall[string: "sourceID"], methodCall[int: "sessionType"], BaseCallback(result: result))
|
Open_im_sdkGetOneConversation(methodCall[string: "sourceID"], methodCall[int: "sessionType"], BaseCallback(result: result))
|
||||||
}
|
}
|
||||||
@@ -71,6 +78,14 @@ public class ConversationManager: BaseServiceManager {
|
|||||||
let conversationID = Open_im_sdkGetConversationIDBySessionType(methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
let conversationID = Open_im_sdkGetConversationIDBySessionType(methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
||||||
callBack(result, conversationID)
|
callBack(result, conversationID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"], methodCall[int: "status"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public class IMMananger: BaseServiceManager {
|
|||||||
self["setSelfInfo"] = setSelfInfo
|
self["setSelfInfo"] = setSelfInfo
|
||||||
self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo
|
self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo
|
||||||
// self["forceReConn"] = forceReConn
|
// self["forceReConn"] = forceReConn
|
||||||
|
self["setSdkLog"] = setSdkLog
|
||||||
}
|
}
|
||||||
|
|
||||||
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -58,6 +59,9 @@ public class IMMananger: BaseServiceManager {
|
|||||||
callBack(result)
|
callBack(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"])
|
||||||
|
}
|
||||||
// func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
// func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
// Open_im_sdkForceReConn()
|
// Open_im_sdkForceReConn()
|
||||||
// callBack(result)
|
// callBack(result)
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ public class MessageManager: BaseServiceManager {
|
|||||||
self["createQuoteMessage"] = createQuoteMessage
|
self["createQuoteMessage"] = createQuoteMessage
|
||||||
self["createCardMessage"] = createCardMessage
|
self["createCardMessage"] = createCardMessage
|
||||||
self["forceSyncMsg"] = forceSyncMsg
|
self["forceSyncMsg"] = forceSyncMsg
|
||||||
|
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
||||||
|
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
func addAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func addAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -65,11 +67,11 @@ public class MessageManager: BaseServiceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel)
|
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||||
sendMsgProgressListener.setCall(methodCall: methodCall)
|
// sendMsgProgressListener.setCall(methodCall: methodCall)
|
||||||
sendMsgProgressListener.setResult(result: result)
|
// sendMsgProgressListener.setResult(result: result)
|
||||||
print("===============sendMessage===============")
|
print("===============sendMessage===============")
|
||||||
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[jsonString: "message"], methodCall[string: "receiver"],
|
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[jsonString: "message"], methodCall[string: "userID"],
|
||||||
methodCall[string: "groupID"], methodCall[bool: "onlineUserOnly"])
|
methodCall[string: "groupID"], methodCall[bool: "onlineUserOnly"])
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +93,7 @@ public class MessageManager: BaseServiceManager {
|
|||||||
|
|
||||||
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[jsonString: "message"],
|
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[jsonString: "message"],
|
||||||
methodCall[string: "userID"], methodCall[string: "sender"])
|
methodCall[string: "receiverID"], methodCall[string: "senderID"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -187,67 +189,86 @@ public class MessageManager: BaseServiceManager {
|
|||||||
callBack(result)
|
callBack(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "userID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "groupID"])
|
||||||
|
}
|
||||||
|
|
||||||
public class SendMsgProgressListener: NSObject, Open_im_sdkSendMsgCallBackProtocol {
|
public class SendMsgProgressListener: NSObject, Open_im_sdkSendMsgCallBackProtocol {
|
||||||
|
|
||||||
private let channel: FlutterMethodChannel
|
private let channel: FlutterMethodChannel
|
||||||
private var result: FlutterResult?
|
private let result: FlutterResult
|
||||||
private var call: FlutterMethodCall?
|
private let call: FlutterMethodCall
|
||||||
private var values: [String: Any] = [:]
|
|
||||||
|
|
||||||
init(channel: FlutterMethodChannel) {
|
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
}
|
|
||||||
|
|
||||||
func setResult(result: @escaping FlutterResult){
|
|
||||||
self.result = result
|
self.result = result
|
||||||
}
|
|
||||||
|
|
||||||
func setCall(methodCall: FlutterMethodCall){
|
|
||||||
self.call = methodCall
|
self.call = methodCall
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// func setResult(result: @escaping FlutterResult){
|
||||||
|
// self.result = result
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// func setCall(methodCall: FlutterMethodCall){
|
||||||
|
// self.call = methodCall
|
||||||
|
// }
|
||||||
|
|
||||||
public func onError(_ errCode: Int, errMsg: String?) {
|
public func onError(_ errCode: Int, errMsg: String?) {
|
||||||
print("=================onError============\nerrcode:\(errCode),errMsg:\(errMsg!)")
|
print("=================onError============\nerrcode:\(errCode),errMsg:\(errMsg!)")
|
||||||
DispatchQueue.main.async { self.result!(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onProgress(_ progress: Int) {
|
public func onProgress(_ progress: Int) {
|
||||||
guard let call = call else {
|
// guard let call = call else {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
var values: [String: Any] = [:]
|
||||||
print("=================onProgress============\nprogress:\(progress)")
|
print("=================onProgress============\nprogress:\(progress)")
|
||||||
values["clientMsgID"] = call[string: "clientMsgID"]
|
let message = call[dict: "message"]
|
||||||
|
values["clientMsgID"] = message["clientMsgID"]
|
||||||
values["progress"] = progress
|
values["progress"] = progress
|
||||||
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onSuccess(_ data: String?) {
|
public func onSuccess(_ data: String?) {
|
||||||
print("=================onSuccess============\nsuccess:\(data!)")
|
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_sdkOnAdvancedMsgListenerProtocol {
|
||||||
private let channel: FlutterMethodChannel
|
private let channel: FlutterMethodChannel
|
||||||
private var values: [String: Any] = [:]
|
private let id: String
|
||||||
|
|
||||||
|
// private var values: [String: Any] = [:]
|
||||||
|
|
||||||
init(channel: FlutterMethodChannel, id: String) {
|
init(channel: FlutterMethodChannel, id: String) {
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
values["id"] = id
|
self.id = id
|
||||||
|
// values["id"] = id
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
|
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
|
||||||
|
var values: [String: Any] = [:]
|
||||||
|
values["id"] = id
|
||||||
values["haveReadMessage"] = msgReceiptList
|
values["haveReadMessage"] = msgReceiptList
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onRecvMessageRevoked(_ msgId: String?) {
|
public func onRecvMessageRevoked(_ msgId: String?) {
|
||||||
|
var values: [String: Any] = [:]
|
||||||
|
values["id"] = id
|
||||||
values["revokedMessage"] = msgId
|
values["revokedMessage"] = msgId
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onRecvNewMessage(_ message: String?) {
|
public func onRecvNewMessage(_ message: String?) {
|
||||||
|
var values: [String: Any] = [:]
|
||||||
|
values["id"] = id
|
||||||
values["newMessage"] = message
|
values["newMessage"] = message
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
@class Open_im_sdkIMConfig;
|
@class Open_im_sdkIMConfig;
|
||||||
@class Open_im_sdkIMManager;
|
@class Open_im_sdkIMManager;
|
||||||
@class Open_im_sdkLogInfo;
|
@class Open_im_sdkLogInfo;
|
||||||
|
@class Open_im_sdkLogger;
|
||||||
@class Open_im_sdkMessageReceipt;
|
@class Open_im_sdkMessageReceipt;
|
||||||
@class Open_im_sdkMsgData;
|
@class Open_im_sdkMsgData;
|
||||||
@class Open_im_sdkMsgFormat;
|
@class Open_im_sdkMsgFormat;
|
||||||
@@ -427,6 +428,108 @@
|
|||||||
@property (nonatomic) NSString* _Nonnull info;
|
@property (nonatomic) NSString* _Nonnull info;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface Open_im_sdkLogger : NSObject <goSeqRefInterface> {
|
||||||
|
}
|
||||||
|
@property(strong, readonly) _Nonnull id _ref;
|
||||||
|
|
||||||
|
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||||
|
- (nonnull instancetype)init;
|
||||||
|
// skipped field Logger.Logger with unsupported type: *github.com/sirupsen/logrus.Logger
|
||||||
|
|
||||||
|
@property (nonatomic) long pid;
|
||||||
|
// skipped method Logger.AddHook with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Debug with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Debugf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Debugln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Error with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Errorf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Errorln with unsupported parameter or return types
|
||||||
|
|
||||||
|
- (void)exit:(long)code;
|
||||||
|
// skipped method Logger.Fatal with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Fatalf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Fatalln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.GetLevel with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Info with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Infof with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Infoln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.IsLevelEnabled with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Log with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Logf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Logln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Panic with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Panicf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Panicln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Print with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Printf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Println with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.ReplaceHooks with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.SetFormatter with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.SetLevel with unsupported parameter or return types
|
||||||
|
|
||||||
|
- (void)setNoLock;
|
||||||
|
// skipped method Logger.SetOutput with unsupported parameter or return types
|
||||||
|
|
||||||
|
- (void)setReportCaller:(BOOL)reportCaller;
|
||||||
|
// skipped method Logger.Trace with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Tracef with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Traceln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Warn with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Warnf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Warning with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Warningf with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Warningln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Warnln with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.WithContext with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.WithError with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.WithField with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.WithFields with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.WithTime with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.Writer with unsupported parameter or return types
|
||||||
|
|
||||||
|
// skipped method Logger.WriterLevel with unsupported parameter or return types
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@interface Open_im_sdkMessageReceipt : NSObject <goSeqRefInterface> {
|
@interface Open_im_sdkMessageReceipt : NSObject <goSeqRefInterface> {
|
||||||
}
|
}
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
@property(strong, readonly) _Nonnull id _ref;
|
||||||
@@ -794,6 +897,8 @@
|
|||||||
- (void)addFriend:(id<Open_im_sdkBase> _Nullable)callback paramsReq:(NSString* _Nullable)paramsReq;
|
- (void)addFriend:(id<Open_im_sdkBase> _Nullable)callback paramsReq:(NSString* _Nullable)paramsReq;
|
||||||
- (void)addToBlackList:(id<Open_im_sdkBase> _Nullable)callback blackUid:(NSString* _Nullable)blackUid;
|
- (void)addToBlackList:(id<Open_im_sdkBase> _Nullable)callback blackUid:(NSString* _Nullable)blackUid;
|
||||||
- (void)checkFriend:(id<Open_im_sdkBase> _Nullable)callback uidList:(NSString* _Nullable)uidList;
|
- (void)checkFriend:(id<Open_im_sdkBase> _Nullable)callback uidList:(NSString* _Nullable)uidList;
|
||||||
|
- (void)clearC2CHistoryMessage:(id<Open_im_sdkBase> _Nullable)callback userID:(NSString* _Nullable)userID;
|
||||||
|
- (void)clearGroupHistoryMessage:(id<Open_im_sdkBase> _Nullable)callback groupID:(NSString* _Nullable)groupID;
|
||||||
- (NSString* _Nonnull)createCardMessage:(NSString* _Nullable)cardInfo;
|
- (NSString* _Nonnull)createCardMessage:(NSString* _Nullable)cardInfo;
|
||||||
- (NSString* _Nonnull)createCustomMessage:(NSString* _Nullable)data extension:(NSString* _Nullable)extension description:(NSString* _Nullable)description;
|
- (NSString* _Nonnull)createCustomMessage:(NSString* _Nullable)data extension:(NSString* _Nullable)extension description:(NSString* _Nullable)description;
|
||||||
- (NSString* _Nonnull)createFileMessage:(NSString* _Nullable)filePath fileName:(NSString* _Nullable)fileName;
|
- (NSString* _Nonnull)createFileMessage:(NSString* _Nullable)filePath fileName:(NSString* _Nullable)fileName;
|
||||||
@@ -836,6 +941,8 @@
|
|||||||
- (void)getBlackList:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)getBlackList:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
// skipped method UserRelated.GetCh with unsupported parameter or return types
|
// skipped method UserRelated.GetCh with unsupported parameter or return types
|
||||||
|
|
||||||
|
- (void)getConversationListSplit:(id<Open_im_sdkBase> _Nullable)callback offset:(long)offset count:(long)count;
|
||||||
|
- (void)getConversationRecvMessageOpt:(id<Open_im_sdkBase> _Nullable)callback conversationIDList:(NSString* _Nullable)conversationIDList;
|
||||||
- (void)getFriendApplicationList:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)getFriendApplicationList:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
- (void)getFriendList:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)getFriendList:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
- (void)getFriendsInfo:(id<Open_im_sdkBase> _Nullable)callback uidList:(NSString* _Nullable)uidList;
|
- (void)getFriendsInfo:(id<Open_im_sdkBase> _Nullable)callback uidList:(NSString* _Nullable)uidList;
|
||||||
@@ -855,6 +962,7 @@
|
|||||||
// skipped method UserRelated.GroupApplicationProcessedCallback with unsupported parameter or return types
|
// skipped method UserRelated.GroupApplicationProcessedCallback with unsupported parameter or return types
|
||||||
|
|
||||||
- (BOOL)initSDK:(NSString* _Nullable)config cb:(id<Open_im_sdkIMSDKListener> _Nullable)cb;
|
- (BOOL)initSDK:(NSString* _Nullable)config cb:(id<Open_im_sdkIMSDKListener> _Nullable)cb;
|
||||||
|
- (NSString* _Nonnull)insertGroupMessageToLocalStorage:(id<Open_im_sdkBase> _Nullable)callback message:(NSString* _Nullable)message groupID:(NSString* _Nullable)groupID sender:(NSString* _Nullable)sender;
|
||||||
- (NSString* _Nonnull)insertSingleMessageToLocalStorage:(id<Open_im_sdkBase> _Nullable)callback message:(NSString* _Nullable)message userID:(NSString* _Nullable)userID sender:(NSString* _Nullable)sender;
|
- (NSString* _Nonnull)insertSingleMessageToLocalStorage:(id<Open_im_sdkBase> _Nullable)callback message:(NSString* _Nullable)message userID:(NSString* _Nullable)userID sender:(NSString* _Nullable)sender;
|
||||||
- (void)inviteUserToGroup:(NSString* _Nullable)groupId reason:(NSString* _Nullable)reason userList:(NSString* _Nullable)userList callback:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)inviteUserToGroup:(NSString* _Nullable)groupId reason:(NSString* _Nullable)reason userList:(NSString* _Nullable)userList callback:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
- (void)joinGroup:(NSString* _Nullable)groupId message:(NSString* _Nullable)message callback:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)joinGroup:(NSString* _Nullable)groupId message:(NSString* _Nullable)message callback:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
@@ -863,6 +971,9 @@
|
|||||||
- (void)logout:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)logout:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
- (void)markC2CMessageAsRead:(id<Open_im_sdkBase> _Nullable)callback receiver:(NSString* _Nullable)receiver msgIDList:(NSString* _Nullable)msgIDList;
|
- (void)markC2CMessageAsRead:(id<Open_im_sdkBase> _Nullable)callback receiver:(NSString* _Nullable)receiver msgIDList:(NSString* _Nullable)msgIDList;
|
||||||
- (void)markGroupMessageHasRead:(id<Open_im_sdkBase> _Nullable)callback groupID:(NSString* _Nullable)groupID;
|
- (void)markGroupMessageHasRead:(id<Open_im_sdkBase> _Nullable)callback groupID:(NSString* _Nullable)groupID;
|
||||||
|
/**
|
||||||
|
* Deprecated
|
||||||
|
*/
|
||||||
- (void)markSingleMessageHasRead:(id<Open_im_sdkBase> _Nullable)callback userID:(NSString* _Nullable)userID;
|
- (void)markSingleMessageHasRead:(id<Open_im_sdkBase> _Nullable)callback userID:(NSString* _Nullable)userID;
|
||||||
// skipped method UserRelated.OnMemberInvited with unsupported parameter or return types
|
// skipped method UserRelated.OnMemberInvited with unsupported parameter or return types
|
||||||
|
|
||||||
@@ -882,6 +993,7 @@
|
|||||||
- (NSString* _Nonnull)sendMessageNotOss:(id<Open_im_sdkSendMsgCallBack> _Nullable)callback message:(NSString* _Nullable)message receiver:(NSString* _Nullable)receiver groupID:(NSString* _Nullable)groupID onlineUserOnly:(BOOL)onlineUserOnly;
|
- (NSString* _Nonnull)sendMessageNotOss:(id<Open_im_sdkSendMsgCallBack> _Nullable)callback message:(NSString* _Nullable)message receiver:(NSString* _Nullable)receiver groupID:(NSString* _Nullable)groupID onlineUserOnly:(BOOL)onlineUserOnly;
|
||||||
- (void)setConversationDraft:(NSString* _Nullable)conversationID draftText:(NSString* _Nullable)draftText callback:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)setConversationDraft:(NSString* _Nullable)conversationID draftText:(NSString* _Nullable)draftText callback:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
- (void)setConversationListener:(id<Open_im_sdkOnConversationListener> _Nullable)listener;
|
- (void)setConversationListener:(id<Open_im_sdkOnConversationListener> _Nullable)listener;
|
||||||
|
- (void)setConversationRecvMessageOpt:(id<Open_im_sdkBase> _Nullable)callback conversationIDList:(NSString* _Nullable)conversationIDList opt:(long)opt;
|
||||||
- (void)setFriendInfo:(NSString* _Nullable)comment callback:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)setFriendInfo:(NSString* _Nullable)comment callback:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
- (BOOL)setFriendListener:(id<Open_im_sdkOnFriendshipListener> _Nullable)listener;
|
- (BOOL)setFriendListener:(id<Open_im_sdkOnFriendshipListener> _Nullable)listener;
|
||||||
- (void)setGroupInfo:(NSString* _Nullable)jsonGroupInfo callback:(id<Open_im_sdkBase> _Nullable)callback;
|
- (void)setGroupInfo:(NSString* _Nullable)jsonGroupInfo callback:(id<Open_im_sdkBase> _Nullable)callback;
|
||||||
@@ -1046,8 +1158,6 @@ FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdReLogin;
|
|||||||
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdRefuseFriend;
|
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdRefuseFriend;
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUnInit;
|
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUnInit;
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUpdateConversation;
|
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUpdateConversation;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkConAndUnreadChange;
|
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkConChange;
|
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkCreateGroupTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkCreateGroupTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkCustom;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkCustom;
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkDeFaultSuccessMsg;
|
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkDeFaultSuccessMsg;
|
||||||
@@ -1079,7 +1189,6 @@ FOUNDATION_EXPORT const int64_t Open_im_sdkIncrUnread;
|
|||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkInviteUserToGroupTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkInviteUserToGroupTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkJoinGroupTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkJoinGroupTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkKickGroupMemberTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkKickGroupMemberTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkKickOnlineTip;
|
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkLocation;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkLocation;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkLoginFailed;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkLoginFailed;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkLoginSuccess;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkLoginSuccess;
|
||||||
@@ -1087,8 +1196,6 @@ FOUNDATION_EXPORT const int64_t Open_im_sdkLogining;
|
|||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkLogoutCmd;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkLogoutCmd;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMaxTotalMsgLen;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkMaxTotalMsgLen;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMerger;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkMerger;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMessageHasNotRead;
|
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMessageHasRead;
|
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusHasDeleted;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusHasDeleted;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusRevoked;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusRevoked;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSendFailed;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSendFailed;
|
||||||
@@ -1097,13 +1204,24 @@ FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSendSuccess;
|
|||||||
* MsgStatus
|
* MsgStatus
|
||||||
*/
|
*/
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSending;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSending;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkNewCon;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkNewConChange;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkNotPinned;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkNotRead;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkNotRead;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkNotReceiveMessage;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkPicture;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkPicture;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkPinned;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkQuitGroupTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkQuitGroupTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkQuote;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkQuote;
|
||||||
|
/**
|
||||||
|
* MsgReceiveOpt
|
||||||
|
*/
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkReceiveMessage;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkReceiveNotNotifyMessage;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseFriendApplicationTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseFriendApplicationTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseGroupApplicationTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseGroupApplicationTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkRevoke;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkRevoke;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkSdkInit;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkSetGroupInfoTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkSetGroupInfoTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkSetSelfInfoTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkSetSelfInfoTip;
|
||||||
/**
|
/**
|
||||||
@@ -1116,27 +1234,32 @@ FOUNDATION_EXPORT const int64_t Open_im_sdkSingleChatType;
|
|||||||
*/
|
*/
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipBegin;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipBegin;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipEnd;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipEnd;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkSound;
|
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkSysMsgType;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkSysMsgType;
|
||||||
/**
|
/**
|
||||||
* ContentType
|
* ContentType
|
||||||
*/
|
*/
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkText;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkText;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkTimeOffset;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkTimeOffset;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedExpired;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedInvalid;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedKickedOffline;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkTotalUnreadMessageChanged;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkTotalUnreadMessageChanged;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkTransferGroupOwnerTip;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkTransferGroupOwnerTip;
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkTransferGroupTip;
|
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkTransferGroupTip;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkTyping;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkTyping;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkUnreadCountSetZero;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkUnreadCountSetZero;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkUpdateFaceUrlAndNickName;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkUpdateFaceUrlAndNickName;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkUpdateLatestMessageChange;
|
||||||
/**
|
/**
|
||||||
* //////////////////////////////////////
|
* //////////////////////////////////////
|
||||||
MsgFrom
|
MsgFrom
|
||||||
*/
|
*/
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkUserMsgType;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkUserMsgType;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkVideo;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkVideo;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkVoice;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkWSDataError;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkWSDataError;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkWSGetNewestSeq;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkWSGetNewestSeq;
|
||||||
|
FOUNDATION_EXPORT const int64_t Open_im_sdkWSKickOnlineMsg;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsg;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsg;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsgBySeqList;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsgBySeqList;
|
||||||
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPushMsg;
|
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPushMsg;
|
||||||
@@ -1167,6 +1290,176 @@ FOUNDATION_EXPORT void Open_im_sdkAddToBlackList(id<Open_im_sdkBase> _Nullable c
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable uidList);
|
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable uidList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* func (u *UserRelated) pullOldMsgAndMergeNewMsgByWs(beginSeq int64, endSeq int64) (err error) {
|
||||||
|
LogBegin(beginSeq, endSeq)
|
||||||
|
if beginSeq > endSeq {
|
||||||
|
LogSReturn(nil)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
LogBegin("AddCh")
|
||||||
|
msgIncr, ch := u.AddCh()
|
||||||
|
|
||||||
|
var wsReq GeneralWsReq
|
||||||
|
wsReq.ReqIdentifier = WSPullMsgBySeqList
|
||||||
|
wsReq.OperationID = operationIDGenerator()
|
||||||
|
wsReq.SendID = u.LoginUid
|
||||||
|
//wsReq.Token = u.token
|
||||||
|
wsReq.MsgIncr = msgIncr
|
||||||
|
|
||||||
|
var pullMsgReq PullMessageBySeqListReq
|
||||||
|
LogBegin("getNoInSeq ", beginSeq, endSeq)
|
||||||
|
pullMsgReq.SeqList = u.getNotInSeq(beginSeq, endSeq)
|
||||||
|
LogEnd("getNoInSeq ", pullMsgReq.SeqList)
|
||||||
|
|
||||||
|
wsReq.Data, err = proto.Marshal(&pullMsgReq)
|
||||||
|
if err != nil {
|
||||||
|
sdkLog("Marshl failed ")
|
||||||
|
LogFReturn(err.Error())
|
||||||
|
u.DelCh(msgIncr)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
LogBegin("WriteMsg ", wsReq.OperationID)
|
||||||
|
err, _ = u.WriteMsg(wsReq)
|
||||||
|
LogEnd("WriteMsg ", wsReq.OperationID, err)
|
||||||
|
if err != nil {
|
||||||
|
sdkLog("close conn, WriteMsg failed ", err.Error())
|
||||||
|
u.DelCh(msgIncr)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := 10
|
||||||
|
select {
|
||||||
|
case r := <-ch:
|
||||||
|
sdkLog("ws ch recvMsg success: ", wsReq.OperationID)
|
||||||
|
if r.ErrCode != 0 {
|
||||||
|
sdkLog("pull msg failed ", r.ErrCode, r.ErrMsg, wsReq.OperationID)
|
||||||
|
u.DelCh(msgIncr)
|
||||||
|
return errors.New(r.ErrMsg)
|
||||||
|
} else {
|
||||||
|
sdkLog("pull msg success ", wsReq.OperationID)
|
||||||
|
var pullMsg PullUserMsgResp
|
||||||
|
|
||||||
|
pullMsg.ErrCode = 0
|
||||||
|
|
||||||
|
var pullMsgResp PullMessageBySeqListResp
|
||||||
|
err := proto.Unmarshal(r.Data, &pullMsgResp)
|
||||||
|
if err != nil {
|
||||||
|
sdkLog("Unmarshal failed ", err.Error())
|
||||||
|
LogFReturn(err.Error())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
pullMsg.Data.Group = pullMsgResp.GroupUserMsg
|
||||||
|
pullMsg.Data.Single = pullMsgResp.SingleUserMsg
|
||||||
|
pullMsg.Data.MaxSeq = pullMsgResp.MaxSeq
|
||||||
|
pullMsg.Data.MinSeq = pullMsgResp.MinSeq
|
||||||
|
|
||||||
|
u.seqMsgMutex.Lock()
|
||||||
|
|
||||||
|
arrMsg := ArrMsg{}
|
||||||
|
isInmap := false
|
||||||
|
for i := 0; i < len(pullMsg.Data.Single); i++ {
|
||||||
|
for j := 0; j < len(pullMsg.Data.Single[i].List); j++ {
|
||||||
|
sdkLog("open_im pull one msg: |", pullMsg.Data.Single[i].List[j].ClientMsgID, "|")
|
||||||
|
singleMsg := MsgData{
|
||||||
|
SendID: pullMsg.Data.Single[i].List[j].SendID,
|
||||||
|
RecvID: pullMsg.Data.Single[i].List[j].RecvID,
|
||||||
|
SessionType: SingleChatType,
|
||||||
|
MsgFrom: pullMsg.Data.Single[i].List[j].MsgFrom,
|
||||||
|
ContentType: pullMsg.Data.Single[i].List[j].ContentType,
|
||||||
|
ServerMsgID: pullMsg.Data.Single[i].List[j].ServerMsgID,
|
||||||
|
Content: pullMsg.Data.Single[i].List[j].Content,
|
||||||
|
SendTime: pullMsg.Data.Single[i].List[j].SendTime,
|
||||||
|
Seq: pullMsg.Data.Single[i].List[j].Seq,
|
||||||
|
SenderNickName: pullMsg.Data.Single[i].List[j].SenderNickName,
|
||||||
|
SenderFaceURL: pullMsg.Data.Single[i].List[j].SenderFaceURL,
|
||||||
|
ClientMsgID: pullMsg.Data.Single[i].List[j].ClientMsgID,
|
||||||
|
SenderPlatformID: pullMsg.Data.Single[i].List[j].SenderPlatformID,
|
||||||
|
}
|
||||||
|
// arrMsg.SingleData = append(arrMsg.SingleData, singleMsg)
|
||||||
|
u.seqMsg[pullMsg.Data.Single[i].List[j].Seq] = singleMsg
|
||||||
|
sdkLog("into map, seq: ", pullMsg.Data.Single[i].List[j].Seq, pullMsg.Data.Single[i].List[j].ClientMsgID, pullMsg.Data.Single[i].List[j].ServerMsgID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(pullMsg.Data.Group); i++ {
|
||||||
|
for j := 0; j < len(pullMsg.Data.Group[i].List); j++ {
|
||||||
|
groupMsg := MsgData{
|
||||||
|
SendID: pullMsg.Data.Group[i].List[j].SendID,
|
||||||
|
RecvID: pullMsg.Data.Group[i].List[j].RecvID,
|
||||||
|
SessionType: GroupChatType,
|
||||||
|
MsgFrom: pullMsg.Data.Group[i].List[j].MsgFrom,
|
||||||
|
ContentType: pullMsg.Data.Group[i].List[j].ContentType,
|
||||||
|
ServerMsgID: pullMsg.Data.Group[i].List[j].ServerMsgID,
|
||||||
|
Content: pullMsg.Data.Group[i].List[j].Content,
|
||||||
|
SendTime: pullMsg.Data.Group[i].List[j].SendTime,
|
||||||
|
Seq: pullMsg.Data.Group[i].List[j].Seq,
|
||||||
|
SenderNickName: pullMsg.Data.Group[i].List[j].SenderNickName,
|
||||||
|
SenderFaceURL: pullMsg.Data.Group[i].List[j].SenderFaceURL,
|
||||||
|
ClientMsgID: pullMsg.Data.Group[i].List[j].ClientMsgID,
|
||||||
|
SenderPlatformID: pullMsg.Data.Group[i].List[j].SenderPlatformID,
|
||||||
|
}
|
||||||
|
// arrMsg.GroupData = append(arrMsg.GroupData, groupMsg)
|
||||||
|
u.seqMsg[pullMsg.Data.Group[i].List[j].Seq] = groupMsg
|
||||||
|
sdkLog("into map, seq: ", pullMsg.Data.Group[i].List[j].Seq, pullMsg.Data.Group[i].List[j].ClientMsgID, pullMsg.Data.Group[i].List[j].ServerMsgID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
u.seqMsgMutex.Unlock()
|
||||||
|
|
||||||
|
u.seqMsgMutex.RLock()
|
||||||
|
for i := beginSeq; i <= endSeq; i++ {
|
||||||
|
v, ok := u.seqMsg[i]
|
||||||
|
if ok {
|
||||||
|
if v.SessionType == SingleChatType {
|
||||||
|
arrMsg.SingleData = append(arrMsg.SingleData, v)
|
||||||
|
sdkLog("pull seq: ", v.Seq, v)
|
||||||
|
if v.ContentType > SingleTipBegin && v.ContentType < SingleTipEnd {
|
||||||
|
var msgRecv MsgData
|
||||||
|
msgRecv.ContentType = v.ContentType
|
||||||
|
msgRecv.Content = v.Content
|
||||||
|
msgRecv.SendID = v.SendID
|
||||||
|
msgRecv.RecvID = v.RecvID
|
||||||
|
LogBegin("doFriendMsg ", msgRecv)
|
||||||
|
u.doFriendMsg(msgRecv)
|
||||||
|
LogEnd("doFriendMsg ", msgRecv)
|
||||||
|
}
|
||||||
|
} else if v.SessionType == GroupChatType {
|
||||||
|
sdkLog("pull seq: ", v.Seq, v)
|
||||||
|
arrMsg.GroupData = append(arrMsg.GroupData, v)
|
||||||
|
if v.ContentType > GroupTipBegin && v.ContentType < GroupTipEnd {
|
||||||
|
LogBegin("doGroupMsg ", v)
|
||||||
|
u.doGroupMsg(v)
|
||||||
|
LogEnd("doGroupMsg ", v)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sdkLog("type failed, ", v.SessionType, v)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sdkLog("seq no in map, failed, seq: ", i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
u.seqMsgMutex.RUnlock()
|
||||||
|
|
||||||
|
sdkLog("triggerCmdNewMsgCome len: ", len(arrMsg.SingleData), len(arrMsg.GroupData))
|
||||||
|
err = u.triggerCmdNewMsgCome(arrMsg)
|
||||||
|
if err != nil {
|
||||||
|
sdkLog("triggerCmdNewMsgCome failed, ", err.Error())
|
||||||
|
}
|
||||||
|
u.DelCh(msgIncr)
|
||||||
|
}
|
||||||
|
case <-time.After(time.Second * time.Duration(timeout)):
|
||||||
|
sdkLog("ws ch recvMsg timeout,", wsReq.OperationID)
|
||||||
|
u.DelCh(msgIncr)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
FOUNDATION_EXPORT long Open_im_sdkCheckToken(NSString* _Nullable uId, NSString* _Nullable token);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable userID);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable groupID);
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable cardInfo);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable cardInfo);
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
|
||||||
@@ -1209,6 +1502,12 @@ FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString
|
|||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
|
||||||
|
|
||||||
|
// skipped function Debug with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function DebugByKv with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(NSString* _Nullable conversationID, id<Open_im_sdkBase> _Nullable callback);
|
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(NSString* _Nullable conversationID, id<Open_im_sdkBase> _Nullable callback);
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkDeleteFromBlackList(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable deleteUid);
|
FOUNDATION_EXPORT void Open_im_sdkDeleteFromBlackList(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable deleteUid);
|
||||||
@@ -1217,6 +1516,15 @@ FOUNDATION_EXPORT void Open_im_sdkDeleteFromFriendList(NSString* _Nullable delet
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable message);
|
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable message);
|
||||||
|
|
||||||
|
// skipped function Error with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function ErrorByArgs with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function ErrorByKv with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkFindMessages(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable messageIDList);
|
FOUNDATION_EXPORT void Open_im_sdkFindMessages(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable messageIDList);
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkForceSyncLoginUerInfo(void);
|
FOUNDATION_EXPORT void Open_im_sdkForceSyncLoginUerInfo(void);
|
||||||
@@ -1229,6 +1537,10 @@ FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdkBase> _Nullable cal
|
|||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdkBase> _Nullable callback, long offset, long count);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable conversationIDList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current timestamp by Mill
|
* Get the current timestamp by Mill
|
||||||
*/
|
*/
|
||||||
@@ -1266,6 +1578,15 @@ FOUNDATION_EXPORT Open_im_sdkUserRelated* _Nullable Open_im_sdkGetUserWorker(NSS
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(NSString* _Nullable uIDList, id<Open_im_sdkBase> _Nullable cb);
|
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(NSString* _Nullable uIDList, id<Open_im_sdkBase> _Nullable cb);
|
||||||
|
|
||||||
|
// skipped function Info with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function InfoByArgs with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function InfoByKv with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT BOOL Open_im_sdkInitOnce(Open_im_sdkIMConfig* _Nullable config);
|
FOUNDATION_EXPORT BOOL Open_im_sdkInitOnce(Open_im_sdkIMConfig* _Nullable config);
|
||||||
|
|
||||||
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(NSString* _Nullable config, id<Open_im_sdkIMSDKListener> _Nullable cb);
|
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(NSString* _Nullable config, id<Open_im_sdkIMSDKListener> _Nullable cb);
|
||||||
@@ -1274,6 +1595,8 @@ FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkInsertSingleMessageToLocalStorag
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id<Open_im_sdkBase> _Nullable callback);
|
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id<Open_im_sdkBase> _Nullable callback);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT BOOL Open_im_sdkIsNil(void);
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(NSString* _Nullable groupId, NSString* _Nullable message, id<Open_im_sdkBase> _Nullable callback);
|
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(NSString* _Nullable groupId, NSString* _Nullable message, id<Open_im_sdkBase> _Nullable callback);
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id<Open_im_sdkBase> _Nullable callback);
|
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id<Open_im_sdkBase> _Nullable callback);
|
||||||
@@ -1301,10 +1624,36 @@ FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdkBase> _Null
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable groupID);
|
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable groupID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated
|
||||||
|
*/
|
||||||
FOUNDATION_EXPORT void Open_im_sdkMarkSingleMessageHasRead(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable userID);
|
FOUNDATION_EXPORT void Open_im_sdkMarkSingleMessageHasRead(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable userID);
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkMd5(NSString* _Nullable s);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkMd5(NSString* _Nullable s);
|
||||||
|
|
||||||
|
// skipped function NewDebug with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function NewError with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function NewInfo with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function NewLfsHook with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* func init() {
|
||||||
|
logger = loggerInit("")
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
FOUNDATION_EXPORT void Open_im_sdkNewPrivateLog(NSString* _Nullable moduleName);
|
||||||
|
|
||||||
|
// skipped function NewWarn with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkPinConversation(NSString* _Nullable conversationID, BOOL isPinned, id<Open_im_sdkBase> _Nullable callback);
|
FOUNDATION_EXPORT void Open_im_sdkPinConversation(NSString* _Nullable conversationID, BOOL isPinned, id<Open_im_sdkBase> _Nullable callback);
|
||||||
|
|
||||||
// skipped function Post2Api with unsupported parameter or return types
|
// skipped function Post2Api with unsupported parameter or return types
|
||||||
@@ -1330,6 +1679,8 @@ FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(NSString* _Nullable conve
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdkOnConversationListener> _Nullable listener);
|
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdkOnConversationListener> _Nullable listener);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable conversationIDList, long opt);
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetFriendInfo(NSString* _Nullable comment, id<Open_im_sdkBase> _Nullable callback);
|
FOUNDATION_EXPORT void Open_im_sdkSetFriendInfo(NSString* _Nullable comment, id<Open_im_sdkBase> _Nullable callback);
|
||||||
|
|
||||||
FOUNDATION_EXPORT BOOL Open_im_sdkSetFriendListener(id<Open_im_sdkOnFriendshipListener> _Nullable listener);
|
FOUNDATION_EXPORT BOOL Open_im_sdkSetFriendListener(id<Open_im_sdkOnFriendshipListener> _Nullable listener);
|
||||||
@@ -1338,6 +1689,8 @@ FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(NSString* _Nullable jsonGroupInfo
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdkOnGroupListener> _Nullable callback);
|
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdkOnGroupListener> _Nullable callback);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT void Open_im_sdkSetHearbeatInterval(int32_t interval);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1 no print
|
* 1 no print
|
||||||
*/
|
*/
|
||||||
@@ -1356,6 +1709,12 @@ FOUNDATION_EXPORT void Open_im_sdkUnInitSDK(void);
|
|||||||
// skipped function UnixSecondToTime with unsupported parameter or return types
|
// skipped function UnixSecondToTime with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function WarnByKv with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
|
// skipped function Warning with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
@class Open_im_sdkBase;
|
@class Open_im_sdkBase;
|
||||||
|
|
||||||
@class Open_im_sdkIMSDKListener;
|
@class Open_im_sdkIMSDKListener;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export 'src/manager/im_manager.dart';
|
|||||||
export 'src/manager/im_message_manager.dart';
|
export 'src/manager/im_message_manager.dart';
|
||||||
export 'src/manager/im_offline_push_manager.dart';
|
export 'src/manager/im_offline_push_manager.dart';
|
||||||
export 'src/manager/im_signaling_manager.dart';
|
export 'src/manager/im_signaling_manager.dart';
|
||||||
export 'src/manager/v2/im_message_manager_v2.dart';
|
|
||||||
export 'src/models/conversation_info.dart';
|
export 'src/models/conversation_info.dart';
|
||||||
export 'src/models/group_info.dart';
|
export 'src/models/group_info.dart';
|
||||||
export 'src/models/message.dart';
|
export 'src/models/message.dart';
|
||||||
|
|||||||
@@ -12,19 +12,39 @@ class ConversationManager {
|
|||||||
ConversationManager(this._channel);
|
ConversationManager(this._channel);
|
||||||
|
|
||||||
/// Observe conversation changes
|
/// Observe conversation changes
|
||||||
|
/// 会话监听
|
||||||
Future setConversationListener(ConversationListener listener) {
|
Future setConversationListener(ConversationListener listener) {
|
||||||
this.conversationListener = listener;
|
this.conversationListener = listener;
|
||||||
return _channel.invokeMethod('setConversationListener', _buildParam({}));
|
return _channel.invokeMethod('setConversationListener', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all conversations
|
/// Get all conversations
|
||||||
|
/// 获取所有会话
|
||||||
Future<List<ConversationInfo>> getAllConversationList() => _channel
|
Future<List<ConversationInfo>> getAllConversationList() => _channel
|
||||||
.invokeMethod('getAllConversationList', _buildParam({}))
|
.invokeMethod('getAllConversationList', _buildParam({}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
|
|
||||||
|
/// Paging to get conversation
|
||||||
|
/// 分页获取会话, [offset]下次获取开始index
|
||||||
|
Future<List<ConversationInfo>> getConversationListSplit({
|
||||||
|
int offset = 0,
|
||||||
|
int count = 20,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getConversationListSplit',
|
||||||
|
_buildParam({
|
||||||
|
'offset': offset,
|
||||||
|
'count': count,
|
||||||
|
}))
|
||||||
|
.then((value) => _toList(value));
|
||||||
|
|
||||||
/// Get a single conversation info
|
/// Get a single conversation info
|
||||||
/// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
|
/// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
|
||||||
/// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2
|
/// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2
|
||||||
|
/// 获取单个会话
|
||||||
|
/// [sourceID]如果是单聊值传用户id,如果是群聊值传组id
|
||||||
|
/// [sessionType]如果是单聊值传1,如果是群聊值传2
|
||||||
Future<ConversationInfo> getSingleConversation({
|
Future<ConversationInfo> getSingleConversation({
|
||||||
required String sourceID,
|
required String sourceID,
|
||||||
required int sessionType,
|
required int sessionType,
|
||||||
@@ -39,6 +59,7 @@ class ConversationManager {
|
|||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
|
|
||||||
/// Get conversation list by id list
|
/// Get conversation list by id list
|
||||||
|
/// 获取多个会话
|
||||||
Future<List<ConversationInfo>> getMultipleConversation({
|
Future<List<ConversationInfo>> getMultipleConversation({
|
||||||
required List<String> conversationIDList,
|
required List<String> conversationIDList,
|
||||||
}) =>
|
}) =>
|
||||||
@@ -51,6 +72,7 @@ class ConversationManager {
|
|||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
|
|
||||||
/// Delete conversation by id
|
/// Delete conversation by id
|
||||||
|
/// 删除会话
|
||||||
Future deleteConversation({
|
Future deleteConversation({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
}) =>
|
}) =>
|
||||||
@@ -63,6 +85,7 @@ class ConversationManager {
|
|||||||
.then((value) => _printValue(value));
|
.then((value) => _printValue(value));
|
||||||
|
|
||||||
/// Set draft
|
/// Set draft
|
||||||
|
/// 设置会话草稿
|
||||||
Future setConversationDraft({
|
Future setConversationDraft({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
required String draftText,
|
required String draftText,
|
||||||
@@ -77,6 +100,7 @@ class ConversationManager {
|
|||||||
.then((value) => _printValue(value));
|
.then((value) => _printValue(value));
|
||||||
|
|
||||||
/// Pinned conversation
|
/// Pinned conversation
|
||||||
|
/// 置顶会话
|
||||||
Future pinConversation({
|
Future pinConversation({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
required bool isPinned,
|
required bool isPinned,
|
||||||
@@ -91,36 +115,93 @@ class ConversationManager {
|
|||||||
.then((value) => _printValue(value));
|
.then((value) => _printValue(value));
|
||||||
|
|
||||||
/// Mark single chat messages as read
|
/// Mark single chat messages as read
|
||||||
Future<dynamic> markSingleMessageHasRead({required String userID}) {
|
/// 标记单聊已读
|
||||||
return _channel.invokeMethod(
|
Future<dynamic> markSingleMessageHasRead({required String userID}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
'markSingleMessageHasRead', _buildParam({'userID': userID}));
|
'markSingleMessageHasRead', _buildParam({'userID': userID}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Mark group chat messages as read
|
/// Mark group chat messages as read
|
||||||
Future<dynamic> markGroupMessageHasRead({required String groupID}) {
|
/// 标记群聊已读
|
||||||
return _channel.invokeMethod(
|
Future<dynamic> markGroupMessageHasRead({required String groupID}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
'markGroupMessageHasRead', _buildParam({'groupID': groupID}));
|
'markGroupMessageHasRead', _buildParam({'groupID': groupID}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the total number of unread messages
|
/// Get the total number of unread messages
|
||||||
Future<dynamic> getTotalUnreadMsgCount() {
|
/// 获取未读消息总数
|
||||||
return _channel.invokeMethod('getTotalUnreadMsgCount', _buildParam({}));
|
Future<dynamic> getTotalUnreadMsgCount() =>
|
||||||
}
|
_channel.invokeMethod('getTotalUnreadMsgCount', _buildParam({}));
|
||||||
|
|
||||||
/// Query conversation id
|
/// Query conversation id
|
||||||
/// [sourceID] : if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
|
/// [sourceID] : if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
|
||||||
/// [sessionType] : if it is a single chat, it value is 1. if it is a group chat, it value is 2
|
/// [sessionType] : if it is a single chat, it value is 1. if it is a group chat, it value is 2
|
||||||
|
/// 查询会话id
|
||||||
|
/// [sourceID]如果是单聊值传用户id,如果是群聊值传组id
|
||||||
|
/// [sessionType]如果是单聊值传1,如果是群聊值传2
|
||||||
Future<dynamic> getConversationID({
|
Future<dynamic> getConversationID({
|
||||||
required String sourceID,
|
required String sourceID,
|
||||||
required int sessionType,
|
required int sessionType,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'getConversationIDBySessionType',
|
'getConversationIDBySessionType',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"sourceID": sourceID,
|
"sourceID": sourceID,
|
||||||
"sessionType": sessionType,
|
"sessionType": sessionType,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
/// Message Do Not Disturb
|
||||||
|
/// [status] 1: Do not receive messages, 2: Do not notify when messages are received; 0: Normal
|
||||||
|
/// 消息免打扰设置
|
||||||
|
/// [status] 1:不接受消息;2:接受在线消息不接受离线消息;3:正常
|
||||||
|
Future<dynamic> setConversationRecvMessageOpt({
|
||||||
|
required List<String> conversationIDList,
|
||||||
|
required int status,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'setConversationRecvMessageOpt',
|
||||||
|
_buildParam({
|
||||||
|
"conversationIDList": conversationIDList,
|
||||||
|
"status": status,
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Message Do Not Disturb
|
||||||
|
/// [{"conversationId":"single_13922222222","result":0}]
|
||||||
|
/// 查询免打扰状态
|
||||||
|
Future<List<dynamic>> getConversationRecvMessageOpt({
|
||||||
|
required List<String> conversationIDList,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getConversationRecvMessageOpt',
|
||||||
|
_buildParam({
|
||||||
|
"conversationIDList": conversationIDList,
|
||||||
|
}))
|
||||||
|
.then((value) => _formatJson(value));
|
||||||
|
|
||||||
|
/// Custom sort for conversation list
|
||||||
|
/// 会话列表自定义排序规则
|
||||||
|
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
||||||
|
..sort((a, b) {
|
||||||
|
if ((a.isPinned == 1 && b.isPinned == 1) ||
|
||||||
|
(a.isPinned != 1 && b.isPinned != 1)) {
|
||||||
|
int aCompare = a.draftTimestamp! > a.latestMsgSendTime!
|
||||||
|
? a.draftTimestamp!
|
||||||
|
: a.latestMsgSendTime!;
|
||||||
|
int bCompare = b.draftTimestamp! > b.latestMsgSendTime!
|
||||||
|
? b.draftTimestamp!
|
||||||
|
: b.latestMsgSendTime!;
|
||||||
|
if (aCompare > bCompare) {
|
||||||
|
return -1;
|
||||||
|
} else if (aCompare < bCompare) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
} else if (a.isPinned == 1 && b.isPinned != 1) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "conversationManager";
|
param["ManagerName"] = "conversationManager";
|
||||||
@@ -136,9 +217,7 @@ class ConversationManager {
|
|||||||
static ConversationInfo _toObj(String value) =>
|
static ConversationInfo _toObj(String value) =>
|
||||||
ConversationInfo.fromJson(_formatJson(value));
|
ConversationInfo.fromJson(_formatJson(value));
|
||||||
|
|
||||||
static dynamic _formatJson(value) {
|
static dynamic _formatJson(value) => jsonDecode(_printValue(value));
|
||||||
return jsonDecode(_printValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static String _printValue(value) {
|
static String _printValue(value) {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -10,98 +10,90 @@ class FriendshipManager {
|
|||||||
FriendshipManager(this._channel);
|
FriendshipManager(this._channel);
|
||||||
|
|
||||||
/// Set up a friend relationship listener
|
/// Set up a friend relationship listener
|
||||||
|
/// 好友关系监听
|
||||||
Future setFriendshipListener(FriendshipListener listener) {
|
Future setFriendshipListener(FriendshipListener listener) {
|
||||||
this.friendshipListener = listener;
|
this.friendshipListener = listener;
|
||||||
return _channel.invokeMethod('setFriendListener', _buildParam({}));
|
return _channel.invokeMethod('setFriendListener', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get friend info by user id
|
/// Get friend info by user id
|
||||||
Future<List<UserInfo>> getFriendsInfo({required List<String> uidList}) {
|
/// 查询好友信息
|
||||||
return _channel
|
Future<List<UserInfo>> getFriendsInfo({required List<String> uidList}) =>
|
||||||
|
_channel
|
||||||
.invokeMethod('getFriendsInfo', _buildParam({"uidList": uidList}))
|
.invokeMethod('getFriendsInfo', _buildParam({"uidList": uidList}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Send an friend application
|
/// Send an friend application
|
||||||
Future<dynamic> addFriend({required String uid, required String reason}) {
|
/// 发送一个好友请求
|
||||||
return _channel.invokeMethod(
|
Future<dynamic> addFriend({required String uid, required String reason}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
'addFriend', _buildParam({"uid": uid, "reqMessage": reason}));
|
'addFriend', _buildParam({"uid": uid, "reqMessage": reason}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Get all friend application, sent to you by others
|
/// Get all friend application, sent to you by others
|
||||||
Future<List<UserInfo>> getFriendApplicationList() {
|
/// 获取所有好友申请
|
||||||
return _channel
|
Future<List<UserInfo>> getFriendApplicationList() => _channel
|
||||||
.invokeMethod('getFriendApplicationList', _buildParam({}))
|
.invokeMethod('getFriendApplicationList', _buildParam({}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Find all friends including those who have been added to the blacklist
|
/// Find all friends including those who have been added to the blacklist
|
||||||
Future<List<UserInfo>> getFriendList() {
|
/// 获取好友列表包含已拉入黑名单的好友
|
||||||
return _channel
|
Future<List<UserInfo>> getFriendList() => _channel
|
||||||
.invokeMethod('getFriendList', _buildParam({}))
|
.invokeMethod('getFriendList', _buildParam({}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Find all friends including those who have been added to the blacklist
|
/// Find all friends including those who have been added to the blacklist
|
||||||
Future<List<dynamic>> getFriendListMap() {
|
/// 获取好友列表
|
||||||
return _channel
|
Future<List<dynamic>> getFriendListMap() => _channel
|
||||||
.invokeMethod('getFriendList', _buildParam({}))
|
.invokeMethod('getFriendList', _buildParam({}))
|
||||||
.then((value) => _toListMap(value));
|
.then((value) => _toListMap(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Modify friend information, only [comment] can be modified
|
/// Modify friend information, only [comment] can be modified
|
||||||
|
/// 设置好友备注
|
||||||
Future<dynamic> setFriendInfo(
|
Future<dynamic> setFriendInfo(
|
||||||
{required String uid, required String comment}) {
|
{required String uid, required String comment}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'setFriendInfo',
|
'setFriendInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'uid': uid,
|
'uid': uid,
|
||||||
'comment': comment,
|
'comment': comment,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Add friends to blacklist
|
/// Add friends to blacklist
|
||||||
Future<dynamic> addToBlackList({required String uid}) {
|
/// 加入黑名单
|
||||||
return _channel.invokeMethod('addToBlackList', _buildParam({"uid": uid}));
|
Future<dynamic> addToBlackList({required String uid}) =>
|
||||||
}
|
_channel.invokeMethod('addToBlackList', _buildParam({"uid": uid}));
|
||||||
|
|
||||||
/// Find all blacklist
|
/// Find all blacklist
|
||||||
Future<List<UserInfo>> getBlackList() {
|
/// 获取黑名单列表
|
||||||
return _channel
|
Future<List<UserInfo>> getBlackList() => _channel
|
||||||
.invokeMethod('getBlackList', _buildParam({}))
|
.invokeMethod('getBlackList', _buildParam({}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Remove from blacklist
|
/// Remove from blacklist
|
||||||
Future<dynamic> deleteFromBlackList({required String uid}) {
|
/// 从黑名单移除
|
||||||
return _channel.invokeMethod(
|
Future<dynamic> deleteFromBlackList({required String uid}) =>
|
||||||
'deleteFromBlackList', _buildParam({"uid": uid}));
|
_channel.invokeMethod('deleteFromBlackList', _buildParam({"uid": uid}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Determine if there is a friendship by userId
|
/// Determine if there is a friendship by userId
|
||||||
Future<List<UserInfo>> checkFriend(List<String> uidList) {
|
/// 检查友好关系
|
||||||
return _channel
|
Future<List<UserInfo>> checkFriend(List<String> uidList) => _channel
|
||||||
.invokeMethod('checkFriend', _buildParam({'uidList': uidList}))
|
.invokeMethod('checkFriend', _buildParam({'uidList': uidList}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Dissolve friendship from friend list
|
/// Dissolve friendship from friend list
|
||||||
Future<dynamic> deleteFromFriendList({required String uid}) {
|
/// 删除好友
|
||||||
return _channel.invokeMethod(
|
Future<dynamic> deleteFromFriendList({required String uid}) =>
|
||||||
'deleteFromFriendList', _buildParam({"uid": uid}));
|
_channel.invokeMethod('deleteFromFriendList', _buildParam({"uid": uid}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Accept application of be friend
|
/// Accept application of be friend
|
||||||
Future<dynamic> acceptFriendApplication({required String uid}) {
|
/// 接受好友请求
|
||||||
return _channel.invokeMethod(
|
Future<dynamic> acceptFriendApplication({required String uid}) => _channel
|
||||||
'acceptFriendApplication', _buildParam({"uid": uid}));
|
.invokeMethod('acceptFriendApplication', _buildParam({"uid": uid}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Refuse application of be friend
|
/// Refuse application of be friend
|
||||||
Future<dynamic> refuseFriendApplication({required String uid}) {
|
/// 拒绝好友请求
|
||||||
return _channel.invokeMethod(
|
Future<dynamic> refuseFriendApplication({required String uid}) => _channel
|
||||||
'refuseFriendApplication', _buildParam({"uid": uid}));
|
.invokeMethod('refuseFriendApplication', _buildParam({"uid": uid}));
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Future<dynamic> forceSyncFriendApplication() {
|
// Future<dynamic> forceSyncFriendApplication() {
|
||||||
@@ -136,9 +128,7 @@ class FriendshipManager {
|
|||||||
|
|
||||||
// static UserInfo _toObj(String value) => UserInfo.fromJson(_formatJson(value));
|
// static UserInfo _toObj(String value) => UserInfo.fromJson(_formatJson(value));
|
||||||
|
|
||||||
static dynamic _formatJson(value) {
|
static dynamic _formatJson(value) => jsonDecode(_printValue(value));
|
||||||
return jsonDecode(_printValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static String _printValue(value) {
|
static String _printValue(value) {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -11,18 +11,20 @@ class GroupManager {
|
|||||||
GroupManager(this._channel);
|
GroupManager(this._channel);
|
||||||
|
|
||||||
/// Set up group relationship monitoring
|
/// Set up group relationship monitoring
|
||||||
|
/// 组关系监听
|
||||||
Future setGroupListener(GroupListener listener) {
|
Future setGroupListener(GroupListener listener) {
|
||||||
this.groupListener = listener;
|
this.groupListener = listener;
|
||||||
return _channel.invokeMethod('setGroupListener', _buildParam({}));
|
return _channel.invokeMethod('setGroupListener', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Invite friends into the group
|
/// Invite friends into the group
|
||||||
|
/// 邀请进组,直接进组无需同意。
|
||||||
Future<List<GroupInviteResult>> inviteUserToGroup({
|
Future<List<GroupInviteResult>> inviteUserToGroup({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
required List<String> uidList,
|
required List<String> uidList,
|
||||||
String? reason,
|
String? reason,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'inviteUserToGroup',
|
'inviteUserToGroup',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -33,15 +35,15 @@ class GroupManager {
|
|||||||
.then((value) => (_formatJson(value) as List)
|
.then((value) => (_formatJson(value) as List)
|
||||||
.map((e) => GroupInviteResult.fromJson(e))
|
.map((e) => GroupInviteResult.fromJson(e))
|
||||||
.toList());
|
.toList());
|
||||||
}
|
|
||||||
|
|
||||||
/// Remove member from group
|
/// Remove member from group
|
||||||
|
/// 移除组成员
|
||||||
Future<List<GroupInviteResult>> kickGroupMember({
|
Future<List<GroupInviteResult>> kickGroupMember({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
required List<String> uidList,
|
required List<String> uidList,
|
||||||
String? reason,
|
String? reason,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'kickGroupMember',
|
'kickGroupMember',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -52,14 +54,14 @@ class GroupManager {
|
|||||||
.then((value) => (_formatJson(value) as List)
|
.then((value) => (_formatJson(value) as List)
|
||||||
.map((e) => GroupInviteResult.fromJson(e))
|
.map((e) => GroupInviteResult.fromJson(e))
|
||||||
.toList());
|
.toList());
|
||||||
}
|
|
||||||
|
|
||||||
/// Get group member's info
|
/// Get group member's info
|
||||||
|
/// 查询组成员资料
|
||||||
Future<List<GroupMembersInfo>> getGroupMembersInfo({
|
Future<List<GroupMembersInfo>> getGroupMembersInfo({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
required List<String> uidList,
|
required List<String> uidList,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'getGroupMembersInfo',
|
'getGroupMembersInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -69,17 +71,17 @@ class GroupManager {
|
|||||||
.then((value) => (_formatJson(value) as List)
|
.then((value) => (_formatJson(value) as List)
|
||||||
.map((e) => GroupMembersInfo.fromJson(e))
|
.map((e) => GroupMembersInfo.fromJson(e))
|
||||||
.toList());
|
.toList());
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the list of group members
|
/// Get the list of group members
|
||||||
/// [filter] 0: all user, 1: group owner, 2: administrator
|
/// [filter] 0: all user, 1: group owner, 2: administrator
|
||||||
/// [next] begin index, pull and fill 0 for the first time
|
/// [next] begin index, pull and fill 0 for the first time
|
||||||
|
/// 获取组成员列表
|
||||||
Future<GroupMembersList> getGroupMemberList({
|
Future<GroupMembersList> getGroupMemberList({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
int filter = 0,
|
int filter = 0,
|
||||||
int next = 0,
|
int next = 0,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'getGroupMemberList',
|
'getGroupMemberList',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -88,15 +90,15 @@ class GroupManager {
|
|||||||
'next': next,
|
'next': next,
|
||||||
}))
|
}))
|
||||||
.then((value) => GroupMembersList.fromJson(_formatJson(value)));
|
.then((value) => GroupMembersList.fromJson(_formatJson(value)));
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the list of group members
|
/// Get the list of group members
|
||||||
|
/// 获取组成员列表
|
||||||
Future<dynamic> getGroupMemberListMap({
|
Future<dynamic> getGroupMemberListMap({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
int filter = 0,
|
int filter = 0,
|
||||||
int next = 0,
|
int next = 0,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'getGroupMemberList',
|
'getGroupMemberList',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -105,38 +107,36 @@ class GroupManager {
|
|||||||
'next': next,
|
'next': next,
|
||||||
}))
|
}))
|
||||||
.then((value) => _formatJson(value));
|
.then((value) => _formatJson(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Find all groups you have joined
|
/// Find all groups you have joined
|
||||||
Future<List<GroupInfo>> getJoinedGroupList() {
|
/// 查询已加入的组列表
|
||||||
return _channel.invokeMethod('getJoinedGroupList', _buildParam({})).then(
|
Future<List<GroupInfo>> getJoinedGroupList() => _channel
|
||||||
(value) => (_formatJson(value) as List)
|
.invokeMethod('getJoinedGroupList', _buildParam({}))
|
||||||
|
.then((value) => (_formatJson(value) as List)
|
||||||
.map((e) => GroupInfo.fromJson(e))
|
.map((e) => GroupInfo.fromJson(e))
|
||||||
.toList());
|
.toList());
|
||||||
}
|
|
||||||
|
|
||||||
/// Find all groups you have joined
|
/// Find all groups you have joined
|
||||||
Future<List<dynamic>> getJoinedGroupListMap() {
|
/// 查询已加入的组列表
|
||||||
return _channel
|
Future<List<dynamic>> getJoinedGroupListMap() => _channel
|
||||||
.invokeMethod('getJoinedGroupList', _buildParam({}))
|
.invokeMethod('getJoinedGroupList', _buildParam({}))
|
||||||
.then((value) => _formatJson(value));
|
.then((value) => _formatJson(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Check if you are a member of the group
|
/// Check if you are a member of the group
|
||||||
Future<bool> isJoinedGroup({required String gid}) {
|
/// 检查是否已加入组
|
||||||
return getJoinedGroupList()
|
Future<bool> isJoinedGroup({required String gid}) => getJoinedGroupList()
|
||||||
.then((list) => list.where((e) => e.groupID == gid).length > 0);
|
.then((list) => list.where((e) => e.groupID == gid).length > 0);
|
||||||
}
|
|
||||||
|
|
||||||
/// Create a group
|
/// Create a group
|
||||||
|
/// 创建一个组
|
||||||
Future<dynamic> createGroup({
|
Future<dynamic> createGroup({
|
||||||
String? groupName,
|
String? groupName,
|
||||||
String? notification,
|
String? notification,
|
||||||
String? introduction,
|
String? introduction,
|
||||||
String? faceUrl,
|
String? faceUrl,
|
||||||
required List<GroupMemberRole> list,
|
required List<GroupMemberRole> list,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'createGroup',
|
'createGroup',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'gInfo': {
|
'gInfo': {
|
||||||
@@ -147,18 +147,17 @@ class GroupManager {
|
|||||||
},
|
},
|
||||||
'memberList': list.map((e) => e.toJson()).toList()
|
'memberList': list.map((e) => e.toJson()).toList()
|
||||||
}));
|
}));
|
||||||
/*.then((value) => _formatJson(value)['groupID'])*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Edit group information
|
/// Edit group information
|
||||||
|
/// 编辑组资料
|
||||||
Future<dynamic> setGroupInfo({
|
Future<dynamic> setGroupInfo({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
String? groupName,
|
String? groupName,
|
||||||
String? notification,
|
String? notification,
|
||||||
String? introduction,
|
String? introduction,
|
||||||
String? faceUrl,
|
String? faceUrl,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'setGroupInfo',
|
'setGroupInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'gInfo': {
|
'gInfo': {
|
||||||
@@ -169,89 +168,87 @@ class GroupManager {
|
|||||||
"faceUrl": faceUrl,
|
"faceUrl": faceUrl,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Find group information by group id
|
/// Find group information by group id
|
||||||
|
/// 查询组信息
|
||||||
Future<List<GroupInfo>> getGroupsInfo({
|
Future<List<GroupInfo>> getGroupsInfo({
|
||||||
required List<String> gidList,
|
required List<String> gidList,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod('getGroupsInfo', _buildParam({'gidList': gidList}))
|
.invokeMethod('getGroupsInfo', _buildParam({'gidList': gidList}))
|
||||||
.then((value) {
|
.then((value) {
|
||||||
List list = _formatJson(value);
|
List list = _formatJson(value);
|
||||||
return list.map((e) => GroupInfo.fromJson(e)).toList();
|
return list.map((e) => GroupInfo.fromJson(e)).toList();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
/// Apply to join the group
|
/// Apply to join the group
|
||||||
|
/// 申请加入组,需要通过管理员同意。
|
||||||
Future<dynamic> joinGroup({
|
Future<dynamic> joinGroup({
|
||||||
required String gid,
|
required String gid,
|
||||||
String? reason,
|
String? reason,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'joinGroup',
|
'joinGroup',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'gid': gid,
|
'gid': gid,
|
||||||
'reason': reason,
|
'reason': reason,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Leave group
|
/// Leave group
|
||||||
|
/// 退出组
|
||||||
Future<dynamic> quitGroup({
|
Future<dynamic> quitGroup({
|
||||||
required String gid,
|
required String gid,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'quitGroup',
|
'quitGroup',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'gid': gid,
|
'gid': gid,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Give group permissions to others
|
/// Give group permissions to others
|
||||||
|
/// 转移组拥有者权限
|
||||||
Future<dynamic> transferGroupOwner({
|
Future<dynamic> transferGroupOwner({
|
||||||
required String gid,
|
required String gid,
|
||||||
required String uid,
|
required String uid,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'transferGroupOwner',
|
'transferGroupOwner',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'gid': gid,
|
'gid': gid,
|
||||||
'uid': uid,
|
'uid': uid,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the list of applications
|
/// Get the list of applications
|
||||||
Future<GroupApplicationList> getGroupApplicationList() {
|
/// 获取所有进组申请
|
||||||
return _channel
|
Future<GroupApplicationList> getGroupApplicationList() => _channel
|
||||||
.invokeMethod('getGroupApplicationList', _buildParam({}))
|
.invokeMethod('getGroupApplicationList', _buildParam({}))
|
||||||
.then((value) => GroupApplicationList.fromJson(_formatJson(value)));
|
.then((value) => GroupApplicationList.fromJson(_formatJson(value)));
|
||||||
}
|
|
||||||
|
|
||||||
/// Accept group application
|
/// Accept group application
|
||||||
|
/// 同意进组申请
|
||||||
Future<dynamic> acceptGroupApplication({
|
Future<dynamic> acceptGroupApplication({
|
||||||
required GroupApplicationInfo info,
|
required GroupApplicationInfo info,
|
||||||
required String reason,
|
required String reason,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'acceptGroupApplication',
|
'acceptGroupApplication',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'application': info.toJson(),
|
'application': info.toJson(),
|
||||||
'reason': reason,
|
'reason': reason,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Refuse group application
|
/// Refuse group application
|
||||||
|
/// 拒绝进组申请
|
||||||
Future<dynamic> refuseGroupApplication({
|
Future<dynamic> refuseGroupApplication({
|
||||||
required GroupApplicationInfo info,
|
required GroupApplicationInfo info,
|
||||||
required String reason,
|
required String reason,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'refuseGroupApplication',
|
'refuseGroupApplication',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'application': info.toJson(),
|
'application': info.toJson(),
|
||||||
'reason': reason,
|
'reason': reason,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Future forceSyncApplyGroupRequest() {
|
// Future forceSyncApplyGroupRequest() {
|
||||||
@@ -278,9 +275,7 @@ class GroupManager {
|
|||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
|
|
||||||
static dynamic _formatJson(value) {
|
static dynamic _formatJson(value) => jsonDecode(_printValue(value));
|
||||||
return jsonDecode(_printValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static String _printValue(value) {
|
static String _printValue(value) {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
@@ -31,6 +32,7 @@ class IMManager {
|
|||||||
void _addNativeCallback(MethodChannel _channel) {
|
void _addNativeCallback(MethodChannel _channel) {
|
||||||
_channel.setMethodCallHandler((call) {
|
_channel.setMethodCallHandler((call) {
|
||||||
try {
|
try {
|
||||||
|
log('Flutter : $call');
|
||||||
if (call.method == ListenerType.initSDKListener) {
|
if (call.method == ListenerType.initSDKListener) {
|
||||||
String type = call.arguments['type'];
|
String type = call.arguments['type'];
|
||||||
dynamic data = call.arguments['data'];
|
dynamic data = call.arguments['data'];
|
||||||
@@ -273,6 +275,11 @@ class IMManager {
|
|||||||
/// [ipApi] Api server ip address
|
/// [ipApi] Api server ip address
|
||||||
/// [ipWs] WebSocket ip address
|
/// [ipWs] WebSocket ip address
|
||||||
/// [dbPath] Data storage directory
|
/// [dbPath] Data storage directory
|
||||||
|
/// 初始化SDK
|
||||||
|
/// [platform] 平台编号[IMPlatform]
|
||||||
|
/// [ipApi] SDK api地址
|
||||||
|
/// [ipWs] SDK websocket地址
|
||||||
|
/// [dbPath] SDK数据库存储目录
|
||||||
Future<dynamic> initSDK({
|
Future<dynamic> initSDK({
|
||||||
required int platform,
|
required int platform,
|
||||||
required String ipApi,
|
required String ipApi,
|
||||||
@@ -304,6 +311,7 @@ class IMManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Login sdk
|
/// Login sdk
|
||||||
|
/// 登录
|
||||||
Future<UserInfo> login({required String uid, required String token}) async {
|
Future<UserInfo> login({required String uid, required String token}) async {
|
||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
await _channel.invokeMethod(
|
await _channel.invokeMethod(
|
||||||
@@ -316,6 +324,7 @@ class IMManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Logout sdk
|
/// Logout sdk
|
||||||
|
/// 登出
|
||||||
Future<dynamic> logout() async {
|
Future<dynamic> logout() async {
|
||||||
var value = await _channel.invokeMethod('logout', _buildParam({}));
|
var value = await _channel.invokeMethod('logout', _buildParam({}));
|
||||||
this.isLogined = false;
|
this.isLogined = false;
|
||||||
@@ -323,32 +332,28 @@ class IMManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
Future<int?> getLoginStatus() {
|
Future<int?> getLoginStatus() =>
|
||||||
return _channel.invokeMethod<int>('getLoginStatus', _buildParam({}));
|
_channel.invokeMethod<int>('getLoginStatus', _buildParam({}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Current user id
|
/// Current user id
|
||||||
Future<String?> getLoginUid() {
|
/// 获取当前登录用户id
|
||||||
return Future.value(uid);
|
Future<String> getLoginUid() async => uid;
|
||||||
// return _channel.invokeMethod<String>('getLoginUid', _buildParam({}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Current user info
|
/// Current user info
|
||||||
Future<UserInfo> getLoginUserInfo() {
|
/// 获取当前登录用户信息
|
||||||
return Future.value(uInfo);
|
Future<UserInfo> getLoginUserInfo() async => uInfo;
|
||||||
}
|
|
||||||
|
|
||||||
/// Modify current user info
|
/// Modify current user info
|
||||||
|
/// 修改当前登录用户资料
|
||||||
Future<String?> setSelfInfo(
|
Future<String?> setSelfInfo(
|
||||||
{required String uid,
|
{String? name,
|
||||||
String? name,
|
|
||||||
String? icon,
|
String? icon,
|
||||||
int? gender,
|
int? gender,
|
||||||
String? mobile,
|
String? mobile,
|
||||||
String? birth,
|
String? birth,
|
||||||
String? email,
|
String? email,
|
||||||
String? ex}) {
|
String? ex}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'setSelfInfo',
|
'setSelfInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'uid': uid,
|
'uid': uid,
|
||||||
@@ -360,25 +365,20 @@ class IMManager {
|
|||||||
'email': email,
|
'email': email,
|
||||||
'ex': ex,
|
'ex': ex,
|
||||||
}));
|
}));
|
||||||
// .then((value) => UserInfo.fromJson(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Query user information
|
/// Query user information
|
||||||
Future<List<UserInfo>> getUsersInfo(List<String> uidList) {
|
/// 查询用户信息
|
||||||
return _channel
|
Future<List<UserInfo>> getUsersInfo(List<String> uidList) => _channel
|
||||||
.invokeMethod('getUsersInfo', _buildParam({'uidList': uidList}))
|
.invokeMethod('getUsersInfo', _buildParam({'uidList': uidList}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
void setSdkLog({required bool enable}) {
|
Future enabledSDKLog({required bool enabled}) => _channel.invokeMethod(
|
||||||
_channel.invokeMethod('setSdkLog', _buildParam({'sdkLog': enable ? 0 : 1}));
|
'setSdkLog', _buildParam({'sdkLog': enabled ? 0 : 1}));
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
Future<dynamic> forceSyncLoginUerInfo(List<String> uidList) {
|
Future<dynamic> forceSyncLoginUerInfo(List<String> uidList) =>
|
||||||
return _channel.invokeMethod('forceSyncLoginUerInfo', _buildParam({}));
|
_channel.invokeMethod('forceSyncLoginUerInfo', _buildParam({}));
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Future<dynamic> forceReConn() {
|
// Future<dynamic> forceReConn() {
|
||||||
@@ -393,9 +393,7 @@ class IMManager {
|
|||||||
static List<UserInfo> _toList(String value) =>
|
static List<UserInfo> _toList(String value) =>
|
||||||
(_formatJson(value) as List).map((e) => UserInfo.fromJson(e)).toList();
|
(_formatJson(value) as List).map((e) => UserInfo.fromJson(e)).toList();
|
||||||
|
|
||||||
static dynamic _formatJson(value) {
|
static dynamic _formatJson(value) => jsonDecode(_printValue(value));
|
||||||
return jsonDecode(_printValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static String _printValue(value) {
|
static String _printValue(value) {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class MessageManager {
|
|||||||
MessageManager(this._channel);
|
MessageManager(this._channel);
|
||||||
|
|
||||||
/// Add a message listener
|
/// Add a message listener
|
||||||
|
/// 消息监听
|
||||||
Future addAdvancedMsgListener(AdvancedMsgListener listener) {
|
Future addAdvancedMsgListener(AdvancedMsgListener listener) {
|
||||||
advancedMsgListeners.add(listener);
|
advancedMsgListeners.add(listener);
|
||||||
return _channel.invokeMethod(
|
return _channel.invokeMethod(
|
||||||
@@ -21,6 +22,7 @@ class MessageManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Remove a message listener
|
/// Remove a message listener
|
||||||
|
@deprecated
|
||||||
Future removeAdvancedMsgListener(AdvancedMsgListener listener) {
|
Future removeAdvancedMsgListener(AdvancedMsgListener listener) {
|
||||||
advancedMsgListeners.remove(listener);
|
advancedMsgListeners.remove(listener);
|
||||||
return _channel.invokeMethod(
|
return _channel.invokeMethod(
|
||||||
@@ -31,36 +33,42 @@ class MessageManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Set up message sending progress monitoring
|
/// Set up message sending progress monitoring
|
||||||
|
/// 消息发送进度监听
|
||||||
void setMsgSendProgressListener(MsgSendProgressListener listener) {
|
void setMsgSendProgressListener(MsgSendProgressListener listener) {
|
||||||
msgSendProgressListener = listener;
|
msgSendProgressListener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Send a message to user or to group
|
/// Send a message to user or to group
|
||||||
/// [userID] receiver's user ID
|
/// [userID] receiver's user ID
|
||||||
|
/// 发送消息
|
||||||
|
/// [userID]接收消息的用户id
|
||||||
|
/// [groupID]接收消息的组id
|
||||||
Future<dynamic> sendMessage({
|
Future<dynamic> sendMessage({
|
||||||
required Message message,
|
required Message message,
|
||||||
String? userID,
|
String? userID,
|
||||||
String? groupID,
|
String? groupID,
|
||||||
bool onlineUserOnly = false,
|
bool onlineUserOnly = false,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'sendMessage',
|
'sendMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'message': message.toJson(),
|
'message': message.toJson(),
|
||||||
'receiver': userID ?? '',
|
'userID': userID ?? '',
|
||||||
'groupID': groupID ?? '',
|
'groupID': groupID ?? '',
|
||||||
'onlineUserOnly': onlineUserOnly,
|
'onlineUserOnly': onlineUserOnly,
|
||||||
})) /*.then((value) => _toObj(value))*/;
|
})) /*.then((value) => _toObj(value))*/;
|
||||||
}
|
|
||||||
|
|
||||||
/// Find all history message
|
/// Find all history message
|
||||||
|
/// 获取聊天记录
|
||||||
|
/// [userID]接收消息的用户id
|
||||||
|
/// [groupID]接收消息的组id
|
||||||
Future<List<Message>> getHistoryMessageList({
|
Future<List<Message>> getHistoryMessageList({
|
||||||
String? userID,
|
String? userID,
|
||||||
String? groupID,
|
String? groupID,
|
||||||
Message? startMsg,
|
Message? startMsg,
|
||||||
int? count,
|
int? count,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'getHistoryMessageList',
|
'getHistoryMessageList',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -70,90 +78,85 @@ class MessageManager {
|
|||||||
'count': count ?? 10,
|
'count': count ?? 10,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toList(value));
|
.then((value) => _toList(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Revoke the sent information
|
/// Revoke the sent information
|
||||||
Future revokeMessage({required Message message}) {
|
/// 撤回消息
|
||||||
return _channel.invokeMethod(
|
Future revokeMessage({required Message message}) =>
|
||||||
'revokeMessage', _buildParam(message.toJson()));
|
_channel.invokeMethod('revokeMessage', _buildParam(message.toJson()));
|
||||||
}
|
|
||||||
|
|
||||||
/// Delete message
|
/// Delete message
|
||||||
Future deleteMessageFromLocalStorage({required Message message}) {
|
/// 删除消息
|
||||||
return _channel.invokeMethod(
|
Future deleteMessageFromLocalStorage({required Message message}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
'deleteMessageFromLocalStorage', _buildParam(message.toJson()));
|
'deleteMessageFromLocalStorage', _buildParam(message.toJson()));
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@deprecated
|
@deprecated
|
||||||
Future deleteMessages({required List<Message> msgList}) {
|
Future deleteMessages({required List<Message> msgList}) =>
|
||||||
return _channel.invokeMethod('deleteMessages',
|
_channel.invokeMethod('deleteMessages',
|
||||||
_buildParam({"msgList": msgList.map((e) => e.toJson()).toList()}));
|
_buildParam({"msgList": msgList.map((e) => e.toJson()).toList()}));
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
Future insertSingleMessageToLocalStorage({
|
Future insertSingleMessageToLocalStorage({
|
||||||
String? receiver,
|
String? receiverID,
|
||||||
String? sender,
|
String? senderID,
|
||||||
Message? message,
|
Message? message,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'insertSingleMessageToLocalStorage',
|
'insertSingleMessageToLocalStorage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"userID": receiver,
|
|
||||||
"message": message?.toJson(),
|
"message": message?.toJson(),
|
||||||
"sender": sender,
|
"receiverID": receiverID,
|
||||||
|
"senderID": senderID,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Query the message according to the message id
|
/// Query the message according to the message id
|
||||||
Future findMessages({required List<String> messageIDList}) {
|
Future findMessages({required List<String> messageIDList}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'findMessages',
|
'findMessages',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"messageIDList": messageIDList,
|
"messageIDList": messageIDList,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Mark c2c message as read
|
/// Mark c2c message as read
|
||||||
|
/// 标记c2c消息已读
|
||||||
Future markC2CMessageAsRead({
|
Future markC2CMessageAsRead({
|
||||||
required String userID,
|
required String userID,
|
||||||
required List<String> messageIDList,
|
required List<String> messageIDList,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'markC2CMessageAsRead',
|
'markC2CMessageAsRead',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"messageIDList": messageIDList,
|
"messageIDList": messageIDList,
|
||||||
"userID": userID,
|
"userID": userID,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Typing
|
/// Typing
|
||||||
|
/// 正在输入提示
|
||||||
Future typingStatusUpdate({
|
Future typingStatusUpdate({
|
||||||
required String userID,
|
required String userID,
|
||||||
bool typing = false,
|
bool typing = false,
|
||||||
}) {
|
}) =>
|
||||||
return _channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'typingStatusUpdate',
|
'typingStatusUpdate',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"typing": typing ? 'yes' : 'no',
|
"typing": typing ? 'yes' : 'no',
|
||||||
"userID": userID,
|
"userID": userID,
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create text message
|
/// Create text message
|
||||||
Future<Message> createTextMessage({required String text}) {
|
/// 创建文本消息
|
||||||
return _channel
|
Future<Message> createTextMessage({required String text}) => _channel
|
||||||
.invokeMethod('createTextMessage', _buildParam({'text': text}))
|
.invokeMethod('createTextMessage', _buildParam({'text': text}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create @ message
|
/// Create @ message
|
||||||
|
/// 创建@消息
|
||||||
Future<Message> createTextAtMessage({
|
Future<Message> createTextAtMessage({
|
||||||
required String text,
|
required String text,
|
||||||
required List<String> atUidList,
|
required List<String> atUidList,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createTextAtMessage',
|
'createTextAtMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -162,63 +165,61 @@ class MessageManager {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create picture message
|
/// Create picture message
|
||||||
Future<Message> createImageMessage({required String imagePath}) {
|
/// 创建图片消息
|
||||||
return _channel
|
Future<Message> createImageMessage({required String imagePath}) => _channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createImageMessage',
|
'createImageMessage',
|
||||||
_buildParam({'imagePath': imagePath}),
|
_buildParam({'imagePath': imagePath}),
|
||||||
)
|
)
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create picture message
|
/// Create picture message
|
||||||
Future<Message> createImageMessageFromFullPath({required String imagePath}) {
|
/// 创建图片消息
|
||||||
return _channel
|
Future<Message> createImageMessageFromFullPath({required String imagePath}) =>
|
||||||
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createImageMessageFromFullPath',
|
'createImageMessageFromFullPath',
|
||||||
_buildParam({'imagePath': imagePath}),
|
_buildParam({'imagePath': imagePath}),
|
||||||
)
|
)
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Create sound message
|
/// Create sound message
|
||||||
|
/// 创建语音消息
|
||||||
Future<Message> createSoundMessage({
|
Future<Message> createSoundMessage({
|
||||||
required String soundPath,
|
required String soundPath,
|
||||||
required int duration,
|
required int duration,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createSoundMessage',
|
'createSoundMessage',
|
||||||
_buildParam({'soundPath': soundPath, "duration": duration}),
|
_buildParam({'soundPath': soundPath, "duration": duration}),
|
||||||
)
|
)
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create sound message
|
/// Create sound message
|
||||||
|
/// 创建语音消息
|
||||||
Future<Message> createSoundMessageFromFullPath({
|
Future<Message> createSoundMessageFromFullPath({
|
||||||
required String soundPath,
|
required String soundPath,
|
||||||
required int duration,
|
required int duration,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createSoundMessageFromFullPath',
|
'createSoundMessageFromFullPath',
|
||||||
_buildParam({'soundPath': soundPath, "duration": duration}),
|
_buildParam({'soundPath': soundPath, "duration": duration}),
|
||||||
)
|
)
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create video message
|
/// Create video message
|
||||||
|
/// 创建视频消息
|
||||||
Future<Message> createVideoMessage({
|
Future<Message> createVideoMessage({
|
||||||
required String videoPath,
|
required String videoPath,
|
||||||
required String videoType,
|
required String videoType,
|
||||||
required int duration,
|
required int duration,
|
||||||
required String snapshotPath,
|
required String snapshotPath,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createVideoMessage',
|
'createVideoMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -228,16 +229,16 @@ class MessageManager {
|
|||||||
'snapshotPath': snapshotPath,
|
'snapshotPath': snapshotPath,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create video message
|
/// Create video message
|
||||||
|
/// 创建视频消息
|
||||||
Future<Message> createVideoMessageFromFullPath({
|
Future<Message> createVideoMessageFromFullPath({
|
||||||
required String videoPath,
|
required String videoPath,
|
||||||
required String videoType,
|
required String videoType,
|
||||||
required int duration,
|
required int duration,
|
||||||
required String snapshotPath,
|
required String snapshotPath,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createVideoMessageFromFullPath',
|
'createVideoMessageFromFullPath',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -247,9 +248,9 @@ class MessageManager {
|
|||||||
'snapshotPath': snapshotPath,
|
'snapshotPath': snapshotPath,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create file message
|
/// Create file message
|
||||||
|
/// 创建文件消息
|
||||||
Future<Message> createFileMessage({
|
Future<Message> createFileMessage({
|
||||||
required String filePath,
|
required String filePath,
|
||||||
required String fileName,
|
required String fileName,
|
||||||
@@ -265,11 +266,12 @@ class MessageManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create file message
|
/// Create file message
|
||||||
|
/// 创建文件消息
|
||||||
Future<Message> createFileMessageFromFullPath({
|
Future<Message> createFileMessageFromFullPath({
|
||||||
required String filePath,
|
required String filePath,
|
||||||
required String fileName,
|
required String fileName,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createFileMessageFromFullPath',
|
'createFileMessageFromFullPath',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -277,15 +279,15 @@ class MessageManager {
|
|||||||
'fileName': fileName,
|
'fileName': fileName,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create merger message
|
/// Create merger message
|
||||||
|
/// 创建合并消息
|
||||||
Future<Message> createMergerMessage({
|
Future<Message> createMergerMessage({
|
||||||
required List<Message> messageList,
|
required List<Message> messageList,
|
||||||
required String title,
|
required String title,
|
||||||
required List<String> summaryList,
|
required List<String> summaryList,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createMergerMessage',
|
'createMergerMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -294,9 +296,9 @@ class MessageManager {
|
|||||||
'summaryList': summaryList,
|
'summaryList': summaryList,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create forward message
|
/// Create forward message
|
||||||
|
/// 创建转发消息
|
||||||
Future<Message> createForwardMessage({required Message message}) {
|
Future<Message> createForwardMessage({required Message message}) {
|
||||||
return _channel
|
return _channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
@@ -308,12 +310,13 @@ class MessageManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create location message
|
/// Create location message
|
||||||
|
/// 创建位置消息
|
||||||
Future<Message> createLocationMessage({
|
Future<Message> createLocationMessage({
|
||||||
required double latitude,
|
required double latitude,
|
||||||
required double longitude,
|
required double longitude,
|
||||||
required String description,
|
required String description,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createLocationMessage',
|
'createLocationMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -322,15 +325,15 @@ class MessageManager {
|
|||||||
'description': description,
|
'description': description,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create custom message
|
/// Create custom message
|
||||||
|
/// 创建自定义消息
|
||||||
Future<Message> createCustomMessage({
|
Future<Message> createCustomMessage({
|
||||||
required String data,
|
required String data,
|
||||||
required String extension,
|
required String extension,
|
||||||
required String description,
|
required String description,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createCustomMessage',
|
'createCustomMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -339,14 +342,14 @@ class MessageManager {
|
|||||||
'description': description,
|
'description': description,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create quote message
|
/// Create quote message
|
||||||
|
/// 创建引用消息
|
||||||
Future<Message> createQuoteMessage({
|
Future<Message> createQuoteMessage({
|
||||||
required String text,
|
required String text,
|
||||||
required Message quoteMsg,
|
required Message quoteMsg,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createQuoteMessage',
|
'createQuoteMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
@@ -354,25 +357,34 @@ class MessageManager {
|
|||||||
'quoteMessage': quoteMsg.toJson(),
|
'quoteMessage': quoteMsg.toJson(),
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
|
||||||
/// Create card message
|
/// Create card message
|
||||||
|
/// 创建卡片消息
|
||||||
Future<Message> createCardMessage({
|
Future<Message> createCardMessage({
|
||||||
required Map<String, dynamic> data,
|
required Map<String, dynamic> data,
|
||||||
}) {
|
}) =>
|
||||||
return _channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'createCardMessage',
|
'createCardMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'cardMessage': data,
|
'cardMessage': data,
|
||||||
}))
|
}))
|
||||||
.then((value) => _toObj(value));
|
.then((value) => _toObj(value));
|
||||||
}
|
|
||||||
|
/// Clear all c2c history message
|
||||||
|
/// 清空单聊消息记录
|
||||||
|
Future<dynamic> clearC2CHistoryMessage({required String uid}) => _channel
|
||||||
|
.invokeMethod('clearC2CHistoryMessage', _buildParam({"userID": uid}));
|
||||||
|
|
||||||
|
/// Clear all group history
|
||||||
|
/// 清空组消息记录
|
||||||
|
Future<dynamic> clearGroupHistoryMessage({required String gid}) => _channel
|
||||||
|
.invokeMethod('clearGroupHistoryMessage', _buildParam({"groupID": gid}));
|
||||||
|
|
||||||
///
|
///
|
||||||
void forceSyncMsg() {
|
// void forceSyncMsg() {
|
||||||
_channel.invokeMethod('forceSyncMsg', _buildParam({}));
|
// _channel.invokeMethod('forceSyncMsg', _buildParam({}));
|
||||||
}
|
// }
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
@@ -384,9 +396,7 @@ class MessageManager {
|
|||||||
|
|
||||||
static Message _toObj(String value) => Message.fromJson(_formatJson(value));
|
static Message _toObj(String value) => Message.fromJson(_formatJson(value));
|
||||||
|
|
||||||
static dynamic _formatJson(value) {
|
static dynamic _formatJson(value) => jsonDecode(_printValue(value));
|
||||||
return jsonDecode(_printValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static String _printValue(value) {
|
static String _printValue(value) {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|
||||||
|
|
||||||
extension MessageManagerV2 on MessageManager {
|
|
||||||
Message createTextMessageV2({required String text}) {
|
|
||||||
return _createMessage(contentType: MessageType.text)..content = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
Message createTextAtMessageV2({
|
|
||||||
required String text,
|
|
||||||
required List<String> atUidList,
|
|
||||||
}) {
|
|
||||||
var atElem = AtElem(
|
|
||||||
text: text,
|
|
||||||
atUserList: atUidList,
|
|
||||||
isAtSelf: false,
|
|
||||||
);
|
|
||||||
return _createMessage(contentType: MessageType.at_text)
|
|
||||||
..forceList = atUidList
|
|
||||||
..atElem = atElem
|
|
||||||
..content = jsonEncode(atElem);
|
|
||||||
}
|
|
||||||
|
|
||||||
Message createImageMessageV2({
|
|
||||||
required String imagePath,
|
|
||||||
required String mineType,
|
|
||||||
required int size,
|
|
||||||
required int width,
|
|
||||||
required int height,
|
|
||||||
}) {
|
|
||||||
return _createMessage(contentType: MessageType.picture)
|
|
||||||
..pictureElem = PictureElem(
|
|
||||||
sourcePath: imagePath,
|
|
||||||
sourcePicture: PictureInfo(
|
|
||||||
type: mineType,
|
|
||||||
size: size,
|
|
||||||
width: width,
|
|
||||||
height: height,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Message createSoundMessageV2({
|
|
||||||
required String soundPath,
|
|
||||||
required int duration,
|
|
||||||
required int dataSize,
|
|
||||||
}) {
|
|
||||||
return _createMessage(contentType: MessageType.voice)
|
|
||||||
..soundElem = SoundElem(
|
|
||||||
soundPath: soundPath,
|
|
||||||
dataSize: dataSize,
|
|
||||||
duration: duration,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Message createVideoMessageV2({
|
|
||||||
required String videoPath,
|
|
||||||
required String videoType,
|
|
||||||
required int videoSize,
|
|
||||||
required int duration,
|
|
||||||
required String snapshotPath,
|
|
||||||
required int snapshotSize,
|
|
||||||
required int snapshotWidth,
|
|
||||||
required int snapshotHeight,
|
|
||||||
}) {
|
|
||||||
return _createMessage(contentType: MessageType.video)
|
|
||||||
..videoElem = VideoElem(
|
|
||||||
videoPath: videoPath,
|
|
||||||
videoSize: videoSize,
|
|
||||||
videoType: videoType,
|
|
||||||
duration: duration,
|
|
||||||
snapshotPath: snapshotPath,
|
|
||||||
snapshotSize: snapshotSize,
|
|
||||||
snapshotHeight: snapshotHeight,
|
|
||||||
snapshotWidth: snapshotWidth,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Message createFileMessageV2({
|
|
||||||
required String filePath,
|
|
||||||
required String fileName,
|
|
||||||
required int fileSize,
|
|
||||||
}) {
|
|
||||||
return _createMessage(contentType: MessageType.file)
|
|
||||||
..fileElem = FileElem(
|
|
||||||
fileName: fileName,
|
|
||||||
filePath: filePath,
|
|
||||||
fileSize: fileSize,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Message createMergerMessageV2({
|
|
||||||
required List<Message> messageList,
|
|
||||||
required String title,
|
|
||||||
required List<String> summaryList,
|
|
||||||
}) {
|
|
||||||
var message = _createMessage(contentType: MessageType.merger);
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
Message createForwardMessageV2({required List<Message> messageList}) {
|
|
||||||
var message = _createMessage();
|
|
||||||
return message;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
static Message _createMessage({required contentType}) {
|
|
||||||
var now = DateTime.now();
|
|
||||||
return Message(
|
|
||||||
clientMsgID: 'flutter_client_${now.microsecondsSinceEpoch}',
|
|
||||||
createTime: now.millisecond ~/ 1000,
|
|
||||||
sendTime: now.millisecond ~/ 1000,
|
|
||||||
// sessionType: 0,//请求为单人会话1,请求为群聊会话2
|
|
||||||
msgFrom: 100,
|
|
||||||
contentType: contentType,
|
|
||||||
status: MessageStatus.sending,
|
|
||||||
platformID: Platform.isAndroid ? IMPlatform.android : IMPlatform.ios,
|
|
||||||
sendID: OpenIM.iMManager.uid,
|
|
||||||
senderNickName: OpenIM.iMManager.uInfo.name,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -48,11 +48,14 @@ class ConversationInfo {
|
|||||||
unreadCount = json['unreadCount'];
|
unreadCount = json['unreadCount'];
|
||||||
// latestMsg = json['latestMsg'];
|
// latestMsg = json['latestMsg'];
|
||||||
// if (null != json['latestMsg']) {
|
// if (null != json['latestMsg']) {
|
||||||
|
try {
|
||||||
if (json['latestMsg'] is String) {
|
if (json['latestMsg'] is String) {
|
||||||
latestMsg = Message.fromJson(jsonDecode(json['latestMsg']));
|
latestMsg = Message.fromJson(jsonDecode(json['latestMsg']));
|
||||||
} else if (json['latestMsg'] is Map) {
|
} else if (json['latestMsg'] is Map) {
|
||||||
latestMsg = Message.fromJson(json['latestMsg']);
|
latestMsg = Message.fromJson(json['latestMsg']);
|
||||||
}
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
latestMsgSendTime = json['latestMsgSendTime'];
|
latestMsgSendTime = json['latestMsgSendTime'];
|
||||||
@@ -84,4 +87,14 @@ class ConversationInfo {
|
|||||||
bool get isGroupChat => conversationType == ConversationType.group_chat;
|
bool get isGroupChat => conversationType == ConversationType.group_chat;
|
||||||
|
|
||||||
bool get isTop => isPinned == 1;
|
bool get isTop => isPinned == 1;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ConversationInfo &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
conversationID == other.conversationID;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => conversationID.hashCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class Message {
|
|||||||
createTime = json['createTime'];
|
createTime = json['createTime'];
|
||||||
sendTime = json['sendTime'];
|
sendTime = json['sendTime'];
|
||||||
sendID = json['sendID'];
|
sendID = json['sendID'];
|
||||||
recvID = json['RecvID'];
|
recvID = json['recvID'];
|
||||||
msgFrom = json['msgFrom'];
|
msgFrom = json['msgFrom'];
|
||||||
contentType = json['contentType'];
|
contentType = json['contentType'];
|
||||||
platformID = json['platformID'];
|
platformID = json['platformID'];
|
||||||
@@ -125,7 +125,7 @@ class Message {
|
|||||||
data['createTime'] = this.createTime;
|
data['createTime'] = this.createTime;
|
||||||
data['sendTime'] = this.sendTime;
|
data['sendTime'] = this.sendTime;
|
||||||
data['sendID'] = this.sendID;
|
data['sendID'] = this.sendID;
|
||||||
data['RecvID'] = this.recvID;
|
data['recvID'] = this.recvID;
|
||||||
data['msgFrom'] = this.msgFrom;
|
data['msgFrom'] = this.msgFrom;
|
||||||
data['contentType'] = this.contentType;
|
data['contentType'] = this.contentType;
|
||||||
data['platformID'] = this.platformID;
|
data['platformID'] = this.platformID;
|
||||||
@@ -153,17 +153,14 @@ class Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) =>
|
||||||
if (other is Message) {
|
identical(this, other) ||
|
||||||
return other._id == _id;
|
other is Message &&
|
||||||
}
|
runtimeType == other.runtimeType &&
|
||||||
return false;
|
clientMsgID == other.clientMsgID;
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => super.hashCode;
|
int get hashCode => clientMsgID.hashCode;
|
||||||
|
|
||||||
String? get _id => clientMsgID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class PictureElem {
|
class PictureElem {
|
||||||
|
|||||||
12
pubspec.lock
@@ -7,7 +7,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.8.1"
|
version: "2.8.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -21,7 +21,7 @@ packages:
|
|||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -66,7 +66,7 @@ packages:
|
|||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
version: "0.12.11"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -127,7 +127,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.4.3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -141,7 +141,7 @@ packages:
|
|||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=1.20.0"
|
flutter: ">=1.20.0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: flutter_openim_sdk
|
name: flutter_openim_sdk
|
||||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||||
version: 1.0.0
|
version: 1.1.1
|
||||||
homepage: https://www.rentsoft.cn
|
homepage: https://www.rentsoft.cn
|
||||||
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
||||||
|
|
||||||
|
|||||||