房间分享参数修改
This commit is contained in:
@@ -10,6 +10,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.mob.moblink.MobLink;
|
||||
import com.mob.moblink.Scene;
|
||||
import com.mob.moblink.SceneRestorable;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.yizhuan.erban.other.activity.SplashActivity;
|
||||
import com.yizhuan.xchat_android_core.linked.LinkedModel;
|
||||
import com.yizhuan.xchat_android_core.linked.bean.LinkedInfo;
|
||||
@@ -31,27 +32,44 @@ public class AgentActivity extends AppCompatActivity implements SceneRestorable
|
||||
public void onReturnSceneData(Scene scene) {
|
||||
|
||||
try {
|
||||
HashMap<String, Object> params = scene.getParams();
|
||||
HashMap<String, Object> hashMap = scene.getParams();
|
||||
|
||||
LinkedInfo info = LinkedModel.get().getLinkedInfo();
|
||||
if (info == null) {
|
||||
info = new LinkedInfo();
|
||||
LogUtil.print("linkedme", hashMap);
|
||||
//根据key获取传入的参数的值,该key关键字View可为任意值,由集成方规定,请与web端商议,一致即可
|
||||
LinkedInfo linkedInfo = new LinkedInfo();
|
||||
String roomuid = (String) hashMap.get("roomuid");
|
||||
String uid = (String) hashMap.get("uid");
|
||||
String type = (String) hashMap.get("type");
|
||||
String familyId = (String) hashMap.get("familyId");
|
||||
String url = (String) hashMap.get("url");
|
||||
String worldId = (String) hashMap.get("worldId");
|
||||
String dynamicId = (String) hashMap.get("dynamicId");
|
||||
String inviteCode = (String) hashMap.get("inviteCode");
|
||||
if (roomuid != null) {
|
||||
linkedInfo.setRoomUid(roomuid);
|
||||
}
|
||||
if (uid != null) {
|
||||
linkedInfo.setUid(uid);
|
||||
}
|
||||
if (type != null) {
|
||||
linkedInfo.setType(type);
|
||||
}
|
||||
if (familyId != null) {
|
||||
linkedInfo.setFamilyId(familyId);
|
||||
}
|
||||
if (url != null) {
|
||||
linkedInfo.setUrl(url);
|
||||
}
|
||||
if (worldId != null) {
|
||||
linkedInfo.setWorldId(worldId);
|
||||
}
|
||||
if (dynamicId != null) {
|
||||
linkedInfo.setDynamicId(dynamicId);
|
||||
}
|
||||
|
||||
if (params.get("mobLinkType") != null) {
|
||||
Integer mobLinkType = (Integer) params.get("mobLinkType");
|
||||
info.setType(mobLinkType + "");
|
||||
}
|
||||
if (params.get("ROOM_UID") != null) {
|
||||
String roomid = (String) params.get("ROOM_UID");
|
||||
info.setRoomUid(roomid);
|
||||
}
|
||||
if (params.get("inviteCode") != null) {
|
||||
String inviteCode = (String) params.get("inviteCode");
|
||||
info.setInviteCode(inviteCode);
|
||||
}
|
||||
linkedInfo.setInviteCode(inviteCode);
|
||||
|
||||
LinkedModel.get().setLinkedInfo(info);
|
||||
LinkedModel.get().setLinkedInfo(linkedInfo);
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
@@ -578,6 +578,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
.flatMap(userInfo -> ShareModel.get().shareRoom(
|
||||
platform,
|
||||
currentRoomInfo.getUid(),
|
||||
userInfo.getErbanNo(),
|
||||
currentRoomInfo.getTitle(),
|
||||
currentRoomInfo.getAvatar()
|
||||
))
|
||||
|
@@ -19,7 +19,10 @@ public interface IShareModel extends IBaseCore {
|
||||
|
||||
Single<String> shareH5(WebJsBeanInfo.DataBean webViewInfo, Platform platform, boolean httpsUrl);
|
||||
|
||||
Single<String> shareRoom(Platform platform, long roomUid, String title, String avatar);
|
||||
Single<String> shareRoom(Platform platform,
|
||||
long roomUid,
|
||||
long roomId,
|
||||
String title, String room_avatar);
|
||||
|
||||
Single<String> shareFamily(Platform platform,
|
||||
String familyId,
|
||||
|
@@ -23,6 +23,7 @@ import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cn.sharesdk.facebook.Facebook;
|
||||
@@ -135,7 +136,10 @@ public class ShareModel extends BaseModel implements IShareModel {
|
||||
* @param title 标题
|
||||
*/
|
||||
@Override
|
||||
public Single<String> shareRoom(Platform platform, final long roomUid, String title, String avatar) {
|
||||
public Single<String> shareRoom(Platform platform,
|
||||
final long roomUid,
|
||||
long roomId,
|
||||
String title, String room_avatar) {
|
||||
return Single.create(new SingleOnSubscribe<String>() {
|
||||
@Override
|
||||
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
||||
@@ -143,12 +147,13 @@ public class ShareModel extends BaseModel implements IShareModel {
|
||||
if (platform != null) {
|
||||
|
||||
Platform.ShareParams sp = new Platform.ShareParams();
|
||||
sp.setImageUrl(avatar);
|
||||
|
||||
String tmpSiteUrl = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_ROOM_URL + AuthModel.get().getCurrentUid() + "&uid=" + roomUid + "&ROOM_UID=" + roomUid;
|
||||
|
||||
final String siteUrl = tmpSiteUrl;
|
||||
sp.setImageUrl(room_avatar);
|
||||
|
||||
final String siteUrl = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_ROOM_URL +
|
||||
AuthModel.get().getCurrentUid() + "&uid=" + roomUid + "&room_name=" +
|
||||
URLEncoder.encode(title, "utf8") + "&room_id=" + roomId + "&room_avatar=" +
|
||||
URLEncoder.encode(room_avatar, "utf8") + "&share_name=" +
|
||||
URLEncoder.encode( UserModel.get().getCacheLoginUserInfo().getNick(), "utf8");
|
||||
|
||||
//facebook
|
||||
if (platform.getName().equals(Facebook.NAME)) {
|
||||
|
Reference in New Issue
Block a user