-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for reregistering geofences after reboot on Android
- Loading branch information
Showing
3 changed files
with
197 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
android/src/main/kotlin/io/flutter/plugins/geofencing/GeofencingRebootBroadcastReceiver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
class GeofencingRebootBroadcastReceiver : BroadcastReceiver() { | ||
override fun onReceive(context: Context, intent: Intent) { | ||
if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { | ||
Log.e("GEOFENCING REBOOT", "Reregistering geofences!") | ||
GeofencingPlugin.reRegisterAfterReboot(context) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters