应用内更新

This commit is contained in:
wushaocheng
2022-11-07 18:22:22 +08:00
parent 5f94e31de1
commit f792416f52
13 changed files with 205 additions and 87 deletions

View File

@@ -8,7 +8,9 @@ import com.netease.nimlib.sdk.NIMSDK;
import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.msg.model.BroadcastMessage;
import com.yizhuan.xchat_android_core.bean.BaseProtocol;
import com.yizhuan.xchat_android_core.gift.bean.LuckyBagNoticeInfo;
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
import com.yizhuan.xchat_android_core.upgrade.bean.NewestVersionInfo;
import com.yizhuan.xchat_android_core.upgrade.event.ImPushUpdateAppEvent;
import org.greenrobot.eventbus.EventBus;
@@ -73,7 +75,8 @@ public class IMBroadcastManager {
switch (first) {
case CustomAttachment.CUSTOM_MSG_HEADER_ALL_SERVICE_PUSH:
if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_PUSH_APP_TO_UPDATE) {
EventBus.getDefault().post(new ImPushUpdateAppEvent());
NewestVersionInfo newestVersionInfo = JSON.parseObject(String.valueOf(baseProtocol.getData()), NewestVersionInfo.class);
EventBus.getDefault().post(new ImPushUpdateAppEvent(newestVersionInfo));
}
break;
}

View File

@@ -1,8 +1,24 @@
package com.yizhuan.xchat_android_core.upgrade.event;
import com.yizhuan.xchat_android_core.upgrade.bean.NewestVersionInfo;
/**
* IM推送全局广播-发出事件-用户请求更新接口
* create by lvzebiao @2019/8/14
*/
public class ImPushUpdateAppEvent {
private NewestVersionInfo info;
public ImPushUpdateAppEvent(NewestVersionInfo info) {
this.info = info;
}
public NewestVersionInfo getInfo() {
return info;
}
public void setInfo(NewestVersionInfo info) {
this.info = info;
}
}