package com.base.pdfviewerscannerwhite.fcm;


import android.annotation.SuppressLint;
import androidx.annotation.NonNull;
import com.base.pdfviewerscannerwhite.helper.EventUtils;
import com.base.pdfviewerscannerwhite.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);
    }


}