Geofence Android Finished
parent
0f64c45e67
commit
d8996cf879
@ -1,21 +1,27 @@
|
||||
// Copyright 2019 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
package io.flutter.plugins.geofencing
|
||||
|
||||
package com.cloud.diplomaticquarterapp.geofence
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
|
||||
import com.cloud.diplomaticquarterapp.utils.HMGUtils
|
||||
|
||||
class GeofencingRebootBroadcastReceiver : BroadcastReceiver() {
|
||||
class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action.equals("android.intent.action.BOOT_COMPLETED")) {
|
||||
|
||||
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) {
|
||||
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
|
||||
pref.edit().putString("REBOOT_DETECTED","YES").apply()
|
||||
|
||||
HMG_Geofence.shared(context).unRegisterAll { status, exception ->
|
||||
HMG_Geofence.shared(context).re
|
||||
val geoZones = HMGUtils.getGeoZonesFromPreference(context)
|
||||
HMG_Geofence.shared(context).register(geoZones)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue