Category : google-cloud-firestore

Is there any library that helps to query firestore db and return results order by distance (ascending/descending) from user’s current location. https://firebase.google.com/docs/firestore/solutions/geoqueries This above documetation GeoQuery return documents with in the range but not in sorted order even after giving a direction. public Query getDocuments(MainActivity mActivity, GeoQueryBounds bounds) { return FirebaseFirestore.getInstance() .collection("user") .whereEqualTo("type", Integer.valueOf("1")) .orderBy("geoHash", ..

Read more

I try to retrive data from the Firebase firestore cloud and display it in a recyclerview. My problem is that the list type is MutableList<DocumentSnapshot> but I need to convert it into a custom class. I also use MVVM. This is how I retrive the data suspend fun getRecipe(): MutableList<DocumentSnapshot> { val snapshot = recipeCollectionRef.get().await() ..

Read more

The task is to update certain fields on a document in Cloud Firestore. I have created a singleton repository class and I’m initializing it in the SplashActivity. When the repository is instantiated I attach a snapshotListener to the documentReference and set user value to MutableLiveData. The code for the same is here: documentReference.addSnapshotListener((document, error) -> ..

Read more

Get Count Of Items I Got From Firestore And Set The Count Eg: 142 To Button Text My Try Button report = (Button) findViewById(R.id.report); FirebaseFirestore db = FirebaseFirestore.getInstance(); db.collection("Reported Users").whereEqualTo("email", useremail).get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() { @Override public void onComplete(@NonNull Task<QuerySnapshot> task) { for (QueryDocumentSnapshot document : task.getResult()) { //Set Button Text To Count Of This How Many ..

Read more

I have been trying to implement search using firestoreUI but when i run my code the logcat says that: java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.firebase.ui.firestore.FirestoreRecyclerAdapter.startListening()’ on a null object reference at com.example.homebarberv1.Search.onStart(Search.java:93) below is my code: public class Search extends AppCompatActivity implements FirebaseAuth.AuthStateListener{ private EditText searchField; private Button searchButton; private RecyclerView searchRecyclerview; private ..

Read more

I am working on an app that pays users to solve quizzes. The revenue is generated through ads that are displayed on various sections of the app. Now mischevious developers can decompile app and remove Ads partially or wholly. Hurting my revenue model. I want to filter out modded versions of my app and ban ..

Read more