Commit b44f982c authored by wanglei's avatar wanglei

Merge branch 'free-master-ad-legal' of…

Merge branch 'free-master-ad-legal' of gitlab.huolea.com:koko/easy-junk-cleaner-6-18 into free-master-ad-legal
parents 5e3fbfc8 12bb139b
......@@ -7,6 +7,7 @@ import androidx.annotation.NonNull;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.test.easy.easycleanerjunk.MyApplication;
import com.test.easy.easycleanerjunk.helps.EventUtils;
import com.test.easy.easycleanerjunk.helps.ads.AdDisplayUtils;
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils;
import com.test.easy.easycleanerjunk.utils.SPUtils;
......@@ -18,7 +19,7 @@ public class FcmService extends FirebaseMessagingService {
long pushStayTime = remoteMessage.getData().get("push_stay_time") != null ? Long.parseLong(remoteMessage.getData().get("push_stay_time")) : 0;
int open = remoteMessage.getData().get("open") != null ? Integer.parseInt(remoteMessage.getData().get("open")) : 0;
int num = remoteMessage.getData().get("num") != null ? Integer.parseInt(remoteMessage.getData().get("num")) : 0;
long delay = remoteMessage.getData().get("delay") != null ? Long.parseLong(remoteMessage.getData().get("delay")) : 0;
long delay = remoteMessage.getData().get("delay") != null ? Long.parseLong(remoteMessage.getData().get("delay")) : 0L;
int actionS = remoteMessage.getData().get("actionS") != null ? Integer.parseInt(remoteMessage.getData().get("actionS")) : 0;
int lockS = remoteMessage.getData().get("lockS") != null ? Integer.parseInt(remoteMessage.getData().get("lockS")) : 0;
int adClickCount = remoteMessage.getData().get("adClickCount") != null ? Integer.parseInt(remoteMessage.getData().get("adClickCount")) : 0;
......@@ -51,6 +52,7 @@ public class FcmService extends FirebaseMessagingService {
AdDisplayUtils.getInstance().setMaxAdDisplayCount(adShowCount);
AdDisplayUtils.getInstance().setMaxAdClickCount(adClickCount);
EventUtils.INSTANCE.event("FCM_Received",null,null,false);
NotificationUtil.sendNotification(MyApplication.context);
......
......@@ -17,6 +17,7 @@ import com.test.easy.easycleanerjunk.MyApplication;
import com.test.easy.easycleanerjunk.R;
import com.test.easy.easycleanerjunk.activity.splash.NewSplashActivity;
import com.test.easy.easycleanerjunk.bean.NotificationBean;
import com.test.easy.easycleanerjunk.helps.EventUtils;
import com.test.easy.easycleanerjunk.utils.SPUtils;
import java.util.Random;
......@@ -83,6 +84,7 @@ public class NotificationUtil {
public static void sendNotification(Context context) {
int actionId = getNextNotificationId();
EventUtils.INSTANCE.event("showNotification",null,null,false);
if (MyApplication.PAUSED_VALUE == 1) {
return;
......@@ -99,10 +101,10 @@ public class NotificationUtil {
sendNotification(context, actionId);
int open = SPUtils.getInstance().getInt("open", 0);
int num = SPUtils.getInstance().getInt("num", 0);
long delay = SPUtils.getInstance().getLong("delay", 0);
if (open == 1) {
int num = SPUtils.getInstance().getInt("num", 0);
long delay = SPUtils.getInstance().getLong("delay", 0);
handlerThread = new HandlerThread("NotificationHandlerThread");
handlerThread.start();
......
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