package com.base.datarecovery.fcm

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.base.datarecovery.fcm.NotificationUtil.sendNotification
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.utils.EventUtils.event
import org.json.JSONObject

class FcmReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        val requestId = intent.extras?.getString("requestID")
        if (!requestId.isNullOrEmpty()) {
            val json = JSONObject()
            json.put("requestID", requestId)
            event("FCM_Received", ext = json)
        }
        sendNotification(BaseApplication.context, "Fcm")
    }
}