mirror of
https://github.com/WuKongIM/WuKongIMFlutterSDK
synced 2025-05-29 23:22:52 +00:00
fix:Optimize connections
This commit is contained in:
parent
3900a39b66
commit
e2d170e9f0
@ -65,4 +65,6 @@
|
||||
### 1.3.2
|
||||
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
||||
### 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:
|
||||
wukongimfluttersdk: ^1.3.3
|
||||
wukongimfluttersdk: ^1.3.4
|
||||
```
|
||||
#### 引入
|
||||
```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;
|
||||
}
|
||||
_isLogout = false;
|
||||
disconnect(_isLogout);
|
||||
if (WKIM.shared.options.getAddr != null) {
|
||||
WKIM.shared.options.getAddr!((String addr) {
|
||||
_socketConnect(addr);
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:wukongimfluttersdk/common/crypto_utils.dart';
|
||||
import 'package:wukongimfluttersdk/common/mode.dart';
|
||||
import 'package:wukongimfluttersdk/db/wk_db_helper.dart';
|
||||
import 'package:wukongimfluttersdk/manager/channel_manager.dart';
|
||||
import 'package:wukongimfluttersdk/manager/channel_member_manager.dart';
|
||||
@ -22,18 +23,21 @@ class WKIM {
|
||||
static final WKIM _instance = WKIM._privateConstructor();
|
||||
|
||||
static WKIM get shared => _instance;
|
||||
|
||||
Model runMode = Model.app;
|
||||
Options options = Options();
|
||||
|
||||
Future<bool> setup(Options opts) async {
|
||||
options = opts;
|
||||
CryptoUtils.init();
|
||||
_initNormalMsgContent();
|
||||
bool result = await WKDBHelper.shared.init();
|
||||
if (result) {
|
||||
messageManager.updateSendingMsgFail();
|
||||
if (isApp()) {
|
||||
bool result = await WKDBHelper.shared.init();
|
||||
if (result) {
|
||||
messageManager.updateSendingMsgFail();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
_initNormalMsgContent() {
|
||||
@ -68,6 +72,10 @@ class WKIM {
|
||||
deviceFlagApp = deviceFlag;
|
||||
}
|
||||
|
||||
bool isApp() {
|
||||
return runMode == Model.app;
|
||||
}
|
||||
|
||||
WKConnectionManager connectionManager = WKConnectionManager.shared;
|
||||
WKMessageManager messageManager = WKMessageManager.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
|
||||
# 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.
|
||||
version: 1.3.3
|
||||
version: 1.3.4
|
||||
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
|
||||
|
||||
environment:
|
||||
|
Loading…
x
Reference in New Issue
Block a user