diff --git a/.github/workflows/firestore-android.yml b/.github/workflows/firestore-android.yml index c8edb61..f2f8d3f 100644 --- a/.github/workflows/firestore-android.yml +++ b/.github/workflows/firestore-android.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@master - name: Download C++ SDK - run: curl -o firestore/android/binary/firebase-cpp-sdk.zip https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_6.12.0.zip --create-dirs + run: curl -o firestore/android/binary/firebase-cpp-sdk.zip https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_6.15.1.zip --create-dirs - name: Extract SDK run: unzip firestore/android/binary/firebase-cpp-sdk.zip -d firestore/android/binary - name: set up JDK 1.8 diff --git a/.github/workflows/firestore-ios.yml b/.github/workflows/firestore-ios.yml index 4002750..9d03ec2 100644 --- a/.github/workflows/firestore-ios.yml +++ b/.github/workflows/firestore-ios.yml @@ -15,12 +15,12 @@ jobs: runs-on: macOS-latest strategy: matrix: - destination: ['platform=iOS Simulator,OS=13.3,name=iPhone 11'] + destination: ['platform=iOS Simulator,OS=13.5,name=iPhone 11'] steps: - name: Checkout uses: actions/checkout@master - name: Download C++ SDK - run: curl -o firestore/ios/binary/firebase-cpp-sdk.zip https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_6.12.0.zip --create-dirs + run: curl -o firestore/ios/binary/firebase-cpp-sdk.zip https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_6.15.1.zip --create-dirs - name: Extract SDK run: unzip firestore/ios/binary/firebase-cpp-sdk.zip -d firestore/ios/binary - name: Build diff --git a/firestore/android/FirestoreSnippetsCpp/app/src/main/cpp/snippets.cpp b/firestore/android/FirestoreSnippetsCpp/app/src/main/cpp/snippets.cpp index 9c47b88..730f250 100644 --- a/firestore/android/FirestoreSnippetsCpp/app/src/main/cpp/snippets.cpp +++ b/firestore/android/FirestoreSnippetsCpp/app/src/main/cpp/snippets.cpp @@ -78,12 +78,12 @@ void QuickstartAddData(firebase::firestore::Firestore* db) { // [START add_ada_lovelace] // Add a new document with a generated ID Future user_ref = - db->Collection("users").Add({{"first", FieldValue::FromString("Ada")}, - {"last", FieldValue::FromString("Lovelace")}, - {"born", FieldValue::FromInteger(1815)}}); + db->Collection("users").Add({{"first", FieldValue::String("Ada")}, + {"last", FieldValue::String("Lovelace")}, + {"born", FieldValue::Integer(1815)}}); user_ref.OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { std::cout << "DocumentSnapshot added with ID: " << future.result()->id() << '\n'; } else { @@ -99,12 +99,12 @@ void QuickstartAddData(firebase::firestore::Firestore* db) { // [START add_alan_turing] db->Collection("users") - .Add({{"first", FieldValue::FromString("Alan")}, - {"middle", FieldValue::FromString("Mathison")}, - {"last", FieldValue::FromString("Turing")}, - {"born", FieldValue::FromInteger(1912)}}) + .Add({{"first", FieldValue::String("Alan")}, + {"middle", FieldValue::String("Mathison")}, + {"last", FieldValue::String("Turing")}, + {"born", FieldValue::Integer(1912)}}) .OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { std::cout << "DocumentSnapshot added with ID: " << future.result()->id() << '\n'; } else { @@ -130,7 +130,7 @@ void QuickstartReadData(firebase::firestore::Firestore* db) { // [START get_collection] Future users = db->Collection("users").Get(); users.OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { for (const DocumentSnapshot& document : future.result()->documents()) { std::cout << document << '\n'; } @@ -154,11 +154,11 @@ void AddDataSetDocument(firebase::firestore::Firestore* db) { // Add a new document in collection 'cities' db->Collection("cities") .Document("LA") - .Set({{"name", FieldValue::FromString("Los Angeles")}, - {"state", FieldValue::FromString("CA")}, - {"country", FieldValue::FromString("USA")}}) + .Set({{"name", FieldValue::String("Los Angeles")}, + {"state", FieldValue::String("CA")}, + {"country", FieldValue::String("USA")}}) .OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { std::cout << "DocumentSnapshot successfully written!\n"; } else { std::cout << "Error writing document: " << future.error_message() @@ -173,7 +173,7 @@ void AddDataSetDocument(firebase::firestore::Firestore* db) { // document, as follows: // [START create_if_missing] db->Collection("cities").Document("BJ").Set( - {{"capital", FieldValue::FromBoolean(true)}}, SetOptions::Merge()); + {{"capital", FieldValue::Boolean(true)}}, SetOptions::Merge()); // [END create_if_missing] } @@ -191,24 +191,24 @@ void AddDataDataTypes(firebase::firestore::Firestore* db) { // what type of number you use in your code. // [START data_types] MapFieldValue doc_data{ - {"stringExample", FieldValue::FromString("Hello world!")}, - {"booleanExample", FieldValue::FromBoolean(true)}, - {"numberExample", FieldValue::FromDouble(3.14159265)}, - {"dateExample", FieldValue::FromTimestamp(Timestamp::Now())}, - {"arrayExample", FieldValue::FromArray({FieldValue::FromInteger(1), - FieldValue::FromInteger(2), - FieldValue::FromInteger(3)})}, + {"stringExample", FieldValue::String("Hello world!")}, + {"booleanExample", FieldValue::Boolean(true)}, + {"numberExample", FieldValue::Double(3.14159265)}, + {"dateExample", FieldValue::Timestamp(Timestamp::Now())}, + {"arrayExample", FieldValue::Array({FieldValue::Integer(1), + FieldValue::Integer(2), + FieldValue::Integer(3)})}, {"nullExample", FieldValue::Null()}, {"objectExample", - FieldValue::FromMap( - {{"a", FieldValue::FromInteger(5)}, - {"b", FieldValue::FromMap( - {{"nested", FieldValue::FromString("foo")}})}})}, + FieldValue::Map( + {{"a", FieldValue::Integer(5)}, + {"b", FieldValue::Map( + {{"nested", FieldValue::String("foo")}})}})}, }; db->Collection("data").Document("one").Set(doc_data).OnCompletion( [](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { std::cout << "DocumentSnapshot successfully written!\n"; } else { std::cout << "Error writing document: " << future.error_message() @@ -257,7 +257,7 @@ void AddDataUpdateDocument(firebase::firestore::Firestore* db) { // [START update_document] DocumentReference washington_ref = db->Collection("cities").Document("DC"); // Set the "capital" field of the city "DC". - washington_ref.Update({{"capital", FieldValue::FromBoolean(true)}}); + washington_ref.Update({{"capital", FieldValue::Boolean(true)}}); // [END update_document] // You can set a field in your document to a server timestamp which tracks @@ -288,8 +288,8 @@ void AddDataUpdateNestedObjects(firebase::firestore::Firestore* db) { // // To update age and favorite color: db->Collection("users").Document("frank").Update({ - {"age", FieldValue::FromInteger(13)}, - {"favorites.color", FieldValue::FromString("red")}, + {"age", FieldValue::Integer(13)}, + {"favorites.color", FieldValue::String("red")}, }); // [END update_document_nested] // Dot notation allows you to update a single nested field without overwriting @@ -321,7 +321,7 @@ void AddDataBatchedWrites(firebase::firestore::Firestore* db) { // Update the population of 'SF' DocumentReference sf_ref = db->Collection("cities").Document("SF"); - batch.Update(sf_ref, {{"population", FieldValue::FromInteger(1000000)}}); + batch.Update(sf_ref, {{"population", FieldValue::Integer(1000000)}}); // Delete the city 'LA' DocumentReference la_ref = db->Collection("cities").Document("LA"); @@ -329,7 +329,7 @@ void AddDataBatchedWrites(firebase::firestore::Firestore* db) { // Commit the batch batch.Commit().OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { std::cout << "Write batch success!\n"; } else { std::cout << "Write batch failure: " << future.error_message() << '\n'; @@ -350,24 +350,24 @@ void AddDataTransactions(firebase::firestore::Firestore* db) { // The following example shows how to create and run a transaction: // [START simple_transaction] DocumentReference sf_doc_ref = db->Collection("cities").Document("SF"); - db->RunTransaction([sf_doc_ref](Transaction* transaction, - std::string* out_error_message) -> Error { - Error error = Error::Ok; + db->RunTransaction([sf_doc_ref](Transaction& transaction, + std::string& out_error_message) -> Error { + Error error = Error::kErrorOk; DocumentSnapshot snapshot = - transaction->Get(sf_doc_ref, &error, out_error_message); + transaction.Get(sf_doc_ref, &error, &out_error_message); // Note: this could be done without a transaction by updating the // population using FieldValue::Increment(). std::int64_t new_population = snapshot.Get("population").integer_value() + 1; - transaction->Update( + transaction.Update( sf_doc_ref, - {{"population", FieldValue::FromInteger(new_population)}}); + {{"population", FieldValue::Integer(new_population)}}); - return Error::Ok; + return Error::kErrorOk; }).OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { std::cout << "Transaction success!\n"; } else { std::cout << "Transaction failure: " << future.error_message() << '\n'; @@ -385,7 +385,7 @@ void AddDataDeleteDocuments(firebase::firestore::Firestore* db) { // [START delete_document] db->Collection("cities").Document("DC").Delete().OnCompletion( [](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { std::cout << "DocumentSnapshot successfully deleted!\n"; } else { std::cout << "Error deleting document: " << future.error_message() @@ -429,53 +429,53 @@ void ReadDataExampleData(firebase::firestore::Firestore* db) { CollectionReference cities = db->Collection("cities"); cities.Document("SF").Set({ - {"name", FieldValue::FromString("San Francisco")}, - {"state", FieldValue::FromString("CA")}, - {"country", FieldValue::FromString("USA")}, - {"capital", FieldValue::FromBoolean(false)}, - {"population", FieldValue::FromInteger(860000)}, - {"regions", FieldValue::FromArray({FieldValue::FromString("west_coast"), - FieldValue::FromString("norcal")})}, + {"name", FieldValue::String("San Francisco")}, + {"state", FieldValue::String("CA")}, + {"country", FieldValue::String("USA")}, + {"capital", FieldValue::Boolean(false)}, + {"population", FieldValue::Integer(860000)}, + {"regions", FieldValue::Array({FieldValue::String("west_coast"), + FieldValue::String("norcal")})}, }); cities.Document("LA").Set({ - {"name", FieldValue::FromString("Los Angeles")}, - {"state", FieldValue::FromString("CA")}, - {"country", FieldValue::FromString("USA")}, - {"capital", FieldValue::FromBoolean(false)}, - {"population", FieldValue::FromInteger(3900000)}, - {"regions", FieldValue::FromArray({FieldValue::FromString("west_coast"), - FieldValue::FromString("socal")})}, + {"name", FieldValue::String("Los Angeles")}, + {"state", FieldValue::String("CA")}, + {"country", FieldValue::String("USA")}, + {"capital", FieldValue::Boolean(false)}, + {"population", FieldValue::Integer(3900000)}, + {"regions", FieldValue::Array({FieldValue::String("west_coast"), + FieldValue::String("socal")})}, }); cities.Document("DC").Set({ - {"name", FieldValue::FromString("Washington D.C.")}, + {"name", FieldValue::String("Washington D.C.")}, {"state", FieldValue::Null()}, - {"country", FieldValue::FromString("USA")}, - {"capital", FieldValue::FromBoolean(true)}, - {"population", FieldValue::FromInteger(680000)}, + {"country", FieldValue::String("USA")}, + {"capital", FieldValue::Boolean(true)}, + {"population", FieldValue::Integer(680000)}, {"regions", - FieldValue::FromArray({FieldValue::FromString("east_coast")})}, + FieldValue::Array({FieldValue::String("east_coast")})}, }); cities.Document("TOK").Set({ - {"name", FieldValue::FromString("Tokyo")}, + {"name", FieldValue::String("Tokyo")}, {"state", FieldValue::Null()}, - {"country", FieldValue::FromString("Japan")}, - {"capital", FieldValue::FromBoolean(true)}, - {"population", FieldValue::FromInteger(9000000)}, - {"regions", FieldValue::FromArray({FieldValue::FromString("kanto"), - FieldValue::FromString("honshu")})}, + {"country", FieldValue::String("Japan")}, + {"capital", FieldValue::Boolean(true)}, + {"population", FieldValue::Integer(9000000)}, + {"regions", FieldValue::Array({FieldValue::String("kanto"), + FieldValue::String("honshu")})}, }); cities.Document("BJ").Set({ - {"name", FieldValue::FromString("Beijing")}, + {"name", FieldValue::String("Beijing")}, {"state", FieldValue::Null()}, - {"country", FieldValue::FromString("China")}, - {"capital", FieldValue::FromBoolean(true)}, - {"population", FieldValue::FromInteger(21500000)}, - {"regions", FieldValue::FromArray({FieldValue::FromString("jingjinji"), - FieldValue::FromString("hebei")})}, + {"country", FieldValue::String("China")}, + {"capital", FieldValue::Boolean(true)}, + {"population", FieldValue::Integer(21500000)}, + {"regions", FieldValue::Array({FieldValue::String("jingjinji"), + FieldValue::String("hebei")})}, }); // [END example_data] } @@ -493,7 +493,7 @@ void ReadDataGetDocument(firebase::firestore::Firestore* db) { // [START get_document] DocumentReference doc_ref = db->Collection("cities").Document("SF"); doc_ref.Get().OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { const DocumentSnapshot& document = *future.result(); if (document.exists()) { std::cout << "DocumentSnapshot id: " << document.id() << '\n'; @@ -530,7 +530,7 @@ void ReadDataSourceOptions(firebase::firestore::Firestore* db) { DocumentReference doc_ref = db->Collection("cities").Document("SF"); Source source = Source::kCache; doc_ref.Get(source).OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { const DocumentSnapshot& document = *future.result(); if (document.exists()) { std::cout << "Cached document id: " << document.id() << '\n'; @@ -558,10 +558,10 @@ void ReadDataGetMultipleDocumentsFromCollection( // retrieve the results: // [START get_multiple] db->Collection("cities") - .WhereEqualTo("capital", FieldValue::FromBoolean(true)) + .WhereEqualTo("capital", FieldValue::Boolean(true)) .Get() .OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { for (const DocumentSnapshot& document : future.result()->documents()) { std::cout << document << '\n'; @@ -586,7 +586,7 @@ void ReadDataGetAllDocumentsInCollection(firebase::firestore::Firestore* db) { // [START get_multiple_all] db->Collection("cities").Get().OnCompletion( [](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { for (const DocumentSnapshot& document : future.result()->documents()) { std::cout << document << '\n'; @@ -613,7 +613,7 @@ void ReadDataListen(firebase::firestore::Firestore* db) { DocumentReference doc_ref = db->Collection("cities").Document("SF"); doc_ref.AddSnapshotListener( [](const DocumentSnapshot& snapshot, Error error) { - if (error == Error::Ok) { + if (error == Error::kErrorOk) { if (snapshot.exists()) { std::cout << "Current data: " << snapshot << '\n'; } else { @@ -647,7 +647,7 @@ void ReadDataEventsForLocalChanges(firebase::firestore::Firestore* db) { DocumentReference doc_ref = db->Collection("cities").Document("SF"); doc_ref.AddSnapshotListener([](const DocumentSnapshot& snapshot, Error error) { - if (error == Error::Ok) { + if (error == Error::kErrorOk) { const char* source = snapshot.metadata().has_pending_writes() ? "Local" : "Server"; if (snapshot.exists()) { @@ -707,9 +707,9 @@ void ReadDataListenToMultipleDocumentsInCollection( // example, to listen to the documents with state CA: // [START listen_multiple] db->Collection("cities") - .WhereEqualTo("state", FieldValue::FromString("CA")) + .WhereEqualTo("state", FieldValue::String("CA")) .AddSnapshotListener([](const QuerySnapshot& snapshot, Error error) { - if (error == Error::Ok) { + if (error == Error::kErrorOk) { std::vector cities; std::cout << "Current cities in CA: " << error << '\n'; for (const DocumentSnapshot& doc : snapshot.documents()) { @@ -739,9 +739,9 @@ void ReadDataViewChangesBetweenSnapshots(firebase::firestore::Firestore* db) { // removed, and modified. // [START listen_diffs] db->Collection("cities") - .WhereEqualTo("state", FieldValue::FromString("CA")) + .WhereEqualTo("state", FieldValue::String("CA")) .AddSnapshotListener([](const QuerySnapshot& snapshot, Error error) { - if (error == Error::Ok) { + if (error == Error::kErrorOk) { for (const DocumentChange& dc : snapshot.DocumentChanges()) { switch (dc.type()) { case DocumentChange::Type::kAdded: @@ -804,13 +804,13 @@ void ReadDataSimpleQueries(firebase::firestore::Firestore* db) { CollectionReference cities_ref = db->Collection("cities"); // Create a query against the collection. Query query_ca = - cities_ref.WhereEqualTo("state", FieldValue::FromString("CA")); + cities_ref.WhereEqualTo("state", FieldValue::String("CA")); // [END simple_queries] // The following query returns all the capital cities: // [START query_capitals] Query capital_cities = db->Collection("cities").WhereEqualTo( - "capital", FieldValue::FromBoolean(true)); + "capital", FieldValue::Boolean(true)); // [END query_capitals] } @@ -826,10 +826,10 @@ void ReadDataExecuteQuery(firebase::firestore::Firestore* db) { // results: // This snippet is identical to get_multiple above. db->Collection("cities") - .WhereEqualTo("capital", FieldValue::FromBoolean(true)) + .WhereEqualTo("capital", FieldValue::Boolean(true)) .Get() .OnCompletion([](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { for (const DocumentSnapshot& document : future.result()->documents()) { std::cout << document << '\n'; @@ -850,10 +850,10 @@ void ReadDataQueryOperators(firebase::firestore::Firestore* db) { // Some example filters: // [START example_filters] - cities_ref.WhereEqualTo("state", FieldValue::FromString("CA")); - cities_ref.WhereLessThan("population", FieldValue::FromInteger(100000)); + cities_ref.WhereEqualTo("state", FieldValue::String("CA")); + cities_ref.WhereLessThan("population", FieldValue::Integer(100000)); cities_ref.WhereGreaterThanOrEqualTo("name", - FieldValue::FromString("San Francisco")); + FieldValue::String("San Francisco")); // [END example_filters] } @@ -869,19 +869,19 @@ void ReadDataCompoundQueries(firebase::firestore::Firestore* db) { // (<, <=, >, >=) or array-contains clause, make sure to create a composite // index. // [START chain_filters] - cities_ref.WhereEqualTo("state", FieldValue::FromString("CO")) - .WhereEqualTo("name", FieldValue::FromString("Denver")); - cities_ref.WhereEqualTo("state", FieldValue::FromString("CA")) - .WhereLessThan("population", FieldValue::FromInteger(1000000)); + cities_ref.WhereEqualTo("state", FieldValue::String("CO")) + .WhereEqualTo("name", FieldValue::String("Denver")); + cities_ref.WhereEqualTo("state", FieldValue::String("CA")) + .WhereLessThan("population", FieldValue::Integer(1000000)); // [END chain_filters] // You can only perform range comparisons (<, <=, >, >=) on a single field, // and you can include at most one array-contains clause in a compound query: // [START valid_range_filters] - cities_ref.WhereGreaterThanOrEqualTo("state", FieldValue::FromString("CA")) - .WhereLessThanOrEqualTo("state", FieldValue::FromString("IN")); - cities_ref.WhereEqualTo("state", FieldValue::FromString("CA")) - .WhereGreaterThan("population", FieldValue::FromInteger(1000000)); + cities_ref.WhereGreaterThanOrEqualTo("state", FieldValue::String("CA")) + .WhereLessThanOrEqualTo("state", FieldValue::String("IN")); + cities_ref.WhereEqualTo("state", FieldValue::String("CA")) + .WhereGreaterThan("population", FieldValue::Integer(1000000)); // [END valid_range_filters] } @@ -895,8 +895,8 @@ void ReadDataInvalidCompoundQuery(firebase::firestore::Firestore* db) { // [START invalid_range_filters] // BAD EXAMPLE -- will crash the program: - cities_ref.WhereGreaterThanOrEqualTo("state", FieldValue::FromString("CA")) - .WhereGreaterThan("population", FieldValue::FromInteger(100000)); + cities_ref.WhereGreaterThanOrEqualTo("state", FieldValue::String("CA")) + .WhereGreaterThan("population", FieldValue::Integer(100000)); // [END invalid_range_filters] } @@ -938,7 +938,7 @@ void ReadDataOrderAndLimitData(firebase::firestore::Firestore* db) { // population in ascending order, and return only the first few results that // exceed the threshold: // [START filter_and_order] - cities_ref.WhereGreaterThan("population", FieldValue::FromInteger(100000)) + cities_ref.WhereGreaterThan("population", FieldValue::Integer(100000)) .OrderBy("population") .Limit(2); // [END filter_and_order] @@ -957,7 +957,7 @@ void ReadDataInvalidOrderAndLimit(firebase::firestore::Firestore* db) { // first ordering must be on the same field. // [START invalid_filter_and_order] // BAD EXAMPLE -- will crash the program: - cities_ref.WhereGreaterThan("population", FieldValue::FromInteger(100000)) + cities_ref.WhereGreaterThan("population", FieldValue::Integer(100000)) .OrderBy("country"); // [END invalid_filter_and_order] } @@ -970,15 +970,15 @@ void ReadDataAddSimpleCursorToQuery(firebase::firestore::Firestore* db) { // a query. The StartAt() method includes the start point, while the // StartAfter() method excludes it. // - // For example, if you use StartAt(FieldValue::FromString("A")) in a query, it + // For example, if you use StartAt(FieldValue::String("A")) in a query, it // returns the entire alphabet. If you use - // StartAftert(FieldValue::FromString("A")) instead, it returns B-Z. + // StartAftert(FieldValue::String("A")) instead, it returns B-Z. // [START cursor_greater_than] // Get all cities with a population >= 1,000,000, ordered by population, db->Collection("cities") .OrderBy("population") - .StartAt({FieldValue::FromInteger(1000000)}); + .StartAt({FieldValue::Integer(1000000)}); // [END cursor_greater_than] // Similarly, use the EndAt() or EndBefore() methods to define an end point @@ -987,7 +987,7 @@ void ReadDataAddSimpleCursorToQuery(firebase::firestore::Firestore* db) { // Get all cities with a population <= 1,000,000, ordered by population, db->Collection("cities") .OrderBy("population") - .EndAt({FieldValue::FromInteger(1000000)}); + .EndAt({FieldValue::Integer(1000000)}); // [END cursor_less_than] } @@ -1010,7 +1010,7 @@ void ReadDataDocumentSnapshotInCursor(firebase::firestore::Firestore* db) { // [START snapshot_cursor] db->Collection("cities").Document("SF").Get().OnCompletion( [db](const Future& future) { - if (future.error() == Error::Ok) { + if (future.error() == Error::kErrorOk) { const DocumentSnapshot& document_snapshot = *future.result(); Query bigger_than_sf = db->Collection("cities") .OrderBy("population") @@ -1038,7 +1038,7 @@ void ReadDataPaginateQuery(firebase::firestore::Firestore* db) { Query first = db->Collection("cities").OrderBy("population").Limit(25); first.Get().OnCompletion([db](const Future& future) { - if (future.error() != Error::Ok) { + if (future.error() != Error::kErrorOk) { // Handle error... return; } diff --git a/firestore/ios/Podfile b/firestore/ios/Podfile index 9728fae..594a0d5 100644 --- a/firestore/ios/Podfile +++ b/firestore/ios/Podfile @@ -3,7 +3,7 @@ platform :ios, '9.0' target 'firestore-snippets-cpp' do use_frameworks! - pod 'Firebase/Auth' - pod 'Firebase/Firestore', '6.17.0' + pod 'Firebase/Auth', '6.26.0' + pod 'Firebase/Firestore', '6.26.0' end diff --git a/firestore/ios/Podfile.lock b/firestore/ios/Podfile.lock index 429efe9..f128f71 100644 --- a/firestore/ios/Podfile.lock +++ b/firestore/ios/Podfile.lock @@ -1,140 +1,194 @@ PODS: - - abseil/algorithm (0.20190808): - - abseil/algorithm/algorithm (= 0.20190808) - - abseil/algorithm/container (= 0.20190808) - - abseil/algorithm/algorithm (0.20190808) - - abseil/algorithm/container (0.20190808): + - abseil/algorithm (0.20200225.0): + - abseil/algorithm/algorithm (= 0.20200225.0) + - abseil/algorithm/container (= 0.20200225.0) + - abseil/algorithm/algorithm (0.20200225.0): + - abseil/base/config + - abseil/algorithm/container (0.20200225.0): - abseil/algorithm/algorithm - abseil/base/core_headers - abseil/meta/type_traits - - abseil/base (0.20190808): - - abseil/base/atomic_hook (= 0.20190808) - - abseil/base/base (= 0.20190808) - - abseil/base/base_internal (= 0.20190808) - - abseil/base/bits (= 0.20190808) - - abseil/base/config (= 0.20190808) - - abseil/base/core_headers (= 0.20190808) - - abseil/base/dynamic_annotations (= 0.20190808) - - abseil/base/endian (= 0.20190808) - - abseil/base/log_severity (= 0.20190808) - - abseil/base/malloc_internal (= 0.20190808) - - abseil/base/pretty_function (= 0.20190808) - - abseil/base/spinlock_wait (= 0.20190808) - - abseil/base/throw_delegate (= 0.20190808) - - abseil/base/atomic_hook (0.20190808) - - abseil/base/base (0.20190808): + - abseil/base (0.20200225.0): + - abseil/base/atomic_hook (= 0.20200225.0) + - abseil/base/base (= 0.20200225.0) + - abseil/base/base_internal (= 0.20200225.0) + - abseil/base/bits (= 0.20200225.0) + - abseil/base/config (= 0.20200225.0) + - abseil/base/core_headers (= 0.20200225.0) + - abseil/base/dynamic_annotations (= 0.20200225.0) + - abseil/base/endian (= 0.20200225.0) + - abseil/base/errno_saver (= 0.20200225.0) + - abseil/base/exponential_biased (= 0.20200225.0) + - abseil/base/log_severity (= 0.20200225.0) + - abseil/base/malloc_internal (= 0.20200225.0) + - abseil/base/periodic_sampler (= 0.20200225.0) + - abseil/base/pretty_function (= 0.20200225.0) + - abseil/base/raw_logging_internal (= 0.20200225.0) + - abseil/base/spinlock_wait (= 0.20200225.0) + - abseil/base/throw_delegate (= 0.20200225.0) + - abseil/base/atomic_hook (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/base (0.20200225.0): - abseil/base/atomic_hook - abseil/base/base_internal - abseil/base/config - abseil/base/core_headers - abseil/base/dynamic_annotations - abseil/base/log_severity + - abseil/base/raw_logging_internal - abseil/base/spinlock_wait - abseil/meta/type_traits - - abseil/base/base_internal (0.20190808): + - abseil/base/base_internal (0.20200225.0): + - abseil/base/config - abseil/meta/type_traits - - abseil/base/bits (0.20190808): + - abseil/base/bits (0.20200225.0): + - abseil/base/config - abseil/base/core_headers - - abseil/base/config (0.20190808) - - abseil/base/core_headers (0.20190808): + - abseil/base/config (0.20200225.0) + - abseil/base/core_headers (0.20200225.0): - abseil/base/config - - abseil/base/dynamic_annotations (0.20190808) - - abseil/base/endian (0.20190808): + - abseil/base/dynamic_annotations (0.20200225.0) + - abseil/base/endian (0.20200225.0): - abseil/base/config - abseil/base/core_headers - - abseil/base/log_severity (0.20190808): + - abseil/base/errno_saver (0.20200225.0): + - abseil/base/config + - abseil/base/exponential_biased (0.20200225.0): + - abseil/base/config - abseil/base/core_headers - - abseil/base/malloc_internal (0.20190808): + - abseil/base/log_severity (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal (0.20200225.0): - abseil/base/base + - abseil/base/base_internal - abseil/base/config - abseil/base/core_headers - abseil/base/dynamic_annotations - - abseil/base/spinlock_wait - - abseil/base/pretty_function (0.20190808) - - abseil/base/spinlock_wait (0.20190808): + - abseil/base/raw_logging_internal + - abseil/base/periodic_sampler (0.20200225.0): - abseil/base/core_headers - - abseil/base/throw_delegate (0.20190808): - - abseil/base/base + - abseil/base/exponential_biased + - abseil/base/pretty_function (0.20200225.0) + - abseil/base/raw_logging_internal (0.20200225.0): + - abseil/base/atomic_hook - abseil/base/config - - abseil/memory (0.20190808): - - abseil/memory/memory (= 0.20190808) - - abseil/memory/memory (0.20190808): + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/spinlock_wait (0.20200225.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/base/throw_delegate (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/container/compressed_tuple (0.20200225.0): + - abseil/utility/utility + - abseil/container/inlined_vector (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/container/inlined_vector_internal + - abseil/memory/memory + - abseil/container/inlined_vector_internal (0.20200225.0): + - abseil/base/core_headers + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/span + - abseil/memory (0.20200225.0): + - abseil/memory/memory (= 0.20200225.0) + - abseil/memory/memory (0.20200225.0): - abseil/base/core_headers - abseil/meta/type_traits - - abseil/meta (0.20190808): - - abseil/meta/type_traits (= 0.20190808) - - abseil/meta/type_traits (0.20190808): + - abseil/meta (0.20200225.0): + - abseil/meta/type_traits (= 0.20200225.0) + - abseil/meta/type_traits (0.20200225.0): - abseil/base/config - - abseil/numeric/int128 (0.20190808): + - abseil/numeric/int128 (0.20200225.0): - abseil/base/config - abseil/base/core_headers - - abseil/strings/internal (0.20190808): + - abseil/strings/internal (0.20200225.0): + - abseil/base/config - abseil/base/core_headers - abseil/base/endian + - abseil/base/raw_logging_internal - abseil/meta/type_traits - - abseil/strings/strings (0.20190808): + - abseil/strings/str_format (0.20200225.0): + - abseil/strings/str_format_internal + - abseil/strings/str_format_internal (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/types/span + - abseil/strings/strings (0.20200225.0): - abseil/base/base - abseil/base/bits - abseil/base/config - abseil/base/core_headers - abseil/base/endian + - abseil/base/raw_logging_internal - abseil/base/throw_delegate - abseil/memory/memory - abseil/meta/type_traits - abseil/numeric/int128 - abseil/strings/internal - - abseil/time (0.20190808): - - abseil/time/internal (= 0.20190808) - - abseil/time/time (= 0.20190808) - - abseil/time/internal (0.20190808): - - abseil/time/internal/cctz (= 0.20190808) - - abseil/time/internal/cctz (0.20190808): - - abseil/time/internal/cctz/civil_time (= 0.20190808) - - abseil/time/internal/cctz/includes (= 0.20190808) - - abseil/time/internal/cctz/time_zone (= 0.20190808) - - abseil/time/internal/cctz/civil_time (0.20190808) - - abseil/time/internal/cctz/includes (0.20190808) - - abseil/time/internal/cctz/time_zone (0.20190808): + - abseil/time (0.20200225.0): + - abseil/time/internal (= 0.20200225.0) + - abseil/time/time (= 0.20200225.0) + - abseil/time/internal (0.20200225.0): + - abseil/time/internal/cctz (= 0.20200225.0) + - abseil/time/internal/cctz (0.20200225.0): + - abseil/time/internal/cctz/civil_time (= 0.20200225.0) + - abseil/time/internal/cctz/time_zone (= 0.20200225.0) + - abseil/time/internal/cctz/civil_time (0.20200225.0): + - abseil/base/config + - abseil/time/internal/cctz/time_zone (0.20200225.0): + - abseil/base/config - abseil/time/internal/cctz/civil_time - - abseil/time/time (0.20190808): + - abseil/time/time (0.20200225.0): - abseil/base/base - abseil/base/core_headers + - abseil/base/raw_logging_internal - abseil/numeric/int128 - abseil/strings/strings - abseil/time/internal/cctz/civil_time - abseil/time/internal/cctz/time_zone - - abseil/types (0.20190808): - - abseil/types/any (= 0.20190808) - - abseil/types/bad_any_cast (= 0.20190808) - - abseil/types/bad_any_cast_impl (= 0.20190808) - - abseil/types/bad_optional_access (= 0.20190808) - - abseil/types/bad_variant_access (= 0.20190808) - - abseil/types/compare (= 0.20190808) - - abseil/types/optional (= 0.20190808) - - abseil/types/span (= 0.20190808) - - abseil/types/variant (= 0.20190808) - - abseil/types/any (0.20190808): + - abseil/types (0.20200225.0): + - abseil/types/any (= 0.20200225.0) + - abseil/types/bad_any_cast (= 0.20200225.0) + - abseil/types/bad_any_cast_impl (= 0.20200225.0) + - abseil/types/bad_optional_access (= 0.20200225.0) + - abseil/types/bad_variant_access (= 0.20200225.0) + - abseil/types/compare (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - abseil/types/span (= 0.20200225.0) + - abseil/types/variant (= 0.20200225.0) + - abseil/types/any (0.20200225.0): - abseil/base/config - abseil/base/core_headers - abseil/meta/type_traits - abseil/types/bad_any_cast - abseil/utility/utility - - abseil/types/bad_any_cast (0.20190808): + - abseil/types/bad_any_cast (0.20200225.0): - abseil/base/config - abseil/types/bad_any_cast_impl - - abseil/types/bad_any_cast_impl (0.20190808): - - abseil/base/base + - abseil/types/bad_any_cast_impl (0.20200225.0): - abseil/base/config - - abseil/types/bad_optional_access (0.20190808): - - abseil/base/base + - abseil/base/raw_logging_internal + - abseil/types/bad_optional_access (0.20200225.0): - abseil/base/config - - abseil/types/bad_variant_access (0.20190808): - - abseil/base/base + - abseil/base/raw_logging_internal + - abseil/types/bad_variant_access (0.20200225.0): - abseil/base/config - - abseil/types/compare (0.20190808): + - abseil/base/raw_logging_internal + - abseil/types/compare (0.20200225.0): - abseil/base/core_headers - abseil/meta/type_traits - - abseil/types/optional (0.20190808): + - abseil/types/optional (0.20200225.0): - abseil/base/base_internal - abseil/base/config - abseil/base/core_headers @@ -142,113 +196,122 @@ PODS: - abseil/meta/type_traits - abseil/types/bad_optional_access - abseil/utility/utility - - abseil/types/span (0.20190808): + - abseil/types/span (0.20200225.0): - abseil/algorithm/algorithm - abseil/base/core_headers - abseil/base/throw_delegate - abseil/meta/type_traits - - abseil/types/variant (0.20190808): + - abseil/types/variant (0.20200225.0): - abseil/base/base_internal - abseil/base/config - abseil/base/core_headers - abseil/meta/type_traits - abseil/types/bad_variant_access - abseil/utility/utility - - abseil/utility/utility (0.20190808): + - abseil/utility/utility (0.20200225.0): - abseil/base/base_internal - abseil/base/config - abseil/meta/type_traits - - BoringSSL-GRPC (0.0.3): - - BoringSSL-GRPC/Implementation (= 0.0.3) - - BoringSSL-GRPC/Interface (= 0.0.3) - - BoringSSL-GRPC/Implementation (0.0.3): - - BoringSSL-GRPC/Interface (= 0.0.3) - - BoringSSL-GRPC/Interface (0.0.3) - - Firebase/Auth (6.17.0): + - BoringSSL-GRPC (0.0.7): + - BoringSSL-GRPC/Implementation (= 0.0.7) + - BoringSSL-GRPC/Interface (= 0.0.7) + - BoringSSL-GRPC/Implementation (0.0.7): + - BoringSSL-GRPC/Interface (= 0.0.7) + - BoringSSL-GRPC/Interface (0.0.7) + - Firebase/Auth (6.26.0): - Firebase/CoreOnly - - FirebaseAuth (~> 6.4.3) - - Firebase/CoreOnly (6.17.0): - - FirebaseCore (= 6.6.2) - - Firebase/Firestore (6.17.0): + - FirebaseAuth (~> 6.5.3) + - Firebase/CoreOnly (6.26.0): + - FirebaseCore (= 6.7.2) + - Firebase/Firestore (6.26.0): - Firebase/CoreOnly - - FirebaseFirestore (~> 1.10.2) - - FirebaseAuth (6.4.3): + - FirebaseFirestore (~> 1.15.0) + - FirebaseAuth (6.5.3): - FirebaseAuthInterop (~> 1.0) - FirebaseCore (~> 6.6) - GoogleUtilities/AppDelegateSwizzler (~> 6.5) - GoogleUtilities/Environment (~> 6.5) - GTMSessionFetcher/Core (~> 1.1) - FirebaseAuthInterop (1.1.0) - - FirebaseCore (6.6.2): - - FirebaseCoreDiagnostics (~> 1.2) + - FirebaseCore (6.7.2): + - FirebaseCoreDiagnostics (~> 1.3) - FirebaseCoreDiagnosticsInterop (~> 1.2) - GoogleUtilities/Environment (~> 6.5) - GoogleUtilities/Logger (~> 6.5) - - FirebaseCoreDiagnostics (1.2.2): - - FirebaseCoreDiagnosticsInterop (~> 1.2) - - GoogleDataTransportCCTSupport (~> 2.0) + - FirebaseCoreDiagnostics (1.4.0): + - GoogleDataTransportCCTSupport (~> 3.1) - GoogleUtilities/Environment (~> 6.5) - GoogleUtilities/Logger (~> 6.5) - - nanopb (~> 0.3.901) + - nanopb (~> 1.30905.0) - FirebaseCoreDiagnosticsInterop (1.2.0) - - FirebaseFirestore (1.10.2): - - abseil/algorithm (= 0.20190808) - - abseil/base (= 0.20190808) - - abseil/memory (= 0.20190808) - - abseil/meta (= 0.20190808) - - abseil/strings/strings (= 0.20190808) - - abseil/time (= 0.20190808) - - abseil/types (= 0.20190808) + - FirebaseFirestore (1.15.0): + - abseil/algorithm (= 0.20200225.0) + - abseil/base (= 0.20200225.0) + - abseil/memory (= 0.20200225.0) + - abseil/meta (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/time (= 0.20200225.0) + - abseil/types (= 0.20200225.0) - FirebaseAuthInterop (~> 1.0) - FirebaseCore (~> 6.2) - - "gRPC-C++ (= 0.0.9)" + - "gRPC-C++ (~> 1.28.0)" - leveldb-library (~> 1.22) - - nanopb (~> 0.3.901) - - GoogleDataTransport (5.1.0) - - GoogleDataTransportCCTSupport (2.0.1): - - GoogleDataTransport (~> 5.1) - - nanopb (~> 0.3.901) - - GoogleUtilities/AppDelegateSwizzler (6.5.2): + - nanopb (~> 1.30905.0) + - GoogleDataTransport (6.2.1) + - GoogleDataTransportCCTSupport (3.2.0): + - GoogleDataTransport (~> 6.1) + - nanopb (~> 1.30905.0) + - GoogleUtilities/AppDelegateSwizzler (6.6.0): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (6.5.2) - - GoogleUtilities/Logger (6.5.2): + - GoogleUtilities/Environment (6.6.0): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (6.6.0): - GoogleUtilities/Environment - - GoogleUtilities/Network (6.5.2): + - GoogleUtilities/Network (6.6.0): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.5.2)" - - GoogleUtilities/Reachability (6.5.2): + - "GoogleUtilities/NSData+zlib (6.6.0)" + - GoogleUtilities/Reachability (6.6.0): - GoogleUtilities/Logger - - "gRPC-C++ (0.0.9)": - - "gRPC-C++/Implementation (= 0.0.9)" - - "gRPC-C++/Interface (= 0.0.9)" - - "gRPC-C++/Implementation (0.0.9)": - - "gRPC-C++/Interface (= 0.0.9)" - - gRPC-Core (= 1.21.0) - - nanopb (~> 0.3) - - "gRPC-C++/Interface (0.0.9)" - - gRPC-Core (1.21.0): - - gRPC-Core/Implementation (= 1.21.0) - - gRPC-Core/Interface (= 1.21.0) - - gRPC-Core/Implementation (1.21.0): - - BoringSSL-GRPC (= 0.0.3) - - gRPC-Core/Interface (= 1.21.0) - - nanopb (~> 0.3) - - gRPC-Core/Interface (1.21.0) - - GTMSessionFetcher/Core (1.3.1) + - "gRPC-C++ (1.28.2)": + - "gRPC-C++/Implementation (= 1.28.2)" + - "gRPC-C++/Interface (= 1.28.2)" + - "gRPC-C++/Implementation (1.28.2)": + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - "gRPC-C++/Interface (= 1.28.2)" + - gRPC-Core (= 1.28.2) + - "gRPC-C++/Interface (1.28.2)" + - gRPC-Core (1.28.2): + - gRPC-Core/Implementation (= 1.28.2) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Implementation (1.28.2): + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - BoringSSL-GRPC (= 0.0.7) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Interface (1.28.2) + - GTMSessionFetcher/Core (1.4.0) - leveldb-library (1.22) - - nanopb (0.3.9011): - - nanopb/decode (= 0.3.9011) - - nanopb/encode (= 0.3.9011) - - nanopb/decode (0.3.9011) - - nanopb/encode (0.3.9011) + - nanopb (1.30905.0): + - nanopb/decode (= 1.30905.0) + - nanopb/encode (= 1.30905.0) + - nanopb/decode (1.30905.0) + - nanopb/encode (1.30905.0) + - PromisesObjC (1.2.9) DEPENDENCIES: - - Firebase/Auth - - Firebase/Firestore (= 6.17.0) + - Firebase/Auth (= 6.26.0) + - Firebase/Firestore (= 6.26.0) SPEC REPOS: trunk: @@ -269,26 +332,28 @@ SPEC REPOS: - GTMSessionFetcher - leveldb-library - nanopb + - PromisesObjC SPEC CHECKSUMS: - abseil: 18063d773f5366ff8736a050fe035a28f635fd27 - BoringSSL-GRPC: db8764df3204ccea016e1c8dd15d9a9ad63ff318 - Firebase: 2672e5636b42f977177716317e68346ae5e9de25 - FirebaseAuth: 5ce2b03a3d7fe56b7a6e4c5ec7ff1522890b1d6f + abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f + BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 + Firebase: 7cf5f9c67f03cb3b606d1d6535286e1080e57eb6 + FirebaseAuth: 7047aec89c0b17ecd924a550c853f0c27ac6015e FirebaseAuthInterop: a0f37ae05833af156e72028f648d313f7e7592e9 - FirebaseCore: a1dd9dd6355a8356dd30a8f076839e242285a81c - FirebaseCoreDiagnostics: e9b4cd8ba60dee0f2d13347332e4b7898cca5b61 + FirebaseCore: f42e5e5f382cdcf6b617ed737bf6c871a6947b17 + FirebaseCoreDiagnostics: 4505e4d4009b1d93f605088ee7d7764d5f0d1c84 FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850 - FirebaseFirestore: 2ee644acccde18e49b2fb5d434c709b1f1171b13 - GoogleDataTransport: b29a21d813e906014ca16c00897827e40e4a24ab - GoogleDataTransportCCTSupport: 6f15a89b0ca35d6fa523e1f752ef818588885988 - GoogleUtilities: ad0f3b691c67909d03a3327cc205222ab8f42e0e - "gRPC-C++": 9dfe7b44821e7b3e44aacad2af29d2c21f7cde83 - gRPC-Core: c9aef9a261a1247e881b18059b84d597293c9947 - GTMSessionFetcher: cea130bbfe5a7edc8d06d3f0d17288c32ffe9925 + FirebaseFirestore: 8c158bdde010fa397386333a74570eaef033e62d + GoogleDataTransport: 9a8a16f79feffc7f42096743de2a7c4815e84020 + GoogleDataTransportCCTSupport: 489c1265d2c85b68187a83a911913d190012158d + GoogleUtilities: 39530bc0ad980530298e9c4af8549e991fd033b1 + "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2 + gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5 + GTMSessionFetcher: 6f5c8abbab8a9bce4bb3f057e317728ec6182b10 leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7 - nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd + nanopb: c43f40fadfe79e8b8db116583945847910cbabc9 + PromisesObjC: b48e0338dbbac2207e611750777895f7a5811b75 -PODFILE CHECKSUM: a5e3089c95e45dcb6ae5773532beaafa406ded61 +PODFILE CHECKSUM: 065e7c72e9add7020e0b596dbe85a95fd41e23b9 -COCOAPODS: 1.9.1 +COCOAPODS: 1.9.3