Giter Club home page Giter Club logo

flutter-radar's Introduction

Radar

npm

Radar is the leading geofencing and location tracking platform.

The Radar SDK abstracts away cross-platform differences between location services, allowing you to add geofencing, location tracking, trip tracking, geocoding, and search to your apps with just a few lines of code.

Documentation

See the Radar overview documentation here.

Then, see the Flutter package documentation here.

Examples

See an example app in example/.

Support

Have questions? We're here to help! Email us at [email protected].

flutter-radar's People

Contributors

andlum avatar brettguenther avatar gabrielalao avatar jrtibbetts avatar kennyhuradar avatar nickpatrick avatar tjulien avatar york-wei avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-radar's Issues

Migrate to null safety

Hello There.

As of now, most of the packages/plugin has been migrated to null-safety, and most of the projects use null safety.
Can you guys please migrate to null safety?
I would be happy to work on PR

Thanks
Jigar

Edit. 1
I see there is PR available to merge for null safety.

Any ETA when you guys can merge it

Radar SDK isn't consistent with updating values and does not support offline or batch sync

We are currently on the Team Plan and our project name is TD God-View. We integrated the flutter plugin for our product which is a Logistics App.

We have observed some inconsistency in the behaviour of the plugin which we would like to clarify for trips.

  1. When we started a trip we noticed the trip did not have the userId field set even though we could see from the logs that we were setting this value
  2. Trip was not updated even after calling start trip, we could not see the trip on the radar dashboard. 
  3. At some point, after recalling the start trip function pertaining to our use case, we would get the results on radar sometimes in a perfect manner and sometimes we get it inconsistently.

Our implementation
We initialised the plugin on the main method, which was verified because the plugin logged the radar initialise method on the console.
await Radar.initialize(environment['RADAR_PUBLISHABLE_KEY']!);

The plugin logged this: 

I/RadarLogger(21315): :round_pushpin:️ Radar initialized

After initialising the plugin we set the user ID and the user description immediately after the user logged in following the documentation procedure which states that the function is meant to be called only once. And we also verified the plugin stored the data by calling the getUserId function on the plugin.

static Future<void> initRadar(BuildContext context) async{

 /// [TdUser] details
 String userId = context.read<LoginProvider>().currentUser!.id!;
 String displayName = context.read<LoginProvider>().currentUser!.displayName;

 /// [logger]
 log('');
 log('---------------- RADAR INITIALIZED ----------------');
 log('::::: UserId: $userId :::::');
 log('::::: Display Name: $displayName :::::');
 log('');

 /// Setting user's Description
 await Radar.setUserId(userId);
 await Radar.setDescription(displayName);
 await Radar.startTracking('continuous');
 log('Radar tracking');
}

This was logged immediately this method was called:

[log] ---------------- RADAR INITIALIZED ----------------
[log] ::::: UserId: Eds4G5HD2AypMeBPD :::::
[log] ::::: Display Name: Babalola Gbogo :::::

This was logged after a little while
[log] Radar tracking

Then we proceeded to starting a trip in which sometimes it won’t start and sometimes it will.

static Future<void> startTrip({
 required BuildContext context,
}) async {
 final Stop _firstStop = context
   .read<TripProvider>()
   .stops!
   .where((_stop) => _stop.position == 1)
   .toList()
   .first;
 final String externalId =
   '${_firstStop.deliveryTripId}_${_firstStop.stopId}';
 final outlet = await _getRetailOutlet(
  context,
  _firstStop,
 );

 /// [logger]
 log('');
 log('---------------- START TRIP ----------------');
 log('::::: First Stop: ${_firstStop.retailOutletName} :::::');
 log('::::: Outlet Type: ${outletMapper(
  outlet: outlet!.outletType,
 )} :::::');
 log('');

 /// Starting trip with radar
 await _startRadarTrip(
  externalId: externalId,
  outletType: outletMapper(
   outlet: outlet.outletType,
  ),
  outletId: outlet.retailOutletId!,
 );
  log('Trip Started');
}

