简体   繁体   中英

flutter where should I put firestore timestamp setting on Android

When using firestore console message saying you need to write timestamp setting. On iOS I wrote in appdelegete and no message anymore but I'm from iOS land so I'm not sure where I should put those on Android side. Where should I put those?

Console message

Firestore(25948):
W/Firestore(25948): FirebaseFirestore firestore = FirebaseFirestore.getInstance();
W/Firestore(25948): FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
W/Firestore(25948):     .setTimestampsInSnapshotsEnabled(true)
W/Firestore(25948):     .build();
W/Firestore(25948): firestore.setFirestoreSettings(settings);

You can also achieve this with Dart code:

Future<void> main() async {
  await Firestore.instance.settings(
    timestampsInSnapshotsEnabled: true,
  );

  runApp(...);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM