Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geofence and send push notifications

before I learn react native from scratch, I was wondering if it is possible to geofence certain areas and then send push notifications to the user when he enters the geofenced areas even if he is currently not using the app. Thank you

like image 232
F Melp Avatar asked Dec 03 '25 10:12

F Melp


1 Answers

You can access official documentation of Push Notification:

  • https://facebook.github.io/react-native/docs/pushnotificationios.html

Added a sample apps for you to take a look:

  • https://github.com/transistorsoft/rn-background-geolocation-demo
  • https://github.com/zo0r/react-native-push-notification

Basically you should enable push notification in your project and save the location you get from the navigator.geolocation.getCurrentPosition callback somewhere in you app, you could use AsyncStorage for that purpose. callback is only called if the location is changed.

like image 152
locropulenton Avatar answered Dec 04 '25 22:12

locropulenton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!