geofire

How to add background service in Geofence android

心已入冬 提交于 2021-02-06 08:51:50
问题 I am trying to create a geofence with background service for monitor. The geofence create successfully and work when apps Activity is open but when close the app geofence not work. What should I do now. My code is: public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

React useEffect avoid update callback in every update

为君一笑 提交于 2021-01-28 21:46:42
问题 Is there a way to avoid update a callback in useEffect?. For example I am subscribed an event with geofire, this listens for changes and receive locations. I need to update my state without subscribing every time on every update. Current behavior Subscribed to geofire and receive location (A) Update my state with the new location (A) Subscribed to geofire again and receive location (A) this is an infinite loop. And I can't receive the other locations Expected behavior subscribed to geofire

Firebase cloud functions find nearby locations

别来无恙 提交于 2021-01-28 09:40:59
问题 I need to find nearby vehicles within a specific radius to a given point and have those sorted by the distance from the given point. Does firebase provide a way to query geographical data? I need to do this within a cloud function. Entirely new to firebase so any help is appreciated. 回答1: Using the geofire library you could do something like this... exports.cloudFuncion = functions.https.onRequest((request, response) => { // logic to parse out coordinates const results = []; const

Can I apply pagination on GeoFire Query to reduce load time

狂风中的少年 提交于 2020-07-18 08:38:05
问题 I have used GeoFire to fetch location based data from my Firebase database. I know if I set less radius in my query then I am able to load data quickly, but my requirement is that I want shorted data based on location, so nearest records shows first, and so on. So I have passed current location in GeoFire query with total earth radius, because I want all data. But I don't how to apply pagination with GeoFire, so in future when more records are available in Firebase database my current

Can I apply pagination on GeoFire Query to reduce load time

淺唱寂寞╮ 提交于 2020-07-18 08:37:34
问题 I have used GeoFire to fetch location based data from my Firebase database. I know if I set less radius in my query then I am able to load data quickly, but my requirement is that I want shorted data based on location, so nearest records shows first, and so on. So I have passed current location in GeoFire query with total earth radius, because I want all data. But I don't how to apply pagination with GeoFire, so in future when more records are available in Firebase database my current

GeoFire + Swift 3 can't stop observing

强颜欢笑 提交于 2020-07-09 06:40:45
问题 I'm using GeoFire and trying to fetch only 3 results that satisfy some conditions. This it my case and it doesn't stop observer. There are several thousands results and I get it all but I need only 3. I based on this answer but it does't work in my case as you can see. Please can somebody help? var newRefHandle: FIRDatabaseHandle? var gFCircleQuery: GFCircleQuery? func findFUsersInOnePath(location: CLLocation, radius: Int, indexPath: String, completion: @escaping () -> ()){ var ids = 0 let

Assemble a list of users with Geofire/Firebase

百般思念 提交于 2020-07-05 12:42:01
问题 I have a class called User, which has a function that gets all nearby food trucks using GeoFire. I've used an observeReadyWithBlock to take the truck IDs returned by GeoFire, and get the rest of their information using Firebase. However, when I go to access one of the trucks from my array of Truck objects after adding their name and description, it looks like xCode is telling me the array is empty. I am planning on using this array of nearby trucks in other controller classes, to populate

getting nearby users android with firebase

心不动则不痛 提交于 2020-02-08 09:51:04
问题 i am using firebase realtime database to store two types of users for two apps, users A will use App A to update their info and such, and users B will use app B to search nearby users A that they need their services from. I have been successful in uploading user A info from app A, even with location using geofire, now what i need is to show a list of usera A inside app B that are nearby. please help with answers regarding best ways/practices and if this here isnt the best method then

Associate Geofire location with Firebase entry

廉价感情. 提交于 2020-02-03 04:38:08
问题 So, I have an Android app that lets users view posts within a certain radius of their current location. I am storing the posts using firebase, but I couldn't find a way to query for posts within a specific radius in firebase, so now I am thinking of using geofire, but I am not sure if there is a way to store a location alongside my firebase posts using geofire, so, it would seem to me like the only way to associate a location with a post is to have the post id (the one generated by firebase)

Firebase - Geofire and Cloud Functions. Does end of function means no more listeners?

浪子不回头ぞ 提交于 2020-01-14 03:01:09
问题 In my cloud functions's index.js file, I have the following function body: exports.onSuggestionCreated = functions.firestore.document('suggestions/{userId}').onCreate(event => { return admin.firestore().doc(`places/settings/profile`).get().then(doc => { [...] const location = data.location const ref = admin.database().ref(`suggestion_locations`) const geoFire = new GeoFire(ref) var geoQuery = geoFire.query({ center: [location.latitude, location.longitude], radius: 1.0 }) geoQuery.on("key