Commit e97bf6ee authored by leichao.gao's avatar leichao.gao

add log

parent 775ea5be
...@@ -71,16 +71,17 @@ public class AdDisplayUtils { ...@@ -71,16 +71,17 @@ public class AdDisplayUtils {
public boolean shouldShowAd(String ad_unit) { public boolean shouldShowAd(String ad_unit) {
boolean s = shouldDisplayAd() && shouldIncrementClickCount() && shouldIncrementRequestFailAd(); boolean s = shouldDisplayAd() && shouldIncrementClickCount() && shouldIncrementRequestFailAd();
if (!s) {
LogEx.INSTANCE.logDebug("glc", "!shouldShowAd", false); LogEx.INSTANCE.logDebug("glc", "!shouldShowAd", false);
JSONObject obj2 = new JSONObject(); JSONObject obj2 = new JSONObject();
try { try {
obj2.put("reason", "no ad"); obj2.put("reason", "no ad");
obj2.put("ad_unit", ad_unit); obj2.put("ad_unit", ad_unit);
EventUtils.INSTANCE.event("ad_show_error", null,obj2,false); EventUtils.INSTANCE.event("ad_show_error", null, obj2, false);
} catch (JSONException e) { } catch (JSONException e) {
} }
}
return s; return s;
} }
......
...@@ -75,6 +75,7 @@ object AdMaxEvent { ...@@ -75,6 +75,7 @@ object AdMaxEvent {
obj.put("latency", ad?.requestLatencyMillis) obj.put("latency", ad?.requestLatencyMillis)
obj.put("valueMicros", ad?.revenue) obj.put("valueMicros", ad?.revenue)
obj.put("from",activity.javaClass.simpleName) obj.put("from",activity.javaClass.simpleName)
LogEx.logDebug("glc","from: "+activity.javaClass.simpleName)
if(!adUnit.equals("nativeAd")){ if(!adUnit.equals("nativeAd")){
EventUtils.event("ad_show", ext = obj) EventUtils.event("ad_show", ext = obj)
}else{ }else{
......
...@@ -217,7 +217,7 @@ object NotificationUtil { ...@@ -217,7 +217,7 @@ object NotificationUtil {
fun sendNotification(context: Context) { fun sendNotification(context: Context) {
val currentNum = AppPreferences.getInstance().getInt("showNotificationCount_" + AdDisplayUtils.getInstance().getCurrentDate(), 0) val currentNum = AppPreferences.getInstance().getInt("showNotificationCount_" + AdDisplayUtils.getInstance().getCurrentDate(), 0)
val maxNum = AppPreferences.getInstance().getString("maxShowNotificationCount", "100").toIntOrNull()?:100 val maxNum = AppPreferences.getInstance().getString("maxShowNotificationCount", "156").toIntOrNull()?:156
if (currentNum >= maxNum) { if (currentNum >= maxNum) {
LogEx.logDebug("glc","currentNum >= maxNum") LogEx.logDebug("glc","currentNum >= maxNum")
return return
......
...@@ -30,7 +30,9 @@ object InstallHelps { ...@@ -30,7 +30,9 @@ object InstallHelps {
if (listOf("gclid", "facebook", "instagram").all { !installInfo.contains(it, true) }) { if (listOf("gclid", "facebook", "instagram").all { !installInfo.contains(it, true) }) {
//自然用户 //自然用户
AppPreferences.getInstance().put("install_source", "origin") AppPreferences.getInstance().put("install_source", "origin")
LogEx.logDebug("glc","origin user")
} else { } else {
LogEx.logDebug("glc","channel user")
//渠道用户 //渠道用户
AppPreferences.getInstance().put("install_source", "channel") AppPreferences.getInstance().put("install_source", "channel")
} }
......
...@@ -99,6 +99,7 @@ object NewComUtils { ...@@ -99,6 +99,7 @@ object NewComUtils {
AdDisplayUtils.getInstance().maxAdRequestFailCount = AdDisplayUtils.getInstance().maxAdRequestFailCount =
AppPreferences.getInstance().getString("adRequestFailCount", "20").toInt() AppPreferences.getInstance().getString("adRequestFailCount", "20").toInt()
} }
} }
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