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,14 +80,22 @@ public class CommonAppConfig {
public static String SWToken = ""; //声网Token public static String SWToken = ""; //声网Token
public static final String SWChannelPrefix = "g"; 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 final String SWAPPId = "d4a5879524d74c20a7bdd667b0f2ca21";
public static String getSwAppId() {
if (BuildConfig.DEBUG) {
return SWAPPId_debug;
} else {
return SWAPPId;
}
}
/** /**
* 获取通道 * 获取通道
*
* @return * @return
*/ */
public static String getChannelName() { public static String getChannelName() {
@ -135,8 +143,7 @@ public class CommonAppConfig {
public String getUid() { public String getUid() {
if (TextUtils.isEmpty(mUid)) { if (TextUtils.isEmpty(mUid)) {
String[] uidAndToken = SpUtil.getInstance() String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
if (uidAndToken != null) { if (uidAndToken != null) {
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) { if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
mUid = uidAndToken[0]; mUid = uidAndToken[0];
@ -327,9 +334,7 @@ public class CommonAppConfig {
mUid = null; mUid = null;
mToken = null; mToken = null;
mLoginIM = false; mLoginIM = false;
SpUtil.getInstance().removeValue( SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
);
} }
@ -365,12 +370,7 @@ public class CommonAppConfig {
mProvince = null; mProvince = null;
mCity = null; mCity = null;
mDistrict = null; mDistrict = null;
SpUtil.getInstance().removeValue( SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
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 对象并进行配置
RtcEngineConfig config = new RtcEngineConfig(); RtcEngineConfig config = new RtcEngineConfig();
config.mContext = mContext; config.mContext = mContext;
config.mAppId = CommonAppConfig.SWAPPId; config.mAppId = CommonAppConfig.getSwAppId();
config.mEventHandler = mRtcEventHandler; config.mEventHandler = mRtcEventHandler;
// 创建并初始化 RtcEngine // 创建并初始化 RtcEngine
mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config); mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config);
@ -125,7 +125,7 @@ public class SWAuManager extends BaseCacheManager {
if(mRtcEngine==null){ if(mRtcEngine==null){
RtcEngineConfig config = new RtcEngineConfig(); RtcEngineConfig config = new RtcEngineConfig();
config.mContext = mContext; config.mContext = mContext;
config.mAppId = CommonAppConfig.SWAPPId; config.mAppId = CommonAppConfig.getSwAppId();
config.mEventHandler = mEventHandler; config.mEventHandler = mEventHandler;
// 创建并初始化 RtcEngine // 创建并初始化 RtcEngine
mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config); mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config);

View File

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