GithubHelp home page GithubHelp logo

dev-hwang / poly_geofence_service Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 5.0 158 KB

This plugin is a service that can perform geo-fencing by creating a polygon geofence.

License: Apache License 2.0

Kotlin 3.50% Ruby 7.00% Swift 2.70% Objective-C 2.47% Dart 84.33%
flutter android ios polygon geofence foreground-service

poly_geofence_service's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

poly_geofence_service's Issues

Starting geofence service while within the fence

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

Unable to use previous version and unable to upgrade to latest version

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.

Add more than one poly geofance

Hi, I have question, I tried to add more polygon in a map, how to call function when the geofence status changed in different area/region?
I saved each status changed to sqlite database, to display as status history.

I give example picture.

poly

thanks.

Geofence doesn't work when the app terminated.

@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.

Conflict in dependencies

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();

}

MissingPluginException(No implementation found for method listen on channel poly_geofence_service/location_service_status)

======== 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

Does it use Google Play Services?

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?

How to display polygon geofance in Flutter Maps

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_assignable

lat_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

Forground service issue in Android 14

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.