package com.zxdemo.service

import android.util.Log
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.swiftcleaner.chovey.model.bean.Global.NOTIFICATION_WHERE_FCM
import com.zxdemo.ZxApplication
import com.zxdemo.http.ZxHttp
import com.zxdemo.notity.NotificationUtils
import org.json.JSONObject

class FcmService : FirebaseMessagingService() {
    override fun onMessageReceived(message: RemoteMessage) {
        Log.e("FCM", "FcmService")
        val data = JSONObject(message.data.toString())
        ZxHttp.getHttpReportInterface("FCM_Received", "", data)
        NotificationUtils.sendNotification(ZxApplication.context, NOTIFICATION_WHERE_FCM)
    }
}