Fix bug callback 'onUserTokenExpired'
This commit is contained in:
parent
bac4bd0884
commit
cdef7ffda8
@ -4,38 +4,38 @@ class OnConnectListener {
|
|||||||
Function()? onConnectSuccess;
|
Function()? onConnectSuccess;
|
||||||
Function()? onConnecting;
|
Function()? onConnecting;
|
||||||
Function()? onKickedOffline;
|
Function()? onKickedOffline;
|
||||||
Function()? onUserSigExpired;
|
Function()? onUserTokenExpired;
|
||||||
|
|
||||||
OnConnectListener({
|
OnConnectListener({
|
||||||
this.onConnectFailed,
|
this.onConnectFailed,
|
||||||
this.onConnectSuccess,
|
this.onConnectSuccess,
|
||||||
this.onConnecting,
|
this.onConnecting,
|
||||||
this.onKickedOffline,
|
this.onKickedOffline,
|
||||||
this.onUserSigExpired,
|
this.onUserTokenExpired,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// SDK连接服务器失败
|
/// SDK连接服务器失败
|
||||||
void connectFailed(int? code, String? errorMsg) {
|
void connectFailed(int? code, String? errorMsg) {
|
||||||
if (null != onConnectFailed) onConnectFailed!(code, errorMsg);
|
onConnectFailed?.call(code, errorMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// SDK连接服务器成功
|
/// SDK连接服务器成功
|
||||||
void connectSuccess() {
|
void connectSuccess() {
|
||||||
if (null != onConnectSuccess) onConnectSuccess!();
|
onConnectSuccess?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// SDK正在连接服务器
|
/// SDK正在连接服务器
|
||||||
void connecting() {
|
void connecting() {
|
||||||
if (null != onConnecting) onConnecting!.call();
|
onConnecting?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 账号已在其他地方登录,当前设备被踢下线
|
/// 账号已在其他地方登录,当前设备被踢下线
|
||||||
void kickedOffline() {
|
void kickedOffline() {
|
||||||
if (null != onKickedOffline) onKickedOffline!();
|
onKickedOffline?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 登录凭证过期,需要重新登录
|
/// 登录凭证过期,需要重新登录
|
||||||
void userSigExpired() {
|
void userTokenExpired() {
|
||||||
if (null != onUserSigExpired) onUserSigExpired!();
|
onUserTokenExpired?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,29 +20,28 @@ class OnConversationListener {
|
|||||||
|
|
||||||
/// 会话发生改变
|
/// 会话发生改变
|
||||||
void conversationChanged(List<ConversationInfo> list) {
|
void conversationChanged(List<ConversationInfo> list) {
|
||||||
if (onConversationChanged != null) onConversationChanged!(list);
|
onConversationChanged?.call(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 有新会话产生
|
/// 有新会话产生
|
||||||
void newConversation(List<ConversationInfo> list) {
|
void newConversation(List<ConversationInfo> list) {
|
||||||
if (onNewConversation != null) onNewConversation!(list);
|
onNewConversation?.call(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 未读消息总数发送改变
|
/// 未读消息总数发送改变
|
||||||
void totalUnreadMessageCountChanged(int i) {
|
void totalUnreadMessageCountChanged(int i) {
|
||||||
if (onTotalUnreadMessageCountChanged != null)
|
onTotalUnreadMessageCountChanged?.call(i);
|
||||||
onTotalUnreadMessageCountChanged!(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncServerFailed() {
|
void syncServerFailed() {
|
||||||
if (onSyncServerFailed != null) onSyncServerFailed!();
|
onSyncServerFailed?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncServerFinish() {
|
void syncServerFinish() {
|
||||||
if (onSyncServerFinish != null) onSyncServerFinish!();
|
onSyncServerFinish?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncServerStart() {
|
void syncServerStart() {
|
||||||
if (onSyncServerStart != null) onSyncServerStart!();
|
onSyncServerStart?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,6 @@ class OnMsgSendProgressListener {
|
|||||||
|
|
||||||
/// 消息发送进度
|
/// 消息发送进度
|
||||||
void progress(String clientMsgID, int progress) {
|
void progress(String clientMsgID, int progress) {
|
||||||
if (null != onProgress) onProgress!(clientMsgID, progress);
|
onProgress?.call(clientMsgID, progress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,8 +57,8 @@ class IMManager {
|
|||||||
case 'onKickedOffline':
|
case 'onKickedOffline':
|
||||||
_connectListener.kickedOffline();
|
_connectListener.kickedOffline();
|
||||||
break;
|
break;
|
||||||
case 'onUserSigExpired':
|
case 'onUserTokenExpired':
|
||||||
_connectListener.userSigExpired();
|
_connectListener.userTokenExpired();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.userListener) {
|
} else if (call.method == ListenerType.userListener) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user