dev-hwang / poly_geofence_service Goto Github PK
View Code? Open in Web Editor NEWThis plugin is a service that can perform geo-fencing by creating a polygon geofence.
License: Apache License 2.0
This plugin is a service that can perform geo-fencing by creating a polygon geofence.
License: Apache License 2.0
Hello - Quick functionality question... We have a use case we are trying to confirm whereby the fence is predetermined and set by a director of an sporting event and participants in the event would already be inside the geo-fence when the service is started -- by an application flow and action. An example would be an event participant "checking in" from certain locations from within the fence (note that the Enter fence status does not occur in this scenario). With the check-in action is done by the participant, we would be looking to confirm their location in relation to the geofence (ex: DWELL status )
As noted, the geofence service would be specifically started when the participant has tapped the check-in button and would be stopped following a subsequent action in the flow. The service would not be constantly running to conserve the battery.
Is what we are trying to accomplish feasible?
Thanks in advance
I re-visited a project that worked with 1.6.0 and got this error...
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':fl_location' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
Not knowing the correct version of kotlin I tried 1.3.50, 1.4.20, 1.5.20, and 1.6.10 without success
so I looked at your code and found...
buildscript {
ext.kotlin_version = '1.5.31'
So I tried 1.5.31 and still the got the same error
When I tried to upgrade to to 2.0.0 I get the following error...
Error: Failed running flutter pub get...
Because poly_geofence_service >=2.0.0 depends on flutter_foreground_task ^4.1.0 which depends on shared_preferences ^2.0.17, poly_geofence_service >=2.0.0 requires shared_preferences ^2.0.17.
So, because custom_widget depends on both poly_geofence_service ^2.0.0 and shared_preferences 2.0.15, version solving failed.
Hi @Dev-hwang,
What was the reason to upgrade to Android 23? Did you find some important issue? I'm using Android 21 in some devices,
BR.
@Dev-hwang, Thanks for your great package.
I found an issue in this package.
Geofencing works well when the app is in the foreground or background.
However, it does not work when the app is completely terminated.
It seems that this package does not support that feature when the app is terminated.
I think geofencing should work even when the app is off.
Thanks.
Hi I'm trying to construct the below function and getting a conflict. I have imported as per recommendation import 'package:latlong2/latlong.dart' as latLong; Your assistance will be appreciated.
Issue is picked up on line " polygon: geofenceDataList[i].polygon,"
ERROR: The argument type 'List (where LatLng is defined in C:\DEVELOPMENT\flutter.pub-cache\hosted\pub.dartlang.org\latlong2-0.8.1\lib\latlong\LatLng.dart)' can't be assigned to the parameter type 'List (where LatLng is defined in C:\DEVELOPMENT\flutter.pub-cache\hosted\pub.dartlang.org\poly_geofence_service-1.6.0\lib\models\lat_lng.dart)'.
final _polyGeofenceList = [];
Future _fetchGeofenceDataList() async {
// Get geofence data from the server
final geofenceDataList = await getGeofenceDataList();
// Convert GeofenceData to PolyGeofence
_polyGeofenceList.clear();
PolyGeofence newGeofence;
for (var i=0; i<geofenceDataList.length; i++) {
newGeofence = PolyGeofence(
id: geofenceDataList[i].id,
data: geofenceDataList[i].data,
polygon: geofenceDataList[i].polygon,
);
_polyGeofenceList.add(newGeofence);
}
// Add new geofence data into service
_polyGeofenceService
..clearPolyGeofenceList()
..addPolyGeofenceList(_polyGeofenceList);
// UI update or etc.
}
Future<String> parseJsonFromAssets(String assetsPath) async {
return rootBundle.loadString(assetsPath);
}
Future<List<GeofenceData>> getGeofenceDataList() async {
String Json = await parseJsonFromAssets("assets/polygonlnglat.json");
return (json.decode(Json) as List)
.map((data) => GeofenceData.fromJson(data))
.toList();
}
======== Exception caught by services library ======================================================
The following MissingPluginException was thrown while activating platform stream on channel poly_geofence_service/location_service_status:
MissingPluginException(No implementation found for method listen on channel poly_geofence_service/location_service_status)
When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw
packages/flutter/src/services/platform_channel.dart 154:7 _invokeMethod
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1687:54 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 155:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 707:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 736:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 542:5 [_completeWithValue]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 580:7 callback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15
I am trying to use on a device with no Google play services but I am getting an error:
requires the Google Play Store, but it is missing.
GooglePlayServicesUtil: com.example.geo_gate requires the Google Play Store, but it is missing.
Does this use Google play services or is something else in my app trying to use them?
I tried this your example poly_geofance_service.
I want to display this polygon geofence in a map using flutter map, I got example how to display polygon from https://github.com/fleaflet/flutter_map,
in your example, I add a FlutterMap widget and add a polygon layer, but when I fill flutter map option with LatLng(latitude, longitude) there was problem:
The argument type 'LatLng (where LatLng is defined in D:\FLUTTER\Sample\GEOFENCES\poly_geofence_service-master\lib\models\lat_lng.dart)'
can't be assigned to the parameter type 'LatLng (where LatLng is defined in C:\flutter.pub-cache\hosted\pub.dartlang.org\latlong2-0.8.1\lib\latlong\LatLng.dart)'.dartargument_type_not_assignablelat_lng.dart(4, 5): LatLng is defined in D:\FLUTTER\Sample\GEOFENCES\poly_geofence_service-master\lib\models\lat_lng.dart
LatLng.dart(26, 16): LatLng is defined in C:\flutter.pub-cache\hosted\pub.dartlang.org\latlong2-0.8.1\lib\latlong\LatLng.dart
can you help me how the way?
thanks
java.lang.RuntimeException: Unable to create service com.pravera.flutter_foreground_task.service.ForegroundService: java.lang.SecurityException: com.travel.goessy: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.