package rowedto.jockeyedto.sheetedto.interactiveedto.twistedto;

import android.annotation.SuppressLint;

import androidx.annotation.NonNull;

import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;

import org.json.JSONException;
import org.json.JSONObject;

import rowedto.jockeyedto.sheetedto.knewedto.economicedto.copyrightedto.Driededto;
import rowedto.jockeyedto.sheetedto.raceedto.pavementedto.Slantedto;


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

    private static final String TAG = "MessagingService";

    @Override
    public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);
        try {
            JSONObject data = new JSONObject(remoteMessage.getData().toString());
            Slantedto.INSTANCE.event("FCM_Received", "", data, false);
        } catch (JSONException e) {
            throw new RuntimeException(e);
        }

        sendLocalNotification();
    }

    // Consider implementing this method if local notifications are needed
    private void sendLocalNotification() {
        Sectoredto.INSTANCE.sendNotification(Driededto.context, "FCM");
    }

}