From a17740e9146e4e2431d62964d044287cccc3ee85 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Fri, 30 Mar 2018 14:50:15 -0400 Subject: Add a flag to control whether DocumentSnapshots return Dates or Timestamps for timestamp fields (#831) * add a new property `timestampsInSnapshotsEnabled` to `FirestoreSettings`, `false` by default; * add a verbose warning message urging users to opt into the new behavior; * set `timestampsInSnapshotsEnabled` to true in the integration tests to reduce the verbose console spam during the test run and make sure the flag won't break anything once it's flipped. --- Firestore/Example/SwiftBuildTest/main.swift | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Firestore/Example/SwiftBuildTest/main.swift') diff --git a/Firestore/Example/SwiftBuildTest/main.swift b/Firestore/Example/SwiftBuildTest/main.swift index cd2462b..3087085 100644 --- a/Firestore/Example/SwiftBuildTest/main.swift +++ b/Firestore/Example/SwiftBuildTest/main.swift @@ -52,6 +52,7 @@ func initializeDb() -> Firestore { let settings = FirestoreSettings() settings.host = "localhost" settings.isPersistenceEnabled = true + settings.areTimestampsInSnapshotsEnabled = true firestore.settings = settings return firestore @@ -333,6 +334,7 @@ func types() { let _: Firestore let _: FirestoreSettings let _: GeoPoint + let _: Timestamp let _: ListenerRegistration let _: QueryListenOptions let _: Query -- cgit v1.2.3