Commit 8f075270 authored by mengcuiguang's avatar mengcuiguang

添加三方调用失败上传接口

parent eac2b2b1
......@@ -273,4 +273,7 @@ object Constant {
const val GRO_MORE_ADTYPE0 = "0"
const val GRO_MORE_ADTYPE1 = "1"
const val GRO_MORE_ADTYPE2 = "2"
// 异常上报类型
const val SHUMEI_EXCEPTION = "SHUMEI"
}
......@@ -6,6 +6,9 @@ import android.text.TextUtils;
import com.ishumei.smantifraud.SmAntiFraud;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import java.util.HashMap;
/**
* 描述:数美反欺诈
......@@ -69,6 +72,12 @@ public class ShumeiManager {
SmAntiFraud.create(context, option);
} catch (Exception e) {
e.printStackTrace();
HashMap<String, Object> vo = new HashMap<>();
vo.put("type", Constant.SHUMEI_EXCEPTION);
vo.put("msg", e.getMessage());
vo.put("stack", e.toString());
vo.put("event", "init");
TrackManager.getInstance().cmtExceptionInfo(vo);
}
}
......@@ -82,6 +91,13 @@ public class ShumeiManager {
} catch (Exception e) {
e.printStackTrace();
id = "";
HashMap<String, Object> vo = new HashMap<>();
vo.put("type", Constant.SHUMEI_EXCEPTION);
vo.put("msg", e.getMessage());
vo.put("stack", e.toString());
vo.put("event", "getDeviceId");
TrackManager.getInstance().cmtExceptionInfo(vo);
}
if (TextUtils.isEmpty(id)) {
......
......@@ -149,4 +149,10 @@ public class TrackManager {
trackPresenter.cmtGroMoreInfo(vo);
}
}
public void cmtExceptionInfo(HashMap<String, Object> vo) {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.cmtExceptionInfo(vo);
}
}
}
......@@ -419,4 +419,23 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
public void cmtExceptionInfo(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.reportError(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
}
......@@ -663,6 +663,14 @@ public interface LoanService {
@POST("api/reportAdIncome")
Observable<BaseResponse<Object>> reportAdIncome(@Body Map<String, Object> vo);
/**
* 三方调用失败上传
*
* @return
*/
@POST("api/reportError")
Observable<BaseResponse<Object>> reportError(@Body Map<String, Object> vo);
/**
......
......@@ -6,6 +6,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import com.mints.goodmoney.common.AppConfig;
import com.mints.goodmoney.manager.TrackManager;
import com.mints.goodmoney.mvp.presenters.VersionUpdatePresenter;
import com.mints.goodmoney.ui.activitys.SplashADActivity;
......@@ -33,7 +34,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
private VersionUpdatePresenter vup;
private WeakReference<Activity> reference;
private Intent ylhIntent;
private Intent ksIntent;
private Intent groIntent;
private Intent csjIntent;
public static ForegroundOrBackground init(Application application) {
......@@ -107,33 +108,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
// 60秒后打开应用 显示开屏广告
if (System.currentTimeMillis() - leaveTime >= 60000) {
// if (isYlhSplash) {
// isYlhSplash = false;
//
// if (ylhIntent == null) {
// // 优量汇广告
// ylhIntent = new Intent(activity, SplashADActivity.class);
// }
// activity.startActivity(ylhIntent);
// } else {
// isYlhSplash = true;
//
// if (csjIntent == null) {
// // 快手广告
// csjIntent = new Intent(activity, SplashCsjADActivity.class);
// }
// activity.startActivity(csjIntent);
//
//// if (ksIntent == null) {
//// // 快手广告
//// ksIntent = new Intent(activity, SplashKsADActivity.class);
//// }
//// activity.startActivity(ksIntent);
// }
if (ksIntent == null) {
ksIntent = new Intent(activity, SplashGroMoreActivity.class);
if (AppConfig.groMoreVideoAdCount > 0) {
if (groIntent == null) {
groIntent = new Intent(activity, SplashGroMoreActivity.class);
}
activity.startActivity(groIntent);
} else {
if (isYlhSplash) {
isYlhSplash = false;
if (ylhIntent == null) {
// 优量汇广告
ylhIntent = new Intent(activity, SplashADActivity.class);
}
activity.startActivity(ylhIntent);
} else {
isYlhSplash = true;
if (csjIntent == null) {
// 快手广告
csjIntent = new Intent(activity, SplashCsjADActivity.class);
}
activity.startActivity(csjIntent);
}
}
activity.startActivity(ksIntent);
}
}
count++;
......
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