mirror of
https://github.com/WuKongIM/WuKongIMFlutterSDK
synced 2025-05-30 23:47:26 +00:00
fix:Optimize connections
This commit is contained in:
parent
3900a39b66
commit
e2d170e9f0
@ -65,4 +65,6 @@
|
|||||||
### 1.3.2
|
### 1.3.2
|
||||||
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
||||||
### 1.3.3
|
### 1.3.3
|
||||||
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
||||||
|
### 1.2.4
|
||||||
|
* fix: Optimize connections
|
@ -9,7 +9,7 @@
|
|||||||
#### 安装
|
#### 安装
|
||||||
```
|
```
|
||||||
dependencies:
|
dependencies:
|
||||||
wukongimfluttersdk: ^1.3.3
|
wukongimfluttersdk: ^1.3.4
|
||||||
```
|
```
|
||||||
#### 引入
|
#### 引入
|
||||||
```dart
|
```dart
|
||||||
|
1
lib/common/mode.dart
Normal file
1
lib/common/mode.dart
Normal file
@ -0,0 +1 @@
|
|||||||
|
enum Model { app, web }
|
@ -112,6 +112,7 @@ class WKConnectionManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_isLogout = false;
|
_isLogout = false;
|
||||||
|
disconnect(_isLogout);
|
||||||
if (WKIM.shared.options.getAddr != null) {
|
if (WKIM.shared.options.getAddr != null) {
|
||||||
WKIM.shared.options.getAddr!((String addr) {
|
WKIM.shared.options.getAddr!((String addr) {
|
||||||
_socketConnect(addr);
|
_socketConnect(addr);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:wukongimfluttersdk/common/crypto_utils.dart';
|
import 'package:wukongimfluttersdk/common/crypto_utils.dart';
|
||||||
|
import 'package:wukongimfluttersdk/common/mode.dart';
|
||||||
import 'package:wukongimfluttersdk/db/wk_db_helper.dart';
|
import 'package:wukongimfluttersdk/db/wk_db_helper.dart';
|
||||||
import 'package:wukongimfluttersdk/manager/channel_manager.dart';
|
import 'package:wukongimfluttersdk/manager/channel_manager.dart';
|
||||||
import 'package:wukongimfluttersdk/manager/channel_member_manager.dart';
|
import 'package:wukongimfluttersdk/manager/channel_member_manager.dart';
|
||||||
@ -22,18 +23,21 @@ class WKIM {
|
|||||||
static final WKIM _instance = WKIM._privateConstructor();
|
static final WKIM _instance = WKIM._privateConstructor();
|
||||||
|
|
||||||
static WKIM get shared => _instance;
|
static WKIM get shared => _instance;
|
||||||
|
Model runMode = Model.app;
|
||||||
Options options = Options();
|
Options options = Options();
|
||||||
|
|
||||||
Future<bool> setup(Options opts) async {
|
Future<bool> setup(Options opts) async {
|
||||||
options = opts;
|
options = opts;
|
||||||
CryptoUtils.init();
|
CryptoUtils.init();
|
||||||
_initNormalMsgContent();
|
_initNormalMsgContent();
|
||||||
bool result = await WKDBHelper.shared.init();
|
if (isApp()) {
|
||||||
if (result) {
|
bool result = await WKDBHelper.shared.init();
|
||||||
messageManager.updateSendingMsgFail();
|
if (result) {
|
||||||
|
messageManager.updateSendingMsgFail();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
return result;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_initNormalMsgContent() {
|
_initNormalMsgContent() {
|
||||||
@ -68,6 +72,10 @@ class WKIM {
|
|||||||
deviceFlagApp = deviceFlag;
|
deviceFlagApp = deviceFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isApp() {
|
||||||
|
return runMode == Model.app;
|
||||||
|
}
|
||||||
|
|
||||||
WKConnectionManager connectionManager = WKConnectionManager.shared;
|
WKConnectionManager connectionManager = WKConnectionManager.shared;
|
||||||
WKMessageManager messageManager = WKMessageManager.shared;
|
WKMessageManager messageManager = WKMessageManager.shared;
|
||||||
WKConversationManager conversationManager = WKConversationManager.shared;
|
WKConversationManager conversationManager = WKConversationManager.shared;
|
||||||
|
@ -15,7 +15,7 @@ description: wukong IM flutter sdk
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.3.3
|
version: 1.3.4
|
||||||
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
|
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user