Skip to content

Commit bb562a4

Browse files
iveshzfMinTate
authored andcommitted
[tencent_calls_uikit] Fixed the issue of the setCallingBell interface being invalid.
1 parent 7f1511d commit bb562a4

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

call/lib/src/common/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Constants {
2-
static const String pluginVersion = "4.0.7.0";
2+
static const String pluginVersion = "4.0.8.0";
33
static const String defaultAvatar =
44
"https://dldir1.qq.com/hudongzhibo/TUIKit/resource/picture/user_default_icon.png";
55
}

call/lib/src/feature/calling_bell_feature.dart

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,25 @@ class CallingBellFeature {
6969
}
7070

7171
Future<String> _getRingFilePath() async {
72-
final customFilePath = await PreferenceUtils.getInstance().getString(_keyRingPath);
73-
if (customFilePath.isNotEmpty && _shouldUseCustomRing()) {
74-
return customFilePath;
75-
}
76-
77-
final String ringName;
78-
7972
if (_isCalled()) {
8073
if (GlobalState.instance.enableMuteMode) {
8174
return "";
8275
}
83-
ringName = _calledRingName;
76+
77+
final customAssetName = GlobalState.instance.callingBellAssetName;
78+
if (customAssetName != null && customAssetName.isNotEmpty) {
79+
return await getAssetsFilePath(customAssetName);
80+
}
81+
82+
final customFilePath = await PreferenceUtils.getInstance().getString(_keyRingPath);
83+
if (customFilePath.isNotEmpty) {
84+
return customFilePath;
85+
}
86+
87+
return await _getAssetsFilePath(_calledRingName);
8488
} else {
85-
ringName = _callerRingName;
89+
return await _getAssetsFilePath(_callerRingName);
8690
}
87-
88-
return await _getAssetsFilePath(ringName);
8991
}
9092

9193
bool _isCalled() {
@@ -94,10 +96,7 @@ class CallingBellFeature {
9496
return userId != inviterId;
9597
}
9698

97-
bool _shouldUseCustomRing() {
98-
return _isCalled() &&
99-
!GlobalState.instance.enableMuteMode;
100-
}
99+
101100

102101
Future<String> getAssetsFilePath(String assetName) async {
103102
if (assetName.isEmpty) {

call/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: tencent_calls_uikit
22
description: "TUICallKit is a UIKit about audio&video calls launched by Tencent Cloud."
3-
version: 4.0.7
3+
version: 4.0.8
44
homepage:
55

66
environment:

0 commit comments

Comments
 (0)