We verified that it called these methods using the log output

[log] ---------------- START TRIP ----------------
[log] ::::: First Stop: Liquid metal :::::
[log] ::::: Outlet Type: large-super-market :::::

And then after a little delay this got logged
[log] Trip Started

Flutter SDK Geofencing capabilities

Any plans on a Flutter SDK update regarding the geofencing capabilities already present in the Android/iOS SDKs ? The plugin itself seems amazing for geofencing (my particular use case) but, from what I could see in the official documentation, background tracking regarding geofencing is only present on Android and iOS. There could be fixes around this problem with events but there is also no documentation about those in the Flutter SDK docs. Is this going to be a feature or is it on hold/not planned ?

Radar.onEvents() never called

I have a problem with Radar.onEvents(), is never called :

Radar.initialize("prj_test_pk_*");
Radar.setUserId(mUserId);
Radar.startTracking('responsive');
Radar.onEvents((result) {
    print("RADAR GEOFENCE DETECTED EVENTS");
    print(result);
});

On my IDE logs I've :
Capture d’écran 2023-01-18 à 16 17 28

But my print on the onEvents listener not show.

What have I done wrong ?

Thanks.

Install Radar with Kotlin & Swift?

New Flutter projects uses Kotlin for Android and Swift for iOS by default, but in Radar's Flutter plugin docs (https://radar.com/documentation/sdk/flutter) the example is still in Java & Objective C. Since most Flutter devs are like me, who have very limited understanding of native platform, it would be very helpful to include steps to install Radar in Kotlin/Swift.

I also noticed that in my Flutter project, the MainApplication.java file is missing. No equivalent file in Kotlin either. I have no idea where to put the initialization code for Radar.

Am I missing anything?

Dart Error: Dart_LookupLibrary When building/running app in release mode.

I have been facing an issue related to working of radar in release mode. While in debug mode the library is working fine with no errors, I think it is being caused due to obfuscation due to which R8 is removing the native code/methods [https://github.com/dart-lang/sdk/blob/master/runtime/docs/compiler/aot/entry_point_pragma.md]. I tried adding @pragma("vm:entry-point") to the flutter_radar.dart but it didn't solve the issue. This same issue is reproducible in the radar example code. Help from the team would be great.

flutter doctor:

[✓] Flutter (Channel stable, 3.19.3, on macOS 13.5 22G74 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.87.2)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!

LOGS:

E/flutter ( 5294): [ERROR:flutter/shell/common/shell.cc(117)] Dart Error: Dart_LookupLibrary: library 'package:flutter_radar/flutter_radar.dart' not found.
E/flutter ( 5294): [ERROR:flutter/runtime/dart_isolate.cc(677)] Could not resolve main entrypoint function.
E/flutter ( 5294): [ERROR:flutter/runtime/dart_isolate.cc(168)] Could not run the run main Dart entrypoint.
E/flutter ( 5294): [ERROR:flutter/runtime/runtime_controller.cc(462)] Could not create root isolate.
E/flutter ( 5294): [ERROR:flutter/shell/common/shell.cc(669)] Could not launch engine with configuration.

Im not sure it will help in explanation of this issue or debugging as this issue is appearing in stock radar example too. But I have included proguard-rules in my personal project as its an requirement by flutter_local_notifcation package:
proguard-rules.pro

## Gson rules
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
#-keepattributes InnerClasses
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}

# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

Edit: adding @pragma("vm:entry-point") before class Radar make the error E/flutter ( 6472): [ERROR:flutter/shell/common/shell.cc(117)] Dart Error: Dart_LookupLibrary: library 'package:flutter_radar/flutter_radar.dart' not found. go away.

@pragma("vm:entry-point")
class Radar {
  static const MethodChannel _channel = const MethodChannel('flutter_radar');

But the library still doesn't works.

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.