Question regarding OneSignal location and geolocation with push notification in general


I am still new to Ionic and coding in general, so if you need me to clarify anything, I would love to do so.

Basically I have an app that I am building with firebase using Ionic platform. And currently I am using OneSignal for push notification.

I want my app to be able to record each user’s current location and if an event is created within that user’s current location’s radius, then I would fire a push notification letting them know that some event is created say within let’s say 30 miles. So if I am currently in San Francisco and some one creates an event in the city next to me, I would receive a notification regardless my App is open or not. Does anyone know how to accomplish this?

Right now, what I thought about so far is using geoFire to push every user’s locations and do a geoquery when there is a new event, find those users’ who are within certain miles and then send push notification to these users. I was wondering if anyone has any better idea?

Also One Signal has some code related to location, but besides this one line of code, I can’t find anything help, Does anyone know where I can find more resources? window.plugins.OneSignal.promptLocation();

Thank you so much,