package com.test.basd.smartjunkcleaner.display.fcm

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import com.google.firebase.messaging.FirebaseMessaging
import com.test.basd.smartjunkcleaner.helps.EventHelper


class FCMCheckReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        // 检查FCM连接并重新连接（如果需要）
        // 这里可以根据具体需求自行实现

        val boolean = FirebaseMessaging.getInstance().isAutoInitEnabled
        FcmHelper.getToken()
        if (boolean) {
            EventHelper.event("fcm_autoInit_suc")
        } else {
            EventHelper.event("fcm_autoInit_fail")
        }
        Log.d("FcmHelper", "FCMCheckReceiver: $boolean")
    }
}
