Commit c0a4e338 authored by jianglx's avatar jianglx

修改邀请码请求不到的问题

parent dd9c0061
......@@ -57,7 +57,6 @@ import com.rv.home.rv.module.ApiConfig;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.HomeFragment;
import com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean;
import com.rv.im.CustomerListActivity;
import com.rv.im.ImService;
import com.rv.im.ImSetting;
import com.rv.im.call.AudioOrVideoController;
......@@ -75,6 +74,7 @@ import com.rv.version.DownListenerManager;
import com.rv.version.bean.VersionCheckBean;
import com.rv.version.util.DownloadAppUtils;
import com.rv.version.util.UpdateAppUtils;
import com.sh.sdk.shareinstall.ShareInstall;
import com.xxfc.discovery.DiscoveryFragment;
import com.xxfc.discovery.api.DiscoveryApi;
import com.xxfc.discovery.bean.DiscoveryIMTokenBean;
......@@ -84,6 +84,8 @@ import com.yuyife.okgo.OkGoUtil;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
......@@ -240,6 +242,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL
checkVersion();
checkToken();
getPreRentDays();
initShareCode();
}
......@@ -326,6 +329,27 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL
.update();
}
/********
* 保存分享的code
*/
private void initShareCode() {
ShareInstall.getInstance().getInfo(getIntent(), info -> {
// 客户端获取到的参数是json字符串格式
LogUtil.d("ShareInstall", "info = " + info);
JSONObject object;
try {
object = new JSONObject(info);
String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
AppCookie.save("code", inviteCode);
}
} catch (JSONException e) {
e.printStackTrace();
}
});
}
/**
* 设置token时间检测
*/
......
......@@ -76,27 +76,6 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
showTitle(false);//隐藏菜单栏
permissionProcess();
initShareCode();
}
/********
* 保存分享的code
*/
private void initShareCode() {
ShareInstall.getInstance().getInfo(getIntent(), info -> {
// 客户端获取到的参数是json字符串格式
LogUtil.d("ShareInstall", "info = " + info);
JSONObject object;
try {
object = new JSONObject(info);
String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
AppCookie.save("code", inviteCode);
}
} catch (JSONException e) {
e.printStackTrace();
}
});
}
private void init() {
......
......@@ -95,20 +95,6 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
jumptype = intent.getIntExtra("jumptype", 0);
// etPhone.setText(""+mActivity.getPackageName());
initRxbus();
ShareInstall.getInstance().getInfo(getIntent(), info -> {
// 客户端获取到的参数是json字符串格式
LogUtil.d("ShareInstall", "info = " + info);
JSONObject object = null;
try {
object = new JSONObject(info);
String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
AppCookie.save("code", inviteCode);
}
} catch (JSONException e) {
e.printStackTrace();
}
});
}
@SuppressLint("CheckResult")
......
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