111
This commit is contained in:
@@ -6,16 +6,21 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import io.rong.push.RongPushClient;
|
||||
import io.rong.push.pushconfig.PushConfig;
|
||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
|
||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||
@@ -46,6 +51,16 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
sInstance = this;
|
||||
//初始化Http
|
||||
CommonHttpUtil.init();
|
||||
// //华为推送
|
||||
// PushConfig config = new PushConfig.Builder()
|
||||
// .enableHWPush(true)
|
||||
// .build();
|
||||
// RongPushClient.setPushConfig(config); //将推送相关配置设置到 SDK
|
||||
//谷歌推送
|
||||
PushConfig gconfig = new PushConfig.Builder()
|
||||
.enableFCM(true)
|
||||
.build();
|
||||
RongPushClient.setPushConfig(gconfig);
|
||||
//初始化友盟统计
|
||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||
@@ -54,6 +69,7 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
mFirebaseAnalytics.setUserProperty("ALLOW_AD_PERSONALIZATION_SIGNALS", "true" );
|
||||
|
||||
|
||||
|
||||
logger = AppEventsLogger.newLogger(this);
|
||||
setAutoLogAppEventsEnabled(true);
|
||||
FacebookSdk.fullyInitialize();
|
||||
@@ -75,6 +91,7 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
MultiDex.install(this);
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MsgSwitchDetailModel extends BaseModel {
|
||||
@SerializedName("dynamic_msg_switch")
|
||||
String dynamic_msg_switch;
|
||||
@SerializedName("interaction_show_msg_switch")
|
||||
String interaction_show_msg_switch;
|
||||
@SerializedName("chat_msg_switch")
|
||||
String chat_msg_switch;
|
||||
@SerializedName("system_msg_switch")
|
||||
String system_msg_switch;
|
||||
|
||||
@SerializedName("followList")
|
||||
private List<MsgSwitchFollowlModel> followList = new ArrayList<>();
|
||||
|
||||
public String getDynamic_msg_switch() {
|
||||
return dynamic_msg_switch;
|
||||
}
|
||||
|
||||
public void setDynamic_msg_switch(String dynamic_msg_switch) {
|
||||
this.dynamic_msg_switch = dynamic_msg_switch;
|
||||
}
|
||||
|
||||
public String getInteraction_show_msg_switch() {
|
||||
return interaction_show_msg_switch;
|
||||
}
|
||||
|
||||
public void setInteraction_show_msg_switch(String interaction_show_msg_switch) {
|
||||
this.interaction_show_msg_switch = interaction_show_msg_switch;
|
||||
}
|
||||
|
||||
public String getChat_msg_switch() {
|
||||
return chat_msg_switch;
|
||||
}
|
||||
|
||||
public void setChat_msg_switch(String chat_msg_switch) {
|
||||
this.chat_msg_switch = chat_msg_switch;
|
||||
}
|
||||
|
||||
public String getSystem_msg_switch() {
|
||||
return system_msg_switch;
|
||||
}
|
||||
|
||||
public void setSystem_msg_switch(String system_msg_switch) {
|
||||
this.system_msg_switch = system_msg_switch;
|
||||
}
|
||||
|
||||
public List<MsgSwitchFollowlModel> getFollowList() {
|
||||
return followList;
|
||||
}
|
||||
|
||||
public void setFollowList(List<MsgSwitchFollowlModel> followList) {
|
||||
this.followList = followList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class MsgSwitchFollowlModel extends BaseModel{
|
||||
@SerializedName("status")
|
||||
String status;
|
||||
@SerializedName("user_nicename")
|
||||
String user_nicename;
|
||||
@SerializedName("avatar")
|
||||
String avatar;
|
||||
@SerializedName("liveuid")
|
||||
String liveuid;
|
||||
|
||||
public String getLiveuid() {
|
||||
return liveuid;
|
||||
}
|
||||
|
||||
public void setLiveuid(String liveuid) {
|
||||
this.liveuid = liveuid;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getUser_nicename() {
|
||||
return user_nicename;
|
||||
}
|
||||
|
||||
public void setUser_nicename(String user_nicename) {
|
||||
this.user_nicename = user_nicename;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class NotificationMsgBean {
|
||||
String img;
|
||||
String title;
|
||||
String content;
|
||||
String type;
|
||||
String liveuid;
|
||||
String activityurl;
|
||||
|
||||
public String getActivityurl() {
|
||||
return activityurl;
|
||||
}
|
||||
|
||||
public void setActivityurl(String activityurl) {
|
||||
this.activityurl = activityurl;
|
||||
}
|
||||
|
||||
public String getLiveuid() {
|
||||
return liveuid;
|
||||
}
|
||||
|
||||
public void setLiveuid(String liveuid) {
|
||||
this.liveuid = liveuid;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
import com.yunbao.common.bean.NewPeopleInfo;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
@@ -184,4 +185,24 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Live.newUserPreferential")
|
||||
Observable<ResponseModel<NewPeopleInfo>> getNewPeopleInfo();
|
||||
|
||||
/**
|
||||
* 获取推送关注的开关和关注列表
|
||||
*
|
||||
*/
|
||||
@GET("/api/public/?service=Tx.offlineMsgSwitchDetail")
|
||||
Observable<ResponseModel<MsgSwitchDetailModel>> getMsgSwitchDetail();
|
||||
|
||||
/**
|
||||
* 推送关注的开关设置
|
||||
*/
|
||||
@GET("/api/public/?service=Tx.setMsgMasterSwitch")
|
||||
Observable<ResponseModel<BaseModel>> setMsgMasterSwitch(@Query("status") String status,@Query("type") String type);
|
||||
|
||||
/**
|
||||
*开播推送设置开关
|
||||
*/
|
||||
@GET("/api/public/?service=Tx.setBeginShowMsgSwitch")
|
||||
Observable<ResponseModel<List<BaseModel>>> setBeginShowMsgSwitch(@Query("status") String status,@Query("isAll") String isAll,@Query("liveuid") String liveuid);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.yunbao.common.http.main;
|
||||
import android.app.Activity;
|
||||
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SlideInfoModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseData;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
@@ -201,4 +204,64 @@ public class MainNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推送关注的设置和关注列表
|
||||
* @param callback
|
||||
*/
|
||||
public void getMsgSwitchDetail(HttpCallback<MsgSwitchDetailModel> callback) {
|
||||
API.get().pdLiveApi(mContext).getMsgSwitchDetail()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(msgSwitchDetailModelResponseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
MsgSwitchDetailModel msgSwitchDetailModel = msgSwitchDetailModelResponseModel.getData().getInfo();
|
||||
callback.onSuccess(msgSwitchDetailModel);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送开关设置
|
||||
* @param callback
|
||||
*/
|
||||
public void setMsgMasterSwitch(String status,String type,HttpCallback<ResponseData> callback) {
|
||||
API.get().pdLiveApi(mContext).setMsgMasterSwitch(status,type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
ResponseData responseData = BaseModel.getData();
|
||||
callback.onSuccess(responseData);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 主播开播推送开关设置
|
||||
* @param callback
|
||||
*/
|
||||
public void setBeginShowMsgSwitch(String status,String isAll,String liveuid,HttpCallback<ResponseData> callback) {
|
||||
API.get().pdLiveApi(mContext).setBeginShowMsgSwitch(status,isAll,liveuid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
ResponseData responseData = BaseModel.getData();
|
||||
callback.onSuccess(responseData);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class RongcloudIMManager {
|
||||
private static RongIMClient.OnReceiveMessageWrapperListener mListener;
|
||||
|
||||
/**
|
||||
*
|
||||
* 设置消息接受监听器
|
||||
*/
|
||||
public static void addRongcloudIMOnReceiveMessageListener(RongIMClient.OnReceiveMessageWrapperListener listener) {
|
||||
|
||||
Reference in New Issue
Block a user