rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
287 stars 321 forks source link

Callback method was not called from 1.6.12. But its printing locations. #320

Open saravananmnm opened 2 years ago

saravananmnm commented 2 years ago

D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927120997E12, is_mocked=false, speed=0.0, longitude=76.9599733}} D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927126997E12, is_mocked=false, speed=0.0, longitude=76.9599733}} D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927131997E12, is_mocked=false, speed=0.0, longitude=76.9599733}} D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927137999E12, is_mocked=false, speed=0.0, longitude=76.9599733}} D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927143999E12, is_mocked=false, speed=0.0, longitude=76.9599733}} I/flutter ( 4252): <<< h D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927148999E12, is_mocked=false, speed=0.0, longitude=76.9599733}} D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927155001E12, is_mocked=false, speed=0.0, longitude=76.9599733}} D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927161001E12, is_mocked=false, speed=0.0, longitude=76.9599733}} D/plugin ( 4252): sendLocationEvent {callback=8931727499, location={altitude=0.0, heading=90.0, latitude=11.01645, accuracy=5.0, speed_accuracy=0.5, time=1.648927166003E12, is_mocked=false, speed=0.0, longitude=76.9599733}}

saravananmnm commented 2 years ago

await BackgroundLocator.registerLocationUpdate( LocationCallbackHandler.callback, initCallback: LocationCallbackHandler.initCallback, initDataCallback: data, disposeCallback: LocationCallbackHandler.disposeCallback, autoStop: false, iosSettings: IOSSettings( accuracy: LocationAccuracy.NAVIGATION, distanceFilter: 0), androidSettings: AndroidSettings( accuracy: LocationAccuracy.NAVIGATION, interval: 5, distanceFilter: 0, client: LocationClient.google, androidNotificationSettings: AndroidNotificationSettings( notificationChannelName: AppStrings.get()!.locBgNotificationChannelName, notificationTitle: AppStrings.get()!.locBgNotificationTitle, notificationMsg: isLocationPlusSyncUp ? 'Tracking location in background' : 'Background SyncUp of orders going on', notificationBigMsg: '', notificationIcon: '', notificationIconColor: Colors.grey, notificationTapCallback: null /*LocationCallbackHandler.notificationCallback*/)));

daniyal471 commented 2 years ago

same error

Maaar97 commented 2 years ago

Same for me I'm using background_location 1.6.12 with Flutter 2.8.1 The native event is triggered but the callback is not

Edit: I fixed it changing the location_dto.dart file to look like it is on some active PR

Yukams commented 2 years ago

Yup, that fixed it for me, just modify location_dto.dart according to this topic

caiobraga commented 2 years ago

how to change the location_dto.dart file? i found it, but don't know what to do with it

caiobraga commented 2 years ago

how to change the location_dto.dart file? i found it, but don't know what to do with it

nevermind, i found the solution folowing the link of yukams

Yukams commented 2 years ago

If you ever have problems with the plugin, I'm just letting you guys know that I have a fully working fork here. For example if you need the app to be up again after an Android reboot.

caiobraga commented 2 years ago

If you ever have problems with the plugin, I'm just letting you guys know that I have a fully working fork here. For example if you need the app to be up again after an Android reboot.

thank you, i also did a fork here: https://github.com/caiobraga/background_locator.git if you whant to check, we could help each other.