Commit ccdcf7e2 by 刘鹏

feat: 增加声网logout

parent c2689a91
...@@ -22,18 +22,23 @@ interface IAudioImService : IProvider{ ...@@ -22,18 +22,23 @@ interface IAudioImService : IProvider{
/** /**
* rtm登录返回并登录状态 * rtm登录返回并登录状态
*/ */
fun loginRtm(userId:String?,event: (isSuccess: Boolean, msg: String?) -> Unit) fun loginRtm(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit)
/** /**
* rtm登录 * rtm登录
*/ */
fun loginRtm(userId:String?) fun loginRtm(userId: String?)
/**
* rtm退出登录
*/
fun logoutRtm()
/** /**
* 拨打语音电话转axb弹窗 * 拨打语音电话转axb弹窗
*/ */
fun openAxbDialog(activity: Activity?, type:Int, phoneNumber: String?) fun openAxbDialog(activity: Activity?, type: Int, phoneNumber: String?)
/** /**
* 事件上报 * 事件上报
......
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.44" componentVersion = "0.3.0.48.1-SNAPSHOT"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -33,8 +33,13 @@ class AudioImServiceImp : IAudioImService { ...@@ -33,8 +33,13 @@ class AudioImServiceImp : IAudioImService {
YDLavManager.instances.login(userId) YDLavManager.instances.login(userId)
} }
override fun logoutRtm() {
YDLavManager.instances.logout()
}
override fun openAxbDialog(activity: Activity?, type: Int, phoneNumber: String?) { override fun openAxbDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener { val dialog =
AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() { override fun onClickEnsure() {
phoneNumber?.let { phoneNumber?.let {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$phoneNumber")) val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$phoneNumber"))
......
...@@ -76,4 +76,5 @@ dependencies { ...@@ -76,4 +76,5 @@ dependencies {
implementation project(":api:fm") implementation project(":api:fm")
implementation project(":api:consultant") implementation project(":api:consultant")
implementation project(':api:confide') implementation project(':api:confide')
implementation project(':api:audioim')
} }
package com.yidianling.im.helper; package com.yidianling.im.helper;
import com.yidianling.uikit.api.NimUIKit;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.auth.AuthService; import com.netease.nimlib.sdk.auth.AuthService;
import com.ydl.audioim.api.IAudioImService;
import com.ydl.ydlcommon.modular.ModularServiceManagerKt;
import com.yidianling.im.preference.IMCache; import com.yidianling.im.preference.IMCache;
import com.yidianling.nimbase.common.http.NimHttpClient; import com.yidianling.nimbase.common.http.NimHttpClient;
import com.yidianling.uikit.api.NimUIKit;
/** /**
* 注销帮助类 * 注销帮助类
...@@ -17,6 +19,7 @@ public class LogoutHelper { ...@@ -17,6 +19,7 @@ public class LogoutHelper {
NimUIKit.logout(); NimUIKit.logout();
IMCache.clear(); IMCache.clear();
NIMClient.getService(AuthService.class).logout(); NIMClient.getService(AuthService.class).logout();
ModularServiceManagerKt.findRouteService(IAudioImService.class).logoutRtm();
} }
private static LogoutHelper instance; private static LogoutHelper instance;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment