Commit 720dc764 by YKai

feat:m-confide组件剩酒

parent 80424bdb
......@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.97",
"m-confide" : "0.0.48.99",
"m-consultant" : "0.0.59.65",
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.10",
......@@ -39,7 +39,7 @@ ext {
"ydl-webview" : "0.0.38.36",
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.13",
"m-audioim" : "0.0.49.29.27",
"m-audioim" : "0.0.49.29.28",
"ydl-flutter-base": "0.0.14.20",
//以下 几乎不会动
......@@ -88,7 +88,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.97",
"m-confide" : "0.0.48.99",
"m-consultant" : "0.0.59.65",
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.10",
......@@ -120,7 +120,7 @@ ext {
"ydl-webview" : "0.0.38.36",
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.11",
"m-audioim" : "0.0.49.29.27",
"m-audioim" : "0.0.49.29.28",
"ydl-flutter-base": "0.0.14.20",
//以下 几乎不会动
......
......@@ -22,10 +22,13 @@ import com.ydl.ydl_av.messge_service.callback.LoginCallback
import com.ydl.ydl_av.messge_service.request.LoginParam
import com.ydl.ydl_av.messge_service.response.CallLocalResponse
import com.ydl.ydl_av.messge_service.response.CallRemoteResponse
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.RxSPTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import com.yidianling.im.api.bean.IMSendCustomNotificationResultCallBack
......@@ -58,6 +61,7 @@ class YDLavManager {
YDLavManager()
}
const val AUDIO_NO_AUTH_ERROR_CODE = "97"//音频权限未通过错误码
const val IS_ONLINE_RTM = "is_online_rtm" // rtm是否在线
}
......@@ -381,7 +385,7 @@ class YDLavManager {
//获取token
AudioApiRequestUtil.getAgoraToken().subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()).subscribe({
if ("200".equals(it.code)) {
if ("200" == it.code) {
LogUtil.e("[agora]登录av的login-uid:$userId")
YDLRTMClient.instances.login(
LoginParam(userId, it.data.token),
......@@ -389,6 +393,7 @@ class YDLavManager {
override fun onSuccess() {
//登陆成功,发起呼叫
LogUtil.e("[agora]实时消息登录成功")
RxSPTool.putBoolean(BaseApp.getApp(), IS_ONLINE_RTM,true)
writeAgoraLog("声网rtm登录成功,uid:$userId-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", "confide.log", true)
event(true, "")
}
......@@ -465,13 +470,18 @@ class YDLavManager {
/**
* 退出登录
* @param
*/
fun logout() {
private fun logout(isReLogin:Boolean) {
EventBus.getDefault().unregister(this)
YDLRTMClient.instances.logout(object : LoginCallback {
override fun onSuccess() {
//退出登陆成功
LogUtil.d("[agora]实时消息退出成功")
RxSPTool.putBoolean(BaseApp.getApp(), IS_ONLINE_RTM,false)
if (isReLogin){
login(ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid)
}
}
override fun onFailure(msg: String?) {
......@@ -481,6 +491,13 @@ class YDLavManager {
}
/**
* 退出登录默认不重新登录
*/
fun logout(){
logout(false)
}
/**
* RTM登录异常,上传错误日志 msg
* 声网出现异常,上传错误日志 connectException
*/
......@@ -543,6 +560,8 @@ class YDLavManager {
* */
if(reason==CONNECTION_CHANGE_REASON_REMOTE_LOGIN&&!activityIsExists(ConsultantAudioHomeActivity::class.java)&&!activityIsExists(AudioHomeActivity::class.java)){
logout()
}else{
logout(true)
}
}
}
......
......@@ -17,6 +17,8 @@ import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.RxSPTool
import com.yidianling.common.tools.ToastUtil
/**
* Created by haorui on 2019-12-11 .
......@@ -50,7 +52,11 @@ class ConfdieServiceImpl : IConfideService {
}
override fun connectionJava(id: Int, type: Int, activity: Activity, tellData: String?, callType: String?) {
var myTellData: TellData? = if (tellData == null ) null else Gson().fromJson(tellData, TellData::class.java)
if (!RxSPTool.getBoolean(BaseApp.getApp(),YDLavManager.IS_ONLINE_RTM)){
ToastUtil.toastShort("网络通话错误代码001")
return
}
val myTellData: TellData? = if (tellData == null ) null else Gson().fromJson(tellData, TellData::class.java)
ConfideWebServiceImpl().connectionJava(id, type, activity, myTellData, callType)
}
......
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