skip to Main Content

Firebase – why does the wrong toast message keep appearing?

I have a class called BookRoomActivity: public class BookRoomActivity extends AppCompatActivity { String staffPromotionCode; EditText etRoomName,etprice,etDate,etCapacity,etPromotion; Button btnBook; FirebaseFirestore db; final boolean[]promotionCodeMatched = {false}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_book_room); // Retrieve promotion code set by staff from…

VIEW QUESTION

Flutter – How to get a list of documents from Cloud Firestore using dart cloud_firestore package

I made a function to read a the data from a specific document and it works(code below) Future<List<String>> getAllServicesFromDatabase()async{ List<String> services = []; FirebaseFirestore db = FirebaseFirestore.instance; DocumentSnapshot<Map<String, dynamic>> results = await db.collection(dbCollection).doc(servicesDocument).get(); if(results.data() != null){ Map<String,dynamic> fetchedData = results.data()!;…

VIEW QUESTION

Firebase – how can i use serverTimestamp in angular/Fire in the compat mode

I have tried import firebase from 'firebase/compat/app'; import 'firebase/compat/firestore'; const firestore = firebase.firestore; this.form = this.builder.group({ items:[data.items, null], dateReported:[firestore.FieldValue.serverTimestamp(), Validators.required], ....}) i get this error: ERROR FirebaseError: Function WriteBatch.update() called with invalid data. Unsupported field value: a custom sl object…

VIEW QUESTION
Back To Top
Search