transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
649 stars 239 forks source link

not getting notification on geofence entry and exit using demo app #757

Closed bajjajjrajjesh closed 2 years ago

bajjajjrajjesh commented 2 years ago

Hi @christocracy

I have used the demo android app for flutter and I am not getting notification on geo fence entry and exit. Please the app link: https://play.google.com/store/apps/details?id=com.transistorsoft.flutterbackgroundgeolocationexample

christocracy commented 2 years ago

It is certainly due to your specific device (which you’ve not provided).

I’m testing every day on a variety of devices and it works. I have geofences all around my neighbourhood and along my bike ride.

bajjajjrajjesh commented 2 years ago

I have tried using mock location app and I have tested on few devices and it is still not the getting notification.

bajjajjrajjesh commented 2 years ago

@christocracy Can you please advise what needs to be done? why am I not getting notification?

christocracy commented 2 years ago

I suggest you try the /example app in this repo.

Also see Wiki Debugging and learn to observe the plugin logs.

christocracy commented 2 years ago

Also see https://dontkillmyapp.com

bajjajjrajjesh commented 2 years ago

I have even kept my phone on foreground and I am still getting notification, additionally I have kept phone in background and geo fence is reach in 30 seconds which means app won't get killed so soon. In either of condition app is not sending notification.

christocracy commented 2 years ago

I guess your phone sucks. Use a different one.

I test on the following devices, all with the same geofences throughout my neighborhood and daily bike ride.

bajjajjrajjesh commented 2 years ago

Also just for the info, I have used similar app in same phone and that is working fine, which clearly means its not a issue specific to device.

I am pressing and holding the point in map to create the geofence and I assume that shall send the notification

bajjajjrajjesh commented 2 years ago

also I have used 4 different brands of phone and all has same issue @christocracy

christocracy commented 2 years ago

You need to authorize Always. Not When in Use

christocracy commented 2 years ago

Are you even looking at the logs. The /example app has a handy “email log” button.

bajjajjrajjesh commented 2 years ago

I will make a log and send it to you.

christocracy commented 2 years ago

You’re simulating location.

Geofences almost never fire with mocked locations.

go outside with a real device.

bajjajjrajjesh commented 2 years ago

I did a real drive still I am not getting notification.

christocracy commented 2 years ago

Logs…

bajjajjrajjesh commented 2 years ago

I am using app from play store. Does it has option to generate log?

christocracy commented 2 years ago

What did I say here? https://github.com/transistorsoft/flutter_background_geolocation/issues/757#issuecomment-1139270969

And don’t post a massive amount of log text. Attach the file

christocracy commented 2 years ago

A typical day (today) of field-testing with 5 devices using the Sample App:

Samsung Galaxy S20 FE @ 12

Screen Shot 2022-05-27 at 3 39 35 PM

OnePlus A5010 @ 9.0.0

Screen Shot 2022-05-27 at 3 41 34 PM (1)

Pixel 3a @ 11

Screen Shot 2022-05-27 at 3 44 15 PM

Pixel 6 @ 12

Screen Shot 2022-05-27 at 3 45 15 PM

iPhone 12 Pro @ 15.4.1

Screen Shot 2022-05-27 at 3 42 49 PM
bajjajjrajjesh commented 2 years ago

These rounds are geofence? I don’t see this circle.

Also based on your screenshot it does shows that you have got notification for this geofence.

christocracy commented 2 years ago

These rounds are geofence?

They are rendered in the demo server at http://tracker.transistorsoft.com when the plugin posts an onGeofence event.

They are also rendered in the demo app

Screen Shot 2022-05-28 at 12 12 33 PM
bajjajjrajjesh commented 2 years ago

This is just not working for me at all. I am unsure if I am making any mistake. More ever neither of your screenshot shows that you are getting notification of geofence.

bajjajjrajjesh commented 2 years ago

Please advise me what shall be my next step from here as I am completely lost in this process now.

christocracy commented 2 years ago

neither of your screenshot shows that you are getting notification of geofence.

Yes they do. The last screenshot shows 9 geofence events.

I don’t know what else to tell you. It’s not that hard.

bajjajjrajjesh commented 2 years ago

Clearly I am not getting notification so what other steps I shall follow. Btw same device works fine with react native plugin to track location all the time. Which means it can't be device specific issue.

christocracy commented 2 years ago

I have no idea what you’re doing wrong. Nobody has as much issue with geofences as you. The plugin has been doing geofencing since 2015. I test them every day.

Go analyze your logs.

bajjajjrajjesh commented 2 years ago

Is there a way to analyse the log when moving in real and device not connected to system.

christocracy commented 2 years ago

No. Simply use .emailLog()

bajjajjrajjesh commented 2 years ago

Hi @christocracy here is the log

https://we.tl/t-o2Ao205ZKt

bajjajjrajjesh commented 2 years ago

Hi @christocracy can you check the log.

christocracy commented 2 years ago

Your logs do not show any evidence that you have added any geofences to monitor. You should not expect geofence events if you are not monitoring geofences.

When you are monitoring geofences, you will see something like this in the logs:

05-31 12:47:35.958 28922 29434 D TSLocationManager: [c.t.l.g.TSGeofenceManager$f run]
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╔═════════════════════════════════════════════
05-31 12:47:35.958 28922 29434 D TSLocationManager: ║ TSGeofenceManager monitoring 18/18
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╠═════════════════════════════════════════════
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Home
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Parc Outremont
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] 5 Saison
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Laj
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Park Beaubien
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Parc & Fairmount
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Parc Couches Tard
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Laurier & Côtes Saint Catherines
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Mountain 1
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Mountain 2
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Mountain 3
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Mountain 4
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Mountain 5
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Mountain Lake
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Park JFK
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Rope Park
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Cafe Union
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╟─ 🎾  [Flutter] Park Laurier
05-31 12:47:35.958 28922 29434 D TSLocationManager: ╚═════════════════════════════════════════════
bajjajjrajjesh commented 2 years ago

I pressed and hold on the map to make geofence. I am unsure if I making any mistake.

christocracy commented 2 years ago

And you've decided to ignore that [Add] button on the top toolbar?

Screenshot_20220531-130650

christocracy commented 2 years ago

So…? Is this issue closed?

bajjajjrajjesh commented 2 years ago

Hi @christocracy I have managed to get the latest log. can you please check this. IT has not geofence but I am still not getting notification but I do hear the debug sound. background-geolocation.log (1).gz

christocracy commented 2 years ago

You wasted all my time because you weren't hitting the [Add] button on the Dialog. Your logs are full of geofence events (20 of them).

Your geofence events are firing. This issue is closed.

06-01 16:29:35.247 INFO [GeofencingService a] 
╔═════════════════════════════════════════════
║ Geofencing Event: ENTER
╠═════════════════════════════════════════════
╟─ 1
╚═════════════════════════════════════════════
  ℹ️  [onGeofence] Flutter received onGeofence event [GeofenceEvent identifier: 1, action: ENTER]
06-01 16:30:57.232 INFO [GeofencingService a] 
╔═════════════════════════════════════════════
║ Geofencing Event: ENTER
╠═════════════════════════════════════════════
╟─ 2
╚═════════════════════════════════════════════
  ℹ️  [onGeofence] Flutter received onGeofence event [GeofenceEvent identifier: 2, action: ENTER]
06-01 16:31:28.196 INFO [GeofencingService a] 
╔═════════════════════════════════════════════
║ Geofencing Event: EXIT
╠═════════════════════════════════════════════
╟─ 2
╚═════════════════════════════════════════════
  ℹ️  [onGeofence] Flutter received onGeofence event [GeofenceEvent identifier: 2, action: EXIT]
christocracy commented 2 years ago
Screen Shot 2022-06-01 at 10 44 46 PM
bajjajjrajjesh commented 2 years ago

Issue was without giving name to a geofence it would allow me to click save button and won’t save. That was only missed in the log I sent you. Otherwise my colleague was following same process as I was doing in the last one.

You maybe able to see the log. But I am not getting notification as an push notification for this geo fence. What shall be done about about that.

christocracy commented 2 years ago

I’m not interested in your push notifications.

the plug-in’s responsibility ends when you can print a log message from your onGeofence event.

this is a geolocation plugin, not a local notification plugin (push notifications are sent from a server to a device; local notifications are emitted by the device).

what you do in your onGeofence event is your business.

I suggest you consult with your particular notification plugin you’re using as to why they don’t fire.

this issue is solved and closed.