Commit d013e07d by konghaorui

Merge branch 'dev' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into dev

# Conflicts:
#	config.gradle
parents c8432b98 37ec7f3d
......@@ -18,6 +18,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_config"
android:theme="@style/platform_CommonTheme"
tools:ignore="GoogleAppIndexingWarning"
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,8 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.22",
"m-confide" : "0.0.24",
"m-consultant" : "0.0.39",
"m-course" : "0.0.25",
"m-fm" : "0.0.20",
......@@ -50,6 +51,7 @@ ext {
"m-tests" : "0.0.11",
"m-user" : "0.0.32",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.2",
"m-confide-api" : "0.0.1",
......@@ -64,10 +66,12 @@ ext {
//第一步
"ydl-platform" : "0.0.26",
//第二步 若干
"ydl-webview" : "0.0.27",
"ydl-media" : "0.0.13",
"ydl-pay" : "0.0.10",
"m-audioim" : "0.0.18",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.2",
......@@ -78,7 +82,7 @@ ext {
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.15",
"m-confide" : "0.0.23",
"m-consultant" : "0.0.26",
"m-course" : "0.0.22",
"m-fm" : "0.0.15",
......@@ -99,10 +103,12 @@ ext {
//第一步
"ydl-platform" : "0.0.26",
//第二步 若干
"ydl-webview" : "0.0.27",
"ydl-media" : "0.0.13",
"ydl-pay" : "0.0.10",
"m-audioim" : "0.0.16",
"m-audioim" : "0.0.17",
//以下 几乎不会动
"router" : "0.0.1",
......
package com.ydl.audioim
import android.annotation.SuppressLint
import android.content.Context
import android.text.TextUtils
import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.bean.RTMMesssage
import com.ydl.ydl_av.messge_service.callback.InitListener
......@@ -32,10 +34,16 @@ class YDLavManager {
YDLRTMClient.instances.init(context,appId,listener)
}
@SuppressLint("CheckResult")
fun login(userId:String?){
if (TextUtils.isEmpty(userId) || userId?:"0" <= "0"){
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId")
return
}
//登录实时消息
//获取token
AudioApiRequestUtil.getAgoraToken(userId)
AudioApiRequestUtil.getAgoraToken()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
......
......@@ -73,8 +73,8 @@ class AudioApiRequestUtil {
/**
* 获取声网登录token
*/
fun getAgoraToken(uid:String?): Observable<BaseAPIResponse<AgoraTokenResponse>>{
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken(uid)
fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>{
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken()
}
}
}
\ No newline at end of file
......@@ -51,5 +51,6 @@ interface AudioNetAPi {
*/
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
@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