aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/API/FIRFirestore.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Source/API/FIRFirestore.mm')
-rw-r--r--Firestore/Source/API/FIRFirestore.mm60
1 files changed, 30 insertions, 30 deletions
diff --git a/Firestore/Source/API/FIRFirestore.mm b/Firestore/Source/API/FIRFirestore.mm
index 5486b75..3671b51 100644
--- a/Firestore/Source/API/FIRFirestore.mm
+++ b/Firestore/Source/API/FIRFirestore.mm
@@ -32,9 +32,7 @@
#import "Firestore/Source/API/FIRWriteBatch+Internal.h"
#import "Firestore/Source/API/FSTUserDataConverter.h"
#import "Firestore/Source/Core/FSTFirestoreClient.h"
-#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/Source/Util/FSTDispatchQueue.h"
-#import "Firestore/Source/Util/FSTLogger.h"
#import "Firestore/Source/Util/FSTUsageValidation.h"
#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h"
@@ -42,6 +40,8 @@
#include "Firestore/core/src/firebase/firestore/core/database_info.h"
#include "Firestore/core/src/firebase/firestore/model/database_id.h"
#include "Firestore/core/src/firebase/firestore/model/resource_path.h"
+#include "Firestore/core/src/firebase/firestore/util/hard_assert.h"
+#include "Firestore/core/src/firebase/firestore/util/log.h"
#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
#include "absl/memory/memory.h"
@@ -158,7 +158,7 @@ extern "C" NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain";
FIRFirestore *firestore = instances[key];
if (!firestore) {
NSString *projectID = app.options.projectID;
- FSTAssert(projectID, @"FirebaseOptions.projectID cannot be nil.");
+ HARD_ASSERT(projectID, "FirebaseOptions.projectID cannot be nil.");
FSTDispatchQueue *workerDispatchQueue = [FSTDispatchQueue
queueWith:dispatch_queue_create("com.google.firebase.firestore", DISPATCH_QUEUE_SERIAL)];
@@ -242,35 +242,35 @@ extern "C" NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain";
@synchronized(self) {
if (!_client) {
// These values are validated elsewhere; this is just double-checking:
- FSTAssert(_settings.host, @"FirestoreSettings.host cannot be nil.");
- FSTAssert(_settings.dispatchQueue, @"FirestoreSettings.dispatchQueue cannot be nil.");
+ HARD_ASSERT(_settings.host, "FirestoreSettings.host cannot be nil.");
+ HARD_ASSERT(_settings.dispatchQueue, "FirestoreSettings.dispatchQueue cannot be nil.");
if (!_settings.timestampsInSnapshotsEnabled) {
- FSTWarn(
- @"The behavior for system Date objects stored in Firestore is going to change "
- "AND YOUR APP MAY BREAK.\n"
- "To hide this warning and ensure your app does not break, you need to add "
- "the following code to your app before calling any other Cloud Firestore methods:\n"
- "\n"
- "let db = Firestore.firestore()\n"
- "let settings = db.settings\n"
- "settings.areTimestampsInSnapshotsEnabled = true\n"
- "db.settings = settings\n"
- "\n"
- "With this change, timestamps stored in Cloud Firestore will be read back as "
- "Firebase Timestamp objects instead of as system Date objects. So you will "
- "also need to update code expecting a Date to instead expect a Timestamp. "
- "For example:\n"
- "\n"
- "// old:\n"
- "let date: Date = documentSnapshot.get(\"created_at\") as! Date\n"
- "// new:\n"
- "let timestamp: Timestamp = documentSnapshot.get(\"created_at\") as! Timestamp\n"
- "let date: Date = timestamp.dateValue()\n"
- "\n"
- "Please audit all existing usages of Date when you enable the new behavior. In a "
- "future release, the behavior will be changed to the new behavior, so if you do not "
- "follow these steps, YOUR APP MAY BREAK.");
+ LOG_WARN(
+ "The behavior for system Date objects stored in Firestore is going to change "
+ "AND YOUR APP MAY BREAK.\n"
+ "To hide this warning and ensure your app does not break, you need to add "
+ "the following code to your app before calling any other Cloud Firestore methods:\n"
+ "\n"
+ "let db = Firestore.firestore()\n"
+ "let settings = db.settings\n"
+ "settings.areTimestampsInSnapshotsEnabled = true\n"
+ "db.settings = settings\n"
+ "\n"
+ "With this change, timestamps stored in Cloud Firestore will be read back as "
+ "Firebase Timestamp objects instead of as system Date objects. So you will "
+ "also need to update code expecting a Date to instead expect a Timestamp. "
+ "For example:\n"
+ "\n"
+ "// old:\n"
+ "let date: Date = documentSnapshot.get(\"created_at\") as! Date\n"
+ "// new:\n"
+ "let timestamp: Timestamp = documentSnapshot.get(\"created_at\") as! Timestamp\n"
+ "let date: Date = timestamp.dateValue()\n"
+ "\n"
+ "Please audit all existing usages of Date when you enable the new behavior. In a "
+ "future release, the behavior will be changed to the new behavior, so if you do not "
+ "follow these steps, YOUR APP MAY BREAK.");
}
const DatabaseInfo database_info(*self.databaseID, util::MakeStringView(_persistenceKey),