Commit dd9c0061 authored by jianglx's avatar jianglx

在启动页面添加获取邀请码

parent 3a8dda61
......@@ -4,7 +4,6 @@ import android.Manifest;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
......@@ -28,8 +27,12 @@ import com.rv.component.utils.RvCache;
import com.rv.im.AppConfig;
import com.rv.im.bean.ImConfig;
import com.rv.im.bean.ImConfigBean;
import com.sh.sdk.shareinstall.ShareInstall;
import com.yuyife.okgo.OkGoUtil;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;
import io.reactivex.Flowable;
......@@ -73,6 +76,27 @@ 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() {
......
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