Commit d690bbf2 by 洪国微

fix

parent 4b2e2b1a
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_config"
android:theme="@style/platform_CommonTheme" android:theme="@style/platform_CommonTheme"
tools:ignore="GoogleAppIndexingWarning" tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup, android:icon, android:label"> tools:replace="android:allowBackup, android:icon, android:label">
......
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
\ No newline at end of file
...@@ -42,7 +42,7 @@ ext { ...@@ -42,7 +42,7 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.21", "m-confide" : "0.0.24",
"m-consultant" : "0.0.38", "m-consultant" : "0.0.38",
"m-course" : "0.0.17", "m-course" : "0.0.17",
"m-fm" : "0.0.15", "m-fm" : "0.0.15",
...@@ -67,7 +67,7 @@ ext { ...@@ -67,7 +67,7 @@ ext {
"ydl-webview" : "0.0.26", "ydl-webview" : "0.0.26",
"ydl-media" : "0.0.12", "ydl-media" : "0.0.12",
"ydl-pay" : "0.0.9", "ydl-pay" : "0.0.9",
"m-audioim" : "0.0.15", "m-audioim" : "0.0.17",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.2", "ydl-net" : "0.0.2",
...@@ -78,7 +78,7 @@ ext { ...@@ -78,7 +78,7 @@ ext {
ydlCompileVersion = [ ydlCompileVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.15", "m-confide" : "0.0.23",
"m-consultant" : "0.0.26", "m-consultant" : "0.0.26",
"m-course" : "0.0.22", "m-course" : "0.0.22",
"m-fm" : "0.0.15", "m-fm" : "0.0.15",
...@@ -102,7 +102,7 @@ ext { ...@@ -102,7 +102,7 @@ ext {
"ydl-webview" : "0.0.24", "ydl-webview" : "0.0.24",
"ydl-media" : "0.0.12", "ydl-media" : "0.0.12",
"ydl-pay" : "0.0.9", "ydl-pay" : "0.0.9",
"m-audioim" : "0.0.15", "m-audioim" : "0.0.17",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
......
package com.ydl.audioim package com.ydl.audioim
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.text.TextUtils
import com.ydl.ydl_av.messge_service.YDLRTMClient import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.bean.RTMMesssage import com.ydl.ydl_av.messge_service.bean.RTMMesssage
import com.ydl.ydl_av.messge_service.callback.InitListener import com.ydl.ydl_av.messge_service.callback.InitListener
...@@ -32,10 +34,16 @@ class YDLavManager { ...@@ -32,10 +34,16 @@ class YDLavManager {
YDLRTMClient.instances.init(context,appId,listener) YDLRTMClient.instances.init(context,appId,listener)
} }
@SuppressLint("CheckResult")
fun login(userId:String?){ fun login(userId:String?){
if (TextUtils.isEmpty(userId) || userId?:"0" <= "0"){
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId")
return
}
//登录实时消息 //登录实时消息
//获取token //获取token
AudioApiRequestUtil.getAgoraToken(userId) AudioApiRequestUtil.getAgoraToken()
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
......
...@@ -73,8 +73,8 @@ class AudioApiRequestUtil { ...@@ -73,8 +73,8 @@ class AudioApiRequestUtil {
/** /**
* 获取声网登录token * 获取声网登录token
*/ */
fun getAgoraToken(uid:String?): Observable<BaseAPIResponse<AgoraTokenResponse>>{ fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>{
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken(uid) return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken()
} }
} }
} }
\ No newline at end of file
...@@ -51,5 +51,6 @@ interface AudioNetAPi { ...@@ -51,5 +51,6 @@ interface AudioNetAPi {
*/ */
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("im/getAgoraToken") @GET("im/getAgoraToken")
fun getAgoraToken(@Query("uid") uid: String?): Observable<BaseAPIResponse<AgoraTokenResponse>> fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>
} }
\ No newline at end of file
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