ServerTimestamp is always null on Firebase Firestore

前端 未结 4 2072
攒了一身酷
攒了一身酷 2020-11-22 07:58

I am trying to add a timestamp field in an Android client with Firebase Firestore.

According to the documentation:

Annotation used to mark a D

4条回答
  •  生来不讨喜
    2020-11-22 09:02

    I have similar problem, and I found this at my catlog and solved my problem

    firebaseFirestore = FirebaseFirestore.getInstance();
    FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
                    .setTimestampsInSnapshotsEnabled(true)
                    .build();
    firebaseFirestore.setFirestoreSettings(settings);
    

提交回复
热议问题