package com.base.pdfreaderallpdfreader.fcm;


import android.annotation.SuppressLint;

import androidx.annotation.NonNull;

import com.base.pdfreaderallpdfreader.helper.EventUtils;
import com.base.pdfreaderallpdfreader.utils.LogEx;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;

@SuppressLint("MissingFirebaseInstanceTokenRefresh")
public class MessagingService extends FirebaseMessagingService {

    private static final String TAG = "MessagingService";

    @Override
    public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);
        LogEx.INSTANCE.logDebug(TAG, "onMessageReceived", false);
        EventUtils.INSTANCE.event("FCM_Received", null, null, false);

        String action = NotificationUiUtil.INSTANCE.getNextActionId();
        NotificationUiUtil.INSTANCE.sendNotificationIfCan(this, action, PopupConstObject.POPUP_WHERE_FCM);
    }


}