michaelklem / alertwalker_mobile

Mobile React Native app for Alert Walker
0 stars 0 forks source link

Other's alerts should populate map if within area #2

Open tgreco opened 2 years ago

tgreco commented 2 years ago
  1. When an alert is created and is within a user's radius, the alert info needs to be sent via notification (which already works) but also via web socket so the alert can be added to the map immediately. There appears to be logic in palce for the web socket part, but it does not seem to get triggered. Can you verify the web socket portion works to send data under this condition.
tgreco commented 2 years ago

https://user-images.githubusercontent.com/27317898/125544817-8d25837c-395c-43c2-8419-28d5fc927257.mov

@michaelklem this appears to be working on my end. It doesn't appear to be setup to use any configuration to make sure I'm within a certain area of the geofence alert. But it does correctly populate the map for me.

Should I proceed with making this use a configuration that specifies how close a user should be to receive the alert?

michaelklem commented 2 years ago

Yes. Default to 1000 feet.

On Tue, Jul 13, 2021, 6:11 PM tgreco @.***> wrote:

https://user-images.githubusercontent.com/27317898/125544817-8d25837c-395c-43c2-8419-28d5fc927257.mov

@michaelklem https://github.com/michaelklem this appears to be working on my end. It doesn't appear to be setup to use any configuration to make sure I'm within a certain area of the geofence alert. But it does correctly populate the map for me.

Should I proceed with making this use a configuration that specifies how close a user should be to receive the alert?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michaelklem/alertwalker_mobile/issues/2#issuecomment-879506236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEQIO65FTI5I2ID4SDIAVLTXTP5PANCNFSM5AKMXOUQ .

tgreco commented 2 years ago

This is complete now. https://github.com/michaelklem/alertwalker_mobile/commit/357ac032bc5c7709b0033e1c2bb5be32314826b9

You will need to merge the backend changes to main branch as I committed them on master out of habit. https://github.com/michaelklem/alertwalker_backend/pull/new/master

The value for how close a user must be is stored in the configuration "MAP_DISPLAY_ALERT_RADIUS".

When location/map and location/geofence are called I now store the user's location in the user collection under the field "lastLocation".

Then when the backend is looking for nearby users to send the websocket message to it will filter on user.lastLocation.

I have only added this to the alertwalker-dev database. Should I add this to the other databases as well?