fix[声网APPId]

This commit is contained in:
Martin 2024-06-05 16:06:04 +08:00
parent 5baea0f156
commit 62e50ae310
3 changed files with 16 additions and 16 deletions

View File

@ -80,18 +80,26 @@ public class CommonAppConfig {
public static String SWToken = ""; //声网Token
public static final String SWChannelPrefix = "g";
//测试服
//public static final String SWAPPId = "4cf0376582d742ac8a96778b25b1079e";
public static final String SWAPPId_debug = "4cf0376582d742ac8a96778b25b1079e";
//正式服
public static final String SWAPPId = "d4a5879524d74c20a7bdd667b0f2ca21";
public static String getSwAppId() {
if (BuildConfig.DEBUG) {
return SWAPPId_debug;
} else {
return SWAPPId;
}
}
/**
* 获取通道
*
* @return
*/
public static String getChannelName() {
return SWChannelPrefix+ getInstance().getUid();
return SWChannelPrefix + getInstance().getUid();
}
private CommonAppConfig() {
@ -135,8 +143,7 @@ public class CommonAppConfig {
public String getUid() {
if (TextUtils.isEmpty(mUid)) {
String[] uidAndToken = SpUtil.getInstance()
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
if (uidAndToken != null) {
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
mUid = uidAndToken[0];
@ -327,9 +334,7 @@ public class CommonAppConfig {
mUid = null;
mToken = null;
mLoginIM = false;
SpUtil.getInstance().removeValue(
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
);
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
}
@ -365,12 +370,7 @@ public class CommonAppConfig {
mProvince = null;
mCity = null;
mDistrict = null;
SpUtil.getInstance().removeValue(
SpUtil.LOCATION_LNG,
SpUtil.LOCATION_LAT,
SpUtil.LOCATION_PROVINCE,
SpUtil.LOCATION_CITY,
SpUtil.LOCATION_DISTRICT);
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
}

View File

@ -103,7 +103,7 @@ public class SWAuManager extends BaseCacheManager {
// 创建 RtcEngineConfig 对象并进行配置
RtcEngineConfig config = new RtcEngineConfig();
config.mContext = mContext;
config.mAppId = CommonAppConfig.SWAPPId;
config.mAppId = CommonAppConfig.getSwAppId();
config.mEventHandler = mRtcEventHandler;
// 创建并初始化 RtcEngine
mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config);
@ -125,7 +125,7 @@ public class SWAuManager extends BaseCacheManager {
if(mRtcEngine==null){
RtcEngineConfig config = new RtcEngineConfig();
config.mContext = mContext;
config.mAppId = CommonAppConfig.SWAPPId;
config.mAppId = CommonAppConfig.getSwAppId();
config.mEventHandler = mEventHandler;
// 创建并初始化 RtcEngine
mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config);

View File

@ -95,7 +95,7 @@ public class SWManager extends BaseCacheManager {
// 创建 RtcEngineConfig 对象并进行配置
RtcEngineConfig config = new RtcEngineConfig();
config.mContext = mContext;
config.mAppId = CommonAppConfig.SWAPPId;
config.mAppId = CommonAppConfig.getSwAppId();
config.mEventHandler = mRtcEventHandler;
// 创建并初始化 RtcEngine
mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config);