

package com.ejada.hmg.geofence.intent_receivers

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.ejada.hmg.geofence.HMG_Geofence
import com.ejada.hmg.utils.PREFS_STORAGE

class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){
    override fun onReceive(context: Context, intent: Intent) {

        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) {
//        if (intent.action.equals("android.intent.action.BOOT_COMPLETE")) {
            val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
            pref.edit().putString("REBOOT_DETECTED","YES").apply()

            HMG_Geofence.shared(context).register(){ status, error -> }
        }
    }

}