package com.base.filerecoveryrecyclebin.fcm

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.base.filerecoveryrecyclebin.fcm.NotificationUtil.sendNotification
import com.base.filerecoveryrecyclebin.help.BaseApplication
import com.base.filerecoveryrecyclebin.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")
    }
}