From 9b8e34e828521a3a0af6a8f659a86721ea8e39bc Mon Sep 17 00:00:00 2001 From: "firebase-workflow-trigger[bot]" <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 20:20:39 +0000 Subject: [PATCH 01/13] Automatic merge of main into feature_branch/ump-sdk - Jul 31, 2023 (#1407) * iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae98f767c45f0a402fc9492bf6cc2ce55885. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d48d28c52352f5e40640831934ff6921e4e. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android --------- Co-authored-by: Jon Simantov Co-authored-by: Tom Andersen Co-authored-by: Matthew Hyndman --- .github/workflows/build-report.yml | 29 +- app/CMakeLists.txt | 1 - firestore/CMakeLists.txt | 9 - .../integration_test_internal/CMakeLists.txt | 2 - .../project.pbxproj | 24 - .../src/aggregate_count_test.cc | 16 + .../src/aggregate_query_test.cc | 15 - .../src/filter_test.cc | 550 ------------------ firestore/src/android/filter_android.cc | 209 ------- firestore/src/android/filter_android.h | 89 --- firestore/src/android/query_android.cc | 12 +- firestore/src/android/query_android.h | 8 - firestore/src/common/filter.cc | 174 ------ firestore/src/common/query.cc | 11 - firestore/src/common/type_mapping.h | 6 - firestore/src/include/firebase/firestore.h | 1 - .../include/firebase/firestore/field_path.h | 1 - .../src/include/firebase/firestore/filter.h | 411 ------------- .../src/include/firebase/firestore/query.h | 23 +- firestore/src/main/composite_filter_main.cc | 70 --- firestore/src/main/composite_filter_main.h | 66 --- firestore/src/main/converter_main.h | 10 - firestore/src/main/filter_main.cc | 130 ----- firestore/src/main/filter_main.h | 105 ---- firestore/src/main/query_main.cc | 28 +- firestore/src/main/query_main.h | 2 - firestore/src/main/unary_filter_main.cc | 70 --- firestore/src/main/unary_filter_main.h | 70 --- release_build_files/readme.md | 5 - .../integration_test/src/integration_test.cc | 24 +- scripts/gha/report_build_status.py | 21 +- 31 files changed, 99 insertions(+), 2093 deletions(-) delete mode 100644 firestore/integration_test_internal/src/filter_test.cc delete mode 100644 firestore/src/android/filter_android.cc delete mode 100644 firestore/src/android/filter_android.h delete mode 100644 firestore/src/common/filter.cc delete mode 100644 firestore/src/include/firebase/firestore/filter.h delete mode 100644 firestore/src/main/composite_filter_main.cc delete mode 100644 firestore/src/main/composite_filter_main.h delete mode 100644 firestore/src/main/filter_main.cc delete mode 100644 firestore/src/main/filter_main.h delete mode 100644 firestore/src/main/unary_filter_main.cc delete mode 100644 firestore/src/main/unary_filter_main.h diff --git a/.github/workflows/build-report.yml b/.github/workflows/build-report.yml index 9776e62f65..31ed97d141 100644 --- a/.github/workflows/build-report.yml +++ b/.github/workflows/build-report.yml @@ -13,8 +13,16 @@ env: jobs: generate-report: + strategy: + fail-fast: false + matrix: + test_set: [ general, firestore ] runs-on: ubuntu-20.04 + name: generate-report-${{ matrix.test_set }} steps: + - name: Pause 5 minutes to offset Firestore fetches. + if: ${{ matrix.test_set == 'firestore' }} + run: sleep 300 - name: Setup python uses: actions/setup-python@v4 with: @@ -36,14 +44,24 @@ jobs: timeout_minutes: 20 max_attempts: 3 shell: bash - command: python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --write_cache build_status_short.cache + command: | + extra_flags= + if [[ "${{ matrix.test_set }}" == "firestore" ]]; then + extra_flags=--firestore + fi + python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --write_cache build_status_short.cache ${extra_flags} - name: Fetch extended GitHub jobs (with retry) uses: nick-invision/retry@v2 with: timeout_minutes: 80 max_attempts: 3 shell: bash - command: python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --write_cache build_status.cache + command: | + extra_flags= + if [[ "${{ matrix.test_set }}" == "firestore" ]]; then + extra_flags=--firestore + fi + python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --write_cache build_status.cache ${extra_flags} - name: Generate report files run: | python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --output_markdown --read_cache build_status_short.cache > report_short.md @@ -88,4 +106,9 @@ jobs: timeout_minutes: 5 max_attempts: 3 shell: bash - command: python3 scripts/gha/update_issue_comment.py --token ${{ github.token }} --issue_title '[C++] Nightly Integration Testing Report' --start_tag build-dashboard-comment-start --end_tag build-dashboard-comment-end < comment.md + command: | + issue_title='[C++] Nightly Integration Testing Report' + if [[ "${{ matrix.test_set }}" == "firestore" ]]; then + issue_title='[C++] Nightly Integration Testing Report for Firestore' + fi + python3 scripts/gha/update_issue_comment.py --token ${{ github.token }} --issue_title "${issue_title}" --start_tag build-dashboard-comment-start --end_tag build-dashboard-comment-end < comment.md diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 8565b58141..b008b7de78 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -518,7 +518,6 @@ if (IOS) ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/document_snapshot.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/field_path.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/field_value.h - ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/filter.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/listener_registration.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/load_bundle_task_progress.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/map_field_value.h diff --git a/firestore/CMakeLists.txt b/firestore/CMakeLists.txt index e3a31f3eb8..0cea8d1435 100644 --- a/firestore/CMakeLists.txt +++ b/firestore/CMakeLists.txt @@ -31,7 +31,6 @@ set(common_SRCS src/common/document_snapshot.cc src/common/exception_common.cc src/common/exception_common.h - src/common/filter.cc src/common/field_path.cc src/common/field_value.cc src/common/firestore.cc @@ -98,8 +97,6 @@ set(android_SRCS src/android/field_path_portable.h src/android/field_value_android.cc src/android/field_value_android.h - src/android/filter_android.cc - src/android/filter_android.h src/android/firestore_android.cc src/android/firestore_android.h src/android/firestore_exceptions_android.h @@ -204,8 +201,6 @@ set(main_SRCS src/main/aggregate_query_snapshot_main.h src/main/collection_reference_main.cc src/main/collection_reference_main.h - src/main/composite_filter_main.cc - src/main/composite_filter_main.h src/main/converter_main.h src/main/document_change_main.cc src/main/document_change_main.h @@ -213,8 +208,6 @@ set(main_SRCS src/main/document_reference_main.h src/main/document_snapshot_main.cc src/main/document_snapshot_main.h - src/main/filter_main.cc - src/main/filter_main.h src/main/field_value_main.cc src/main/field_value_main.h src/main/firestore_main.cc @@ -234,8 +227,6 @@ set(main_SRCS src/main/transaction_main.h src/main/user_data_converter_main.cc src/main/user_data_converter_main.h - src/main/unary_filter_main.cc - src/main/unary_filter_main.h src/main/util_main.h src/main/write_batch_main.cc src/main/write_batch_main.h) diff --git a/firestore/integration_test_internal/CMakeLists.txt b/firestore/integration_test_internal/CMakeLists.txt index 8e651e75cd..791500961a 100644 --- a/firestore/integration_test_internal/CMakeLists.txt +++ b/firestore/integration_test_internal/CMakeLists.txt @@ -91,7 +91,6 @@ set(FIREBASE_INTEGRATION_TEST_PORTABLE_TEST_SRCS # public API are performed. src/integration_test.cc # Internal tests below. - src/aggregate_count_test.cc src/aggregate_query_snapshot_test.cc src/aggregate_query_test.cc src/bundle_test.cc @@ -100,7 +99,6 @@ set(FIREBASE_INTEGRATION_TEST_PORTABLE_TEST_SRCS src/document_change_test.cc src/document_reference_test.cc src/document_snapshot_test.cc - src/filter_test.cc src/field_value_test.cc src/fields_test.cc src/firestore_test.cc diff --git a/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj b/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj index 415b4bcff8..4fc6d0ca75 100644 --- a/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj +++ b/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj @@ -21,14 +21,6 @@ 12CCF1E928FDBD9F00C24941 /* set_options_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12CCF1DF28FDBD9F00C24941 /* set_options_test.cc */; }; 12D513142684C8C200A83FAA /* bundle_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12D513132684C8C200A83FAA /* bundle_test.cc */; }; 12D5131A2684C8D100A83FAA /* bundle_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12D513182684C8D100A83FAA /* bundle_builder.cc */; }; - 1BAFACA32A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */; }; - 1BAFACA42A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */; }; - 1BAFACA52A449C2B00834979 /* aggregate_count_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */; }; - 1BAFACA62A449C2B00834979 /* aggregate_count_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */; }; - 1BAFACA72A449C2B00834979 /* aggregate_query_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */; }; - 1BAFACA82A449C2B00834979 /* aggregate_query_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */; }; - 1BAFACAA2A449CBD00834979 /* filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA92A449CBD00834979 /* filter_test.cc */; }; - 1BAFACAB2A449CBD00834979 /* filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA92A449CBD00834979 /* filter_test.cc */; }; 520BC0391C869159008CFBC3 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 520BC0381C869159008CFBC3 /* GoogleService-Info.plist */; }; 5270BB448DF5ECE860FDD68B /* firebase_firestore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAFAF9474EC412ADCC65F2CC /* firebase_firestore.framework */; }; 529226D61C85F68000C89379 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 529226D51C85F68000C89379 /* Foundation.framework */; }; @@ -131,10 +123,6 @@ 12D513182684C8D100A83FAA /* bundle_builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bundle_builder.cc; path = src/util/bundle_builder.cc; sourceTree = ""; }; 12D513192684C8D100A83FAA /* bundle_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bundle_builder.h; path = src/util/bundle_builder.h; sourceTree = ""; }; 1B3D64B35A22073C76B376D5 /* libPods-integration_test_tvos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-integration_test_tvos.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_query_snapshot_test.cc; path = src/aggregate_query_snapshot_test.cc; sourceTree = ""; }; - 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_count_test.cc; path = src/aggregate_count_test.cc; sourceTree = ""; }; - 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_query_test.cc; path = src/aggregate_query_test.cc; sourceTree = ""; }; - 1BAFACA92A449CBD00834979 /* filter_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = filter_test.cc; path = src/filter_test.cc; sourceTree = ""; }; 3DE393E827F88B06CD3C39CD /* Pods-integration_test_tvos.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-integration_test_tvos.release.xcconfig"; path = "Target Support Files/Pods-integration_test_tvos/Pods-integration_test_tvos.release.xcconfig"; sourceTree = ""; }; 4AAFA3E3DA9641C2E3C46C9D /* Pods_integration_test.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_integration_test.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 520BC0381C869159008CFBC3 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; @@ -293,10 +281,6 @@ 5292271D1C85FB5500C89379 /* src */ = { isa = PBXGroup; children = ( - 1BAFACA92A449CBD00834979 /* filter_test.cc */, - 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */, - 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */, - 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */, 12CCF1DF28FDBD9F00C24941 /* set_options_test.cc */, 12CCF1DB28FDBD9E00C24941 /* settings_test.cc */, 12CCF1DC28FDBD9F00C24941 /* source_test.cc */, @@ -592,14 +576,12 @@ D62CCBC022F367140099BE9F /* gmock-all.cc in Sources */, D61CFBC126091C3B0035CB2A /* integration_test.cc in Sources */, D6AAAD532606C22D0025C53B /* includes_test.cc in Sources */, - 1BAFACA52A449C2B00834979 /* aggregate_count_test.cc in Sources */, D6AAAD502606C22D0025C53B /* numeric_transforms_test.cc in Sources */, D6ED33BE2606CD890058CBF9 /* integration_test_util.cc in Sources */, D6C179EA22CB322900C2651A /* ios_firebase_test_framework.mm in Sources */, 12CCF1E228FDBD9F00C24941 /* source_test.cc in Sources */, D6AAAD4C2606C22D0025C53B /* server_timestamp_test.cc in Sources */, D6AAAD4E2606C22D0025C53B /* firestore_test.cc in Sources */, - 1BAFACAA2A449CBD00834979 /* filter_test.cc in Sources */, D6AAAD452606C22D0025C53B /* document_change_test.cc in Sources */, D6AAAD472606C22D0025C53B /* document_snapshot_test.cc in Sources */, D6C179E922CB322900C2651A /* ios_app_framework.mm in Sources */, @@ -609,9 +591,7 @@ EDEEC7632800CD0000EFBAAF /* leveldb_snappy_test.cc in Sources */, 12CCF1E828FDBD9F00C24941 /* set_options_test.cc in Sources */, D6AAAD562606C22D0025C53B /* query_network_test.cc in Sources */, - 1BAFACA72A449C2B00834979 /* aggregate_query_test.cc in Sources */, D6AAAD552606C22D0025C53B /* listener_registration_test.cc in Sources */, - 1BAFACA32A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */, 12D5131A2684C8D100A83FAA /* bundle_builder.cc in Sources */, D6AAAD4A2606C22D0025C53B /* fields_test.cc in Sources */, D6AAAD462606C22D0025C53B /* query_test.cc in Sources */, @@ -630,8 +610,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1BAFACAB2A449CBD00834979 /* filter_test.cc in Sources */, - 1BAFACA62A449C2B00834979 /* aggregate_count_test.cc in Sources */, BC1D6850267B00EB005DC2DA /* app_framework.cc in Sources */, BC1D6853267B00EB005DC2DA /* transaction_extra_test.cc in Sources */, BC1D683E267B00EB005DC2DA /* integration_test_util.cc in Sources */, @@ -645,7 +623,6 @@ BC1D6848267B00EB005DC2DA /* sanity_test.cc in Sources */, 12CCF1E728FDBD9F00C24941 /* write_batch_test.cc in Sources */, 12CCF1E128FDBD9F00C24941 /* settings_test.cc in Sources */, - 1BAFACA82A449C2B00834979 /* aggregate_query_test.cc in Sources */, BC1D6856267B00EE005DC2DA /* ios_app_framework.mm in Sources */, BC1D6843267B00EB005DC2DA /* numeric_transforms_test.cc in Sources */, BC1D6844267B00EB005DC2DA /* array_transform_test.cc in Sources */, @@ -655,7 +632,6 @@ BC1D684E267B00EB005DC2DA /* includes_test.cc in Sources */, BC1D684C267B00EB005DC2DA /* document_change_test.cc in Sources */, BC1D6851267B00EB005DC2DA /* firestore_integration_test.cc in Sources */, - 1BAFACA42A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */, BC1D6838267B00EB005DC2DA /* future_test_util.cc in Sources */, 12CCF1E528FDBD9F00C24941 /* validation_test.cc in Sources */, BC1D6839267B00EB005DC2DA /* type_test.cc in Sources */, diff --git a/firestore/integration_test_internal/src/aggregate_count_test.cc b/firestore/integration_test_internal/src/aggregate_count_test.cc index 7f3f462a1f..dc58961fc3 100644 --- a/firestore/integration_test_internal/src/aggregate_count_test.cc +++ b/firestore/integration_test_internal/src/aggregate_count_test.cc @@ -28,9 +28,15 @@ #include "firestore_integration_test.h" #include "util/event_accumulator.h" +#if defined(__ANDROID__) +#include "firestore/src/android/query_android.h" +#include "firestore/src/common/wrapper_assertions.h" +#endif // defined(__ANDROID__) + #include "Firestore/core/src/util/firestore_exceptions.h" #include "firebase/firestore/firestore_errors.h" #include "firebase_test_framework.h" +#include "gmock/gmock.h" #include "gtest/gtest.h" namespace firebase { @@ -751,5 +757,15 @@ TEST_F(AggregateCountTest, EXPECT_EQ(aggregate_query2, aggregate_snapshot2.query()); } +#if defined(__ANDROID__) +TEST(QueryTestAndroidStub, Construction) { + testutil::AssertWrapperConstructionContract(); +} + +TEST(QueryTestAndroidStub, Assignment) { + testutil::AssertWrapperAssignmentContract(); +} +#endif // defined(__ANDROID__) + } // namespace firestore } // namespace firebase diff --git a/firestore/integration_test_internal/src/aggregate_query_test.cc b/firestore/integration_test_internal/src/aggregate_query_test.cc index 4810e5e96f..4a52be9790 100644 --- a/firestore/integration_test_internal/src/aggregate_query_test.cc +++ b/firestore/integration_test_internal/src/aggregate_query_test.cc @@ -17,11 +17,6 @@ #include "firebase/firestore.h" #include "firestore_integration_test.h" -#if defined(__ANDROID__) -#include "firestore/src/android/aggregate_query_android.h" -#include "firestore/src/common/wrapper_assertions.h" -#endif // defined(__ANDROID__) - #include "gtest/gtest.h" namespace firebase { @@ -337,16 +332,6 @@ TEST_F(AggregateQueryTest, TestHashCode) { AggregateQueryHash(query1.Count())); } -#if defined(__ANDROID__) -TEST(QueryTestAndroidStub, Construction) { - testutil::AssertWrapperConstructionContract(); -} - -TEST(QueryTestAndroidStub, Assignment) { - testutil::AssertWrapperAssignmentContract(); -} -#endif // defined(__ANDROID__) - } // namespace } // namespace firestore } // namespace firebase diff --git a/firestore/integration_test_internal/src/filter_test.cc b/firestore/integration_test_internal/src/filter_test.cc deleted file mode 100644 index e3806943d0..0000000000 --- a/firestore/integration_test_internal/src/filter_test.cc +++ /dev/null @@ -1,550 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "firebase/firestore.h" -#include "firestore_integration_test.h" - -namespace firebase { -namespace firestore { -namespace { - -using FilterTest = FirestoreIntegrationTest; - -TEST_F(FilterTest, CopyConstructorReturnsEqualObject) { - const Filter filter1a = Filter::EqualTo("foo", FieldValue::Integer(42)); - const Filter filter2a = Filter::ArrayContainsAny( - "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); - const Filter filter3a = Filter::And(filter1a, filter2a); - - const Filter filter1b(filter1a); - const Filter filter2b(filter2a); - const Filter filter3b(filter3a); - - EXPECT_EQ(filter1a, filter1b); - EXPECT_EQ(filter2a, filter2b); - EXPECT_EQ(filter3a, filter3b); -} - -TEST_F(FilterTest, CopyAssignementReturnsEqualObject) { - const Filter filter1 = Filter::EqualTo("foo", FieldValue::Integer(42)); - const Filter filter2 = Filter::ArrayContainsAny( - "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); - const Filter filter3 = Filter::And(filter1, filter2); - - Filter filter = Filter::And(); - - EXPECT_NE(filter, filter1); - EXPECT_NE(filter, filter2); - EXPECT_NE(filter, filter3); - - filter = filter1; - - EXPECT_EQ(filter, filter1); - EXPECT_NE(filter, filter2); - EXPECT_NE(filter, filter3); - - filter = filter2; - - EXPECT_NE(filter, filter1); - EXPECT_EQ(filter, filter2); - EXPECT_NE(filter, filter3); - - filter = filter3; - - EXPECT_NE(filter, filter1); - EXPECT_NE(filter, filter2); - EXPECT_EQ(filter, filter3); -} - -TEST_F(FilterTest, MoveConstructorReturnsEqualObject) { - Filter filter1a = Filter::EqualTo("foo", FieldValue::Integer(42)); - Filter filter2a = Filter::ArrayContainsAny( - "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); - Filter filter3a = Filter::And(filter1a, filter2a); - - Filter filter1b(std::move(filter1a)); - EXPECT_EQ(filter1b, Filter::EqualTo("foo", FieldValue::Integer(42))); - - Filter filter2b(std::move(filter2a)); - EXPECT_EQ(filter2b, - Filter::ArrayContainsAny( - "bar", {FieldValue::Integer(4), FieldValue::Integer(2)})); - - Filter filter3b(std::move(filter3a)); - EXPECT_EQ(filter3b, Filter::And(filter1b, filter2b)); -} - -TEST_F(FilterTest, MoveAssignmentReturnsEqualObject) { - Filter filter1a = Filter::EqualTo("foo", FieldValue::Integer(42)); - Filter filter2a = Filter::ArrayContainsAny( - "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); - Filter filter3a = Filter::And(filter1a, filter2a); - - Filter filter1b = std::move(filter1a); - EXPECT_EQ(filter1b, Filter::EqualTo("foo", FieldValue::Integer(42))); - - Filter filter2b = std::move(filter2a); - EXPECT_EQ(filter2b, - Filter::ArrayContainsAny( - "bar", {FieldValue::Integer(4), FieldValue::Integer(2)})); - - Filter filter3b = std::move(filter3a); - EXPECT_EQ(filter3b, Filter::And(filter1b, filter2b)); -} - -TEST_F(FilterTest, MoveAssignmentAppliedToSelfReturnsEqualObject) { - Filter filter1 = Filter::EqualTo("foo", FieldValue::Integer(42)); - Filter filter2 = Filter::ArrayContainsAny( - "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); - Filter filter3 = Filter::And(filter1, filter2); - - filter1 = std::move(filter1); - EXPECT_EQ(filter1, Filter::EqualTo("foo", FieldValue::Integer(42))); - - filter2 = std::move(filter2); - EXPECT_EQ(filter2, Filter::ArrayContainsAny("bar", {FieldValue::Integer(4), - FieldValue::Integer(2)})); - - filter3 = std::move(filter3); - EXPECT_EQ(filter3, Filter::And(filter1, filter2)); -} - -TEST_F(FilterTest, IdenticalFilterShouldBeEqual) { - FieldPath foo_path{std::vector{"foo"}}; - - Filter filter1a = Filter::ArrayContains("foo", FieldValue::Integer(42)); - Filter filter1b = Filter::ArrayContains(foo_path, FieldValue::Integer(42)); - - Filter filter2a = Filter::ArrayContainsAny("foo", {FieldValue::Integer(42)}); - Filter filter2b = - Filter::ArrayContainsAny(foo_path, {FieldValue::Integer(42)}); - - Filter filter3a = Filter::EqualTo("foo", FieldValue::Integer(42)); - Filter filter3b = Filter::EqualTo(foo_path, FieldValue::Integer(42)); - - Filter filter4a = Filter::NotEqualTo("foo", FieldValue::Integer(42)); - Filter filter4b = Filter::NotEqualTo(foo_path, FieldValue::Integer(42)); - - Filter filter5a = Filter::GreaterThan("foo", FieldValue::Integer(42)); - Filter filter5b = Filter::GreaterThan(foo_path, FieldValue::Integer(42)); - - Filter filter6a = - Filter::GreaterThanOrEqualTo("foo", FieldValue::Integer(42)); - Filter filter6b = - Filter::GreaterThanOrEqualTo(foo_path, FieldValue::Integer(42)); - - Filter filter7a = Filter::LessThan("foo", FieldValue::Integer(42)); - Filter filter7b = Filter::LessThan(foo_path, FieldValue::Integer(42)); - - Filter filter8a = Filter::LessThanOrEqualTo("foo", FieldValue::Integer(42)); - Filter filter8b = - Filter::LessThanOrEqualTo(foo_path, FieldValue::Integer(42)); - - Filter filter9a = Filter::In("foo", {FieldValue::Integer(42)}); - Filter filter9b = Filter::In(foo_path, {FieldValue::Integer(42)}); - - Filter filter10a = Filter::NotIn("foo", {FieldValue::Integer(42)}); - Filter filter10b = Filter::NotIn(foo_path, {FieldValue::Integer(42)}); - - Filter filter11a = Filter::And(filter1a, filter2a); - Filter filter11b = Filter::And(filter1b, filter2b); - - Filter filter12a = - Filter::Or(filter3a, filter4a, filter5a, filter6a, filter7a); - Filter filter12b = - Filter::Or(filter3b, filter4b, filter5b, filter6b, filter7b); - - EXPECT_TRUE(filter1a == filter1a); - EXPECT_TRUE(filter2a == filter2a); - EXPECT_TRUE(filter3a == filter3a); - EXPECT_TRUE(filter4a == filter4a); - EXPECT_TRUE(filter5a == filter5a); - EXPECT_TRUE(filter6a == filter6a); - EXPECT_TRUE(filter7a == filter7a); - EXPECT_TRUE(filter8a == filter8a); - EXPECT_TRUE(filter9a == filter9a); - EXPECT_TRUE(filter10a == filter10a); - EXPECT_TRUE(filter11a == filter11a); - EXPECT_TRUE(filter12a == filter12a); - - EXPECT_TRUE(filter1a == filter1b); - EXPECT_TRUE(filter2a == filter2b); - EXPECT_TRUE(filter3a == filter3b); - EXPECT_TRUE(filter4a == filter4b); - EXPECT_TRUE(filter5a == filter5b); - EXPECT_TRUE(filter6a == filter6b); - EXPECT_TRUE(filter7a == filter7b); - EXPECT_TRUE(filter8a == filter8b); - EXPECT_TRUE(filter9a == filter9b); - EXPECT_TRUE(filter10a == filter10b); - EXPECT_TRUE(filter11a == filter11b); - EXPECT_TRUE(filter12a == filter12b); - - EXPECT_FALSE(filter1a != filter1a); - EXPECT_FALSE(filter2a != filter2a); - EXPECT_FALSE(filter3a != filter3a); - EXPECT_FALSE(filter4a != filter4a); - EXPECT_FALSE(filter5a != filter5a); - EXPECT_FALSE(filter6a != filter6a); - EXPECT_FALSE(filter7a != filter7a); - EXPECT_FALSE(filter8a != filter8a); - EXPECT_FALSE(filter9a != filter9a); - EXPECT_FALSE(filter10a != filter10a); - EXPECT_FALSE(filter11a != filter11a); - EXPECT_FALSE(filter12a != filter12a); - - EXPECT_FALSE(filter1a != filter1b); - EXPECT_FALSE(filter2a != filter2b); - EXPECT_FALSE(filter3a != filter3b); - EXPECT_FALSE(filter4a != filter4b); - EXPECT_FALSE(filter5a != filter5b); - EXPECT_FALSE(filter6a != filter6b); - EXPECT_FALSE(filter7a != filter7b); - EXPECT_FALSE(filter8a != filter8b); - EXPECT_FALSE(filter9a != filter9b); - EXPECT_FALSE(filter10a != filter10b); - EXPECT_FALSE(filter11a != filter11b); - EXPECT_FALSE(filter12a != filter12b); - - EXPECT_TRUE(filter1a != filter2a); - EXPECT_TRUE(filter1a != filter3a); - EXPECT_TRUE(filter1a != filter4a); - EXPECT_TRUE(filter1a != filter5a); - EXPECT_TRUE(filter1a != filter6a); - EXPECT_TRUE(filter1a != filter7a); - EXPECT_TRUE(filter1a != filter8a); - EXPECT_TRUE(filter1a != filter9a); - EXPECT_TRUE(filter1a != filter10a); - EXPECT_TRUE(filter1a != filter11a); - EXPECT_TRUE(filter1a != filter12a); - EXPECT_TRUE(filter2a != filter3a); - EXPECT_TRUE(filter2a != filter4a); - EXPECT_TRUE(filter2a != filter5a); - EXPECT_TRUE(filter2a != filter6a); - EXPECT_TRUE(filter2a != filter7a); - EXPECT_TRUE(filter2a != filter8a); - EXPECT_TRUE(filter2a != filter9a); - EXPECT_TRUE(filter2a != filter10a); - EXPECT_TRUE(filter2a != filter11a); - EXPECT_TRUE(filter2a != filter12a); - EXPECT_TRUE(filter3a != filter4a); - EXPECT_TRUE(filter3a != filter5a); - EXPECT_TRUE(filter3a != filter6a); - EXPECT_TRUE(filter3a != filter7a); - EXPECT_TRUE(filter3a != filter8a); - EXPECT_TRUE(filter3a != filter9a); - EXPECT_TRUE(filter3a != filter10a); - EXPECT_TRUE(filter3a != filter11a); - EXPECT_TRUE(filter3a != filter12a); - EXPECT_TRUE(filter4a != filter5a); - EXPECT_TRUE(filter4a != filter6a); - EXPECT_TRUE(filter4a != filter7a); - EXPECT_TRUE(filter4a != filter8a); - EXPECT_TRUE(filter4a != filter9a); - EXPECT_TRUE(filter4a != filter10a); - EXPECT_TRUE(filter4a != filter11a); - EXPECT_TRUE(filter4a != filter12a); - EXPECT_TRUE(filter5a != filter6a); - EXPECT_TRUE(filter5a != filter7a); - EXPECT_TRUE(filter5a != filter8a); - EXPECT_TRUE(filter5a != filter9a); - EXPECT_TRUE(filter5a != filter10a); - EXPECT_TRUE(filter5a != filter11a); - EXPECT_TRUE(filter5a != filter12a); - EXPECT_TRUE(filter6a != filter7a); - EXPECT_TRUE(filter6a != filter8a); - EXPECT_TRUE(filter6a != filter9a); - EXPECT_TRUE(filter6a != filter10a); - EXPECT_TRUE(filter6a != filter11a); - EXPECT_TRUE(filter6a != filter12a); - EXPECT_TRUE(filter7a != filter8a); - EXPECT_TRUE(filter7a != filter9a); - EXPECT_TRUE(filter7a != filter10a); - EXPECT_TRUE(filter7a != filter11a); - EXPECT_TRUE(filter7a != filter12a); - EXPECT_TRUE(filter8a != filter9a); - EXPECT_TRUE(filter8a != filter10a); - EXPECT_TRUE(filter8a != filter11a); - EXPECT_TRUE(filter8a != filter12a); - EXPECT_TRUE(filter9a != filter10a); - EXPECT_TRUE(filter9a != filter11a); - EXPECT_TRUE(filter9a != filter12a); - EXPECT_TRUE(filter10a != filter11a); - EXPECT_TRUE(filter10a != filter12a); - EXPECT_TRUE(filter11a != filter12a); -} - -TEST_F(FilterTest, DifferentValuesAreNotEqual) { - Filter filter1a = Filter::ArrayContains("foo", FieldValue::Integer(24)); - Filter filter1b = Filter::ArrayContains("foo", FieldValue::Integer(42)); - Filter filter1c = Filter::ArrayContains("bar", FieldValue::Integer(42)); - - Filter filter2a = Filter::EqualTo("foo", FieldValue::Integer(24)); - Filter filter2b = Filter::EqualTo("foo", FieldValue::Integer(42)); - Filter filter2c = Filter::EqualTo("bar", FieldValue::Integer(42)); - - Filter filter3a = Filter::NotEqualTo("foo", FieldValue::Integer(24)); - Filter filter3b = Filter::NotEqualTo("foo", FieldValue::Integer(42)); - Filter filter3c = Filter::NotEqualTo("bar", FieldValue::Integer(42)); - - Filter filter4a = Filter::GreaterThan("foo", FieldValue::Integer(24)); - Filter filter4b = Filter::GreaterThan("foo", FieldValue::Integer(42)); - Filter filter4c = Filter::GreaterThan("bar", FieldValue::Integer(42)); - - Filter filter5a = - Filter::GreaterThanOrEqualTo("foo", FieldValue::Integer(24)); - Filter filter5b = - Filter::GreaterThanOrEqualTo("foo", FieldValue::Integer(42)); - Filter filter5c = - Filter::GreaterThanOrEqualTo("bar", FieldValue::Integer(42)); - - Filter filter6a = Filter::LessThan("foo", FieldValue::Integer(24)); - Filter filter6b = Filter::LessThan("foo", FieldValue::Integer(42)); - Filter filter6c = Filter::LessThan("bar", FieldValue::Integer(42)); - - Filter filter7a = Filter::LessThanOrEqualTo("foo", FieldValue::Integer(24)); - Filter filter7b = Filter::LessThanOrEqualTo("foo", FieldValue::Integer(42)); - Filter filter7c = Filter::LessThanOrEqualTo("bar", FieldValue::Integer(42)); - - EXPECT_FALSE(filter1a == filter1b); - EXPECT_FALSE(filter1b == filter1c); - EXPECT_FALSE(filter2a == filter2b); - EXPECT_FALSE(filter2b == filter2c); - EXPECT_FALSE(filter3a == filter3b); - EXPECT_FALSE(filter3b == filter3c); - EXPECT_FALSE(filter4a == filter4b); - EXPECT_FALSE(filter4b == filter4c); - EXPECT_FALSE(filter5a == filter5b); - EXPECT_FALSE(filter5b == filter5c); - EXPECT_FALSE(filter6a == filter6b); - EXPECT_FALSE(filter6b == filter6c); - EXPECT_FALSE(filter7a == filter7b); - EXPECT_FALSE(filter7b == filter7c); - - EXPECT_TRUE(filter1a != filter1b); - EXPECT_TRUE(filter1b != filter1c); - EXPECT_TRUE(filter2a != filter2b); - EXPECT_TRUE(filter2b != filter2c); - EXPECT_TRUE(filter3a != filter3b); - EXPECT_TRUE(filter3b != filter3c); - EXPECT_TRUE(filter4a != filter4b); - EXPECT_TRUE(filter4b != filter4c); - EXPECT_TRUE(filter5a != filter5b); - EXPECT_TRUE(filter5b != filter5c); - EXPECT_TRUE(filter6a != filter6b); - EXPECT_TRUE(filter6b != filter6c); - EXPECT_TRUE(filter7a != filter7b); - EXPECT_TRUE(filter7b != filter7c); -} - -TEST_F(FilterTest, CompositesWithOneFilterAreTheSameAsFilter) { - Filter filter1 = Filter::EqualTo("foo", FieldValue::Integer(42)); - Filter filter2 = Filter::Or(filter1); - Filter filter3 = Filter::And(filter1); - - EXPECT_TRUE(filter1 == filter2); - EXPECT_TRUE(filter1 == filter3); - - EXPECT_FALSE(filter1 != filter2); - EXPECT_FALSE(filter1 != filter3); -} - -TEST_F(FilterTest, EmptyCompositeIsIgnoredByCompositesAndQueries) { - Filter filter1 = Filter::And(); - Filter filter2 = Filter::And(Filter::And(), Filter::And()); - Filter filter3 = Filter::And(Filter::Or(), Filter::Or()); - Filter filter4 = Filter::Or(); - Filter filter5 = Filter::Or(Filter::Or(), Filter::Or()); - Filter filter6 = Filter::Or(Filter::And(), Filter::And()); - - EXPECT_EQ(filter1, filter2); - EXPECT_EQ(filter1, filter3); - EXPECT_EQ(filter4, filter5); - EXPECT_EQ(filter4, filter6); - - CollectionReference collection = Collection(); - - Query query1 = collection.Where(filter1); - Query query2 = collection.Where(filter2); - Query query3 = collection.Where(filter3); - Query query4 = collection.Where(filter4); - Query query5 = collection.Where(filter5); - Query query6 = collection.Where(filter6); - - EXPECT_EQ(collection, query1); - EXPECT_EQ(collection, query2); - EXPECT_EQ(collection, query3); - EXPECT_EQ(collection, query4); - EXPECT_EQ(collection, query5); - EXPECT_EQ(collection, query6); -} - -TEST_F(FilterTest, CompositeComparison) { - Filter filter1 = Filter::ArrayContains("foo", FieldValue::Integer(42)); - Filter filter2 = Filter::EqualTo("foo", FieldValue::Integer(42)); - Filter filter3 = Filter::NotEqualTo("foo", FieldValue::Integer(42)); - Filter filter4 = Filter::GreaterThan("foo", FieldValue::Integer(42)); - - Filter and1 = Filter::And(filter1); - Filter and2 = Filter::And(filter1, filter2); - Filter and3 = Filter::And(filter1, filter2, filter3); - Filter and4 = Filter::And(filter1, filter2, filter3, filter4); - - Filter or1 = Filter::Or(filter1); - Filter or2 = Filter::Or(filter1, filter2); - Filter or3 = Filter::Or(filter1, filter2, filter3); - Filter or4 = Filter::Or(filter1, filter2, filter3, filter4); - - EXPECT_EQ(and1, and1); - EXPECT_EQ(and2, and2); - EXPECT_EQ(and3, and3); - EXPECT_EQ(and4, and4); - - EXPECT_EQ(or1, or1); - EXPECT_EQ(or2, or2); - EXPECT_EQ(or3, or3); - EXPECT_EQ(or4, or4); - - // Is equal because single filter composite is same as filter itself. - EXPECT_EQ(and1, or1); - - EXPECT_NE(and2, or2); - EXPECT_NE(and3, or3); - EXPECT_NE(and4, or4); - - EXPECT_NE(and1, and2); - EXPECT_NE(and1, and3); - EXPECT_NE(and1, and4); - EXPECT_NE(and2, and3); - EXPECT_NE(and2, and4); - EXPECT_NE(and3, and4); - - EXPECT_NE(or1, or2); - EXPECT_NE(or1, or3); - EXPECT_NE(or1, or4); - EXPECT_NE(or2, or3); - EXPECT_NE(or2, or4); - EXPECT_NE(or3, or4); -} - -TEST_F(FilterTest, QueryWhereComposite) { - MapFieldValue doc_aaa = {{"x", FieldValue::String("a")}, - {"y", FieldValue::String("a")}, - {"z", FieldValue::String("a")}}; - MapFieldValue doc_aab = {{"x", FieldValue::String("a")}, - {"y", FieldValue::String("a")}, - {"z", FieldValue::String("b")}}; - MapFieldValue doc_aba = {{"x", FieldValue::String("a")}, - {"y", FieldValue::String("b")}, - {"z", FieldValue::String("a")}}; - MapFieldValue doc_abb = {{"x", FieldValue::String("a")}, - {"y", FieldValue::String("b")}, - {"z", FieldValue::String("b")}}; - MapFieldValue doc_baa = {{"x", FieldValue::String("b")}, - {"y", FieldValue::String("a")}, - {"z", FieldValue::String("a")}}; - MapFieldValue doc_bab = {{"x", FieldValue::String("b")}, - {"y", FieldValue::String("a")}, - {"z", FieldValue::String("b")}}; - MapFieldValue doc_bba = {{"x", FieldValue::String("b")}, - {"y", FieldValue::String("b")}, - {"z", FieldValue::String("a")}}; - MapFieldValue doc_bbb = {{"x", FieldValue::String("b")}, - {"y", FieldValue::String("b")}, - {"z", FieldValue::String("b")}}; - CollectionReference collection = Collection({{"aaa", doc_aaa}, - {"aab", doc_aab}, - {"aba", doc_aba}, - {"abb", doc_abb}, - {"baa", doc_baa}, - {"bab", doc_bab}, - {"bba", doc_bba}, - {"bbb", doc_bbb}}); - - Filter filter_xa = Filter::EqualTo("x", FieldValue::String("a")); - Filter filter_ya = Filter::EqualTo("y", FieldValue::String("a")); - Filter filter_yb = Filter::EqualTo("y", FieldValue::String("b")); - Filter filter_za = Filter::EqualTo("z", FieldValue::String("a")); - - // And(x=a) - QuerySnapshot snapshot1 = - ReadDocuments(collection.Where(Filter::And(filter_xa))); - EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), - QuerySnapshotToValues(snapshot1)); - - // And(x=a, y=b) - QuerySnapshot snapshot2 = - ReadDocuments(collection.Where(Filter::And(filter_xa, filter_yb))); - EXPECT_EQ(std::vector({doc_aba, doc_abb}), - QuerySnapshotToValues(snapshot2)); - - // And(Or(And(x=a)),Or(And(Or())) - QuerySnapshot snapshot3 = ReadDocuments( - collection.Where(Filter::And(Filter::Or(Filter::And(filter_xa)), - Filter::Or(Filter::And(Filter::Or()))))); - EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), - QuerySnapshotToValues(snapshot3)); - - // Or(x=a) - QuerySnapshot snapshot4 = - ReadDocuments(collection.Where(Filter::Or(filter_xa))); - EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), - QuerySnapshotToValues(snapshot4)); - - // Or(x=a, y=b) - QuerySnapshot snapshot5 = - ReadDocuments(collection.Where(Filter::Or(filter_xa, filter_yb))); - EXPECT_EQ(std::vector( - {doc_aaa, doc_aab, doc_aba, doc_abb, doc_bba, doc_bbb}), - QuerySnapshotToValues(snapshot5)); - - // Or(And(Or(x=a)),And(Or(And())) - QuerySnapshot snapshot6 = ReadDocuments( - collection.Where(Filter::Or(Filter::And(Filter::Or(filter_xa)), - Filter::And(Filter::Or(Filter::And()))))); - EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), - QuerySnapshotToValues(snapshot6)); - - // And(x=b, Or(y=a, And(y=b, z=a))) - QuerySnapshot snapshot7 = ReadDocuments(collection.Where(Filter::And( - filter_xa, Filter::Or(filter_ya, Filter::And(filter_yb, filter_za))))); - EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba}), - QuerySnapshotToValues(snapshot7)); -} - -TEST_F(FilterTest, QueryEmptyWhereComposite) { - MapFieldValue doc = {{"foo", FieldValue::String("bar")}}; - CollectionReference collection = Collection({{"x", doc}}); - - QuerySnapshot s1 = ReadDocuments(collection.Where(Filter::And())); - EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s1)); - - QuerySnapshot s2 = - ReadDocuments(collection.Where(Filter::And(Filter::Or(), Filter::Or()))); - EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s2)); - - QuerySnapshot s3 = ReadDocuments(collection.Where(Filter::Or())); - EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s3)); - - QuerySnapshot s4 = - ReadDocuments(collection.Where(Filter::Or(Filter::And(), Filter::And()))); - EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s4)); -} - -} // namespace - -} // namespace firestore -} // namespace firebase diff --git a/firestore/src/android/filter_android.cc b/firestore/src/android/filter_android.cc deleted file mode 100644 index e81cd3f926..0000000000 --- a/firestore/src/android/filter_android.cc +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "firestore/src/android/filter_android.h" - -#include "firestore/src/android/converter_android.h" -#include "firestore/src/android/field_path_android.h" -#include "firestore/src/android/field_value_android.h" -#include "firestore/src/android/firestore_android.h" - -#include "firestore/src/jni/array.h" -#include "firestore/src/jni/array_list.h" -#include "firestore/src/jni/compare.h" -#include "firestore/src/jni/env.h" -#include "firestore/src/jni/loader.h" - -namespace firebase { -namespace firestore { -namespace { - -using jni::Array; -using jni::ArrayList; -using jni::Env; -using jni::Local; -using jni::Object; -using jni::StaticMethod; - -constexpr char kClassName[] = - PROGUARD_KEEP_CLASS "com/google/firebase/firestore/Filter"; -StaticMethod kEqualTo( - "equalTo", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kNotEqualTo( - "notEqualTo", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kLessThan( - "lessThan", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kLessThanOrEqualTo( - "lessThanOrEqualTo", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kGreaterThan( - "greaterThan", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kGreaterThanOrEqualTo( - "greaterThanOrEqualTo", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kArrayContains( - "arrayContains", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kArrayContainsAny( - "arrayContainsAny", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kIn( - "in", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kNotIn( - "notIn", - "(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kAnd("and", - "([Lcom/google/firebase/firestore/Filter;)" - "Lcom/google/firebase/firestore/Filter;"); -StaticMethod kOr("or", - "([Lcom/google/firebase/firestore/Filter;)" - "Lcom/google/firebase/firestore/Filter;"); -} // namespace - -void FilterInternal::Initialize(jni::Loader& loader) { - loader.LoadClass(kClassName, kEqualTo, kNotEqualTo, kLessThan, - kLessThanOrEqualTo, kGreaterThan, kGreaterThanOrEqualTo, - kArrayContains, kArrayContainsAny, kIn, kNotIn, kAnd, kOr); -} - -FilterInternal::FilterInternal(jni::Object&& object, bool is_empty) - : object_(object), is_empty_(is_empty) {} - -Filter FilterInternal::EqualTo(const FieldPath& field, - const FieldValue& value) { - return Where(field, kEqualTo, value); -} - -Filter FilterInternal::NotEqualTo(const FieldPath& field, - const FieldValue& value) { - return Where(field, kNotEqualTo, value); -} - -Filter FilterInternal::LessThan(const FieldPath& field, - const FieldValue& value) { - return Where(field, kLessThan, value); -} - -Filter FilterInternal::LessThanOrEqualTo(const FieldPath& field, - const FieldValue& value) { - return Where(field, kLessThanOrEqualTo, value); -} - -Filter FilterInternal::GreaterThan(const FieldPath& field, - const FieldValue& value) { - return Where(field, kGreaterThan, value); -} - -Filter FilterInternal::GreaterThanOrEqualTo(const FieldPath& field, - const FieldValue& value) { - return Where(field, kGreaterThanOrEqualTo, value); -} - -Filter FilterInternal::ArrayContains(const FieldPath& field, - const FieldValue& value) { - return Where(field, kArrayContains, value); -} - -Filter FilterInternal::ArrayContainsAny(const FieldPath& field, - const std::vector& values) { - return Where(field, kArrayContainsAny, values); -} - -Filter FilterInternal::In(const FieldPath& field, - const std::vector& values) { - return Where(field, kIn, values); -} - -Filter FilterInternal::NotIn(const FieldPath& field, - const std::vector& values) { - return Where(field, kNotIn, values); -} - -Filter FilterInternal::And(const std::vector& filters) { - return Where(kAnd, filters); -} - -Filter FilterInternal::Or(const std::vector& filters) { - return Where(kOr, filters); -} - -Env FilterInternal::GetEnv() { return FirestoreInternal::GetEnv(); } - -Filter FilterInternal::Where(const FieldPath& field, - const StaticMethod& method, - const FieldValue& value) { - Env env = GetEnv(); - Local java_field = FieldPathConverter::Create(env, field); - Object filter = - env.Call(method, java_field, FieldValueInternal::ToJava(value)); - return Filter(new FilterInternal(std::move(filter), false)); -} - -Filter FilterInternal::Where(const FieldPath& field, - const jni::StaticMethod& method, - const std::vector& values) { - Env env = GetEnv(); - size_t size = values.size(); - Local java_values = ArrayList::Create(env, size); - for (size_t i = 0; i < size; ++i) { - java_values.Add(env, FieldValueInternal::ToJava(values[i])); - } - - Local java_field = FieldPathConverter::Create(env, field); - Object filter = env.Call(method, java_field, java_values); - return Filter(new FilterInternal(std::move(filter), false)); -} - -Filter FilterInternal::Where(const StaticMethod& method, - const std::vector& filters) { - Env env = GetEnv(); - size_t size = filters.size(); - Local> java_filters = env.NewArray(size, Object::GetClass()); - bool is_empty = true; - for (int i = 0; i < size; ++i) { - FilterInternal* internal_filter = filters[i].internal_; - if (!internal_filter->IsEmpty()) { - is_empty = false; - } - java_filters.Set(env, i, internal_filter->object_); - } - Object filter = env.Call(method, java_filters); - return Filter(new FilterInternal(std::move(filter), is_empty)); -} - -bool operator==(const FilterInternal& lhs, const FilterInternal& rhs) { - return jni::EqualityCompareJni(lhs, rhs); -} - -} // namespace firestore -} // namespace firebase diff --git a/firestore/src/android/filter_android.h b/firestore/src/android/filter_android.h deleted file mode 100644 index c69984c537..0000000000 --- a/firestore/src/android/filter_android.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIREBASE_FIRESTORE_SRC_ANDROID_FILTER_ANDROID_H_ -#define FIREBASE_FIRESTORE_SRC_ANDROID_FILTER_ANDROID_H_ - -#include - -#include "firestore/src/android/wrapper.h" -#include "firestore/src/include/firebase/firestore/field_path.h" -#include "firestore/src/include/firebase/firestore/field_value.h" -#include "firestore/src/include/firebase/firestore/filter.h" - -namespace firebase { -namespace firestore { - -class FilterInternal final { - public: - static void Initialize(jni::Loader& loader); - - FilterInternal(jni::Object&& object, bool is_empty); - - static Filter ArrayContains(const FieldPath& field, const FieldValue& value); - static Filter ArrayContainsAny(const FieldPath& field, - const std::vector& values); - static Filter EqualTo(const FieldPath& field, const FieldValue& value); - static Filter NotEqualTo(const FieldPath& field, const FieldValue& value); - static Filter GreaterThan(const FieldPath& field, const FieldValue& value); - static Filter GreaterThanOrEqualTo(const FieldPath& field, - const FieldValue& value); - static Filter LessThan(const FieldPath& field, const FieldValue& value); - static Filter LessThanOrEqualTo(const FieldPath& field, - const FieldValue& value); - static Filter In(const FieldPath& field, - const std::vector& values); - static Filter NotIn(const FieldPath& field, - const std::vector& values); - static Filter Or(const std::vector& filters); - static Filter And(const std::vector& filters); - - const jni::Global& ToJava() const { return object_; } - - private: - friend class Filter; - friend class FirestoreInternal; - - FilterInternal* clone() { return new FilterInternal(*this); } - - bool IsEmpty() const { return is_empty_; } - - static jni::Env GetEnv(); - - jni::Global object_; - const bool is_empty_; - - // A generalized function for all WhereFoo calls. - static Filter Where(const FieldPath& field, - const jni::StaticMethod& method, - const FieldValue& value); - static Filter Where(const FieldPath& field, - const jni::StaticMethod& method, - const std::vector& values); - static Filter Where(const jni::StaticMethod& method, - const std::vector& filters); -}; - -bool operator==(const FilterInternal& lhs, const FilterInternal& rhs); - -inline bool operator!=(const FilterInternal& lhs, const FilterInternal& rhs) { - return !(lhs == rhs); -} - -} // namespace firestore -} // namespace firebase - -#endif // FIREBASE_FIRESTORE_SRC_ANDROID_FILTER_ANDROID_H_ diff --git a/firestore/src/android/query_android.cc b/firestore/src/android/query_android.cc index 436e12c0a2..27a1dd2e38 100644 --- a/firestore/src/android/query_android.cc +++ b/firestore/src/android/query_android.cc @@ -25,7 +25,6 @@ #include "firestore/src/android/event_listener_android.h" #include "firestore/src/android/field_path_android.h" #include "firestore/src/android/field_value_android.h" -#include "firestore/src/android/filter_android.h" #include "firestore/src/android/firestore_android.h" #include "firestore/src/android/lambda_event_listener.h" #include "firestore/src/android/listener_registration_android.h" @@ -56,9 +55,6 @@ constexpr char kClassName[] = PROGUARD_KEEP_CLASS "com/google/firebase/firestore/Query"; Method kCount("count", "()Lcom/google/firebase/firestore/AggregateQuery;"); -Method kWhere("where", - "(Lcom/google/firebase/firestore/Filter;)" - "Lcom/google/firebase/firestore/Query;"); Method kEqualTo( "whereEqualTo", "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" @@ -148,7 +144,7 @@ void QueryInternal::Initialize(jni::Loader& loader) { kGreaterThan, kGreaterThanOrEqualTo, kArrayContains, kArrayContainsAny, kIn, kNotIn, kOrderBy, kLimit, kLimitToLast, kStartAtSnapshot, kStartAt, kStartAfterSnapshot, kStartAfter, kEndBeforeSnapshot, kEndBefore, - kEndAtSnapshot, kEndAt, kGet, kAddSnapshotListener, kHashCode, kWhere); + kEndAtSnapshot, kEndAt, kGet, kAddSnapshotListener, kHashCode); } Firestore* QueryInternal::firestore() { @@ -162,12 +158,6 @@ AggregateQuery QueryInternal::Count() const { return firestore_->NewAggregateQuery(env, aggregate_query); } -Query QueryInternal::Where(const firebase::firestore::Filter& filter) const { - Env env = GetEnv(); - Local query = env.Call(obj_, kWhere, filter.internal_->ToJava()); - return firestore_->NewQuery(env, query); -} - Query QueryInternal::WhereEqualTo(const FieldPath& field, const FieldValue& value) const { return Where(field, kEqualTo, value); diff --git a/firestore/src/android/query_android.h b/firestore/src/android/query_android.h index a325e561e4..abb3dea8e3 100644 --- a/firestore/src/android/query_android.h +++ b/firestore/src/android/query_android.h @@ -71,14 +71,6 @@ class QueryInternal : public Wrapper { */ virtual AggregateQuery Count() const; - /** - * @brief Creates and returns a new Query with the additional filter. - * - * @param filter The new filter to apply to the existing query. - * @return The created Query. - */ - Query Where(const Filter& filter) const; - /** * @brief Creates and returns a new Query with the additional filter that * documents must contain the specified field and the value should be equal to diff --git a/firestore/src/common/filter.cc b/firestore/src/common/filter.cc deleted file mode 100644 index 77ae208beb..0000000000 --- a/firestore/src/common/filter.cc +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "firebase/firestore/filter.h" - -#include "firestore/src/common/cleanup.h" -#include "firestore/src/common/hard_assert_common.h" - -#if defined(__ANDROID__) -#include "firestore/src/android/filter_android.h" -#else -#include "firestore/src/main/filter_main.h" -#endif // defined(__ANDROID__) - -#include "firestore/src/common/util.h" - -namespace firebase { -namespace firestore { - -Filter::Filter(const Filter& other) { internal_ = other.internal_->clone(); } - -Filter::Filter(Filter&& other) noexcept { - std::swap(internal_, other.internal_); -} - -Filter::Filter(FilterInternal* internal) : internal_(internal) { - SIMPLE_HARD_ASSERT(internal != nullptr); -} - -Filter::~Filter() { - delete internal_; - internal_ = nullptr; -} - -Filter& Filter::operator=(const Filter& other) { - if (this == &other) { - return *this; - } - delete internal_; - internal_ = other.internal_->clone(); - return *this; -} - -Filter& Filter::operator=(Filter&& other) noexcept { - if (this == &other) { - return *this; - } - delete internal_; - internal_ = other.internal_; - other.internal_ = nullptr; - return *this; -} - -Filter Filter::ArrayContains(const std::string& field, - const FieldValue& value) { - return ArrayContains(FieldPath::FromDotSeparatedString(field), value); -} - -Filter Filter::ArrayContainsAny(const std::string& field, - const std::vector& values) { - return ArrayContainsAny(FieldPath::FromDotSeparatedString(field), values); -} - -Filter Filter::EqualTo(const std::string& field, - const firebase::firestore::FieldValue& value) { - return EqualTo(FieldPath::FromDotSeparatedString(field), value); -} - -Filter Filter::NotEqualTo(const std::string& field, const FieldValue& value) { - return NotEqualTo(FieldPath::FromDotSeparatedString(field), value); -} - -Filter Filter::GreaterThan(const std::string& field, const FieldValue& value) { - return GreaterThan(FieldPath::FromDotSeparatedString(field), value); -} - -Filter Filter::GreaterThanOrEqualTo(const std::string& field, - const FieldValue& value) { - return GreaterThanOrEqualTo(FieldPath::FromDotSeparatedString(field), value); -} - -Filter Filter::LessThan(const std::string& field, const FieldValue& value) { - return LessThan(FieldPath::FromDotSeparatedString(field), value); -} - -Filter Filter::LessThanOrEqualTo(const std::string& field, - const FieldValue& value) { - return LessThanOrEqualTo(FieldPath::FromDotSeparatedString(field), value); -} - -Filter Filter::In(const std::string& field, - const std::vector& values) { - return In(FieldPath::FromDotSeparatedString(field), values); -} - -Filter Filter::NotIn(const std::string& field, - const std::vector& values) { - return NotIn(FieldPath::FromDotSeparatedString(field), values); -} - -Filter Filter::ArrayContains(const FieldPath& field, const FieldValue& value) { - return FilterInternal::ArrayContains(field, value); -} - -Filter Filter::ArrayContainsAny(const FieldPath& field, - const std::vector& values) { - return FilterInternal::ArrayContainsAny(field, values); -} - -Filter Filter::EqualTo(const FieldPath& field, const FieldValue& value) { - return FilterInternal::EqualTo(field, value); -} - -Filter Filter::NotEqualTo(const FieldPath& field, const FieldValue& value) { - return FilterInternal::NotEqualTo(field, value); -} - -Filter Filter::GreaterThan(const FieldPath& field, const FieldValue& value) { - return FilterInternal::GreaterThan(field, value); -} - -Filter Filter::GreaterThanOrEqualTo(const FieldPath& field, - const FieldValue& value) { - return FilterInternal::GreaterThanOrEqualTo(field, value); -} - -Filter Filter::LessThan(const FieldPath& field, const FieldValue& value) { - return FilterInternal::LessThan(field, value); -} - -Filter Filter::LessThanOrEqualTo(const FieldPath& field, - const FieldValue& value) { - return FilterInternal::LessThanOrEqualTo(field, value); -} - -Filter Filter::In(const FieldPath& field, - const std::vector& values) { - return FilterInternal::In(field, values); -} - -Filter Filter::NotIn(const FieldPath& field, - const std::vector& values) { - return FilterInternal::NotIn(field, values); -} - -Filter Filter::And(const std::vector& filters) { - return FilterInternal::And(filters); -} - -Filter Filter::Or(const std::vector& filters) { - return FilterInternal::Or(filters); -} - -bool operator==(const Filter& lhs, const Filter& rhs) { - return EqualityCompare(lhs.internal_, rhs.internal_); -} - -bool Filter::IsEmpty() const { return internal_->IsEmpty(); } - -} // namespace firestore -} // namespace firebase diff --git a/firestore/src/common/query.cc b/firestore/src/common/query.cc index 089fc9375f..4e12cb9041 100644 --- a/firestore/src/common/query.cc +++ b/firestore/src/common/query.cc @@ -27,7 +27,6 @@ #include "firestore/src/include/firebase/firestore/document_snapshot.h" #include "firestore/src/include/firebase/firestore/field_path.h" #include "firestore/src/include/firebase/firestore/field_value.h" -#include "firestore/src/include/firebase/firestore/filter.h" #include "firestore/src/include/firebase/firestore/listener_registration.h" #include "firestore/src/include/firebase/firestore/query_snapshot.h" #if defined(__ANDROID__) @@ -113,16 +112,6 @@ AggregateQuery Query::Count() const { return internal_->Count(); } -Query Query::Where(const Filter& filter) const { - if (!internal_) return {}; - if (filter.IsEmpty()) { - // Return the existing query if not adding any more filters (e.g. an empty - // composite filter). - return *this; - } - return internal_->Where(filter); -} - Query Query::WhereEqualTo(const std::string& field, const FieldValue& value) const { return WhereEqualTo(FieldPath::FromDotSeparatedString(field), value); diff --git a/firestore/src/common/type_mapping.h b/firestore/src/common/type_mapping.h index 5501181da3..269b92a410 100644 --- a/firestore/src/common/type_mapping.h +++ b/firestore/src/common/type_mapping.h @@ -34,8 +34,6 @@ class DocumentReference; class DocumentReferenceInternal; class DocumentSnapshot; class DocumentSnapshotInternal; -class Filter; -class FilterInternal; class FieldValue; class FieldValueInternal; class Firestore; @@ -85,10 +83,6 @@ struct InternalTypeMap { using type = DocumentSnapshotInternal; }; template <> -struct InternalTypeMap { - using type = FilterInternal; -}; -template <> struct InternalTypeMap { using type = FieldValueInternal; }; diff --git a/firestore/src/include/firebase/firestore.h b/firestore/src/include/firebase/firestore.h index c3cf04e07f..7cc0274812 100644 --- a/firestore/src/include/firebase/firestore.h +++ b/firestore/src/include/firebase/firestore.h @@ -36,7 +36,6 @@ #include "firebase/firestore/document_snapshot.h" #include "firebase/firestore/field_path.h" #include "firebase/firestore/field_value.h" -#include "firebase/firestore/filter.h" #include "firebase/firestore/firestore_errors.h" #include "firebase/firestore/geo_point.h" #include "firebase/firestore/listener_registration.h" diff --git a/firestore/src/include/firebase/firestore/field_path.h b/firestore/src/include/firebase/firestore/field_path.h index 81c8cb5739..d09dec6411 100644 --- a/firestore/src/include/firebase/firestore/field_path.h +++ b/firestore/src/include/firebase/firestore/field_path.h @@ -164,7 +164,6 @@ class FieldPath final { friend bool operator!=(const FieldPath& lhs, const FieldPath& rhs); friend struct std::hash; - friend class Filter; friend class DocumentSnapshot; // For access to `FromDotSeparatedString` friend class Query; friend class QueryInternal; diff --git a/firestore/src/include/firebase/firestore/filter.h b/firestore/src/include/firebase/firestore/filter.h deleted file mode 100644 index ff1471acc3..0000000000 --- a/firestore/src/include/firebase/firestore/filter.h +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIREBASE_FIRESTORE_SRC_INCLUDE_FIREBASE_FIRESTORE_FILTER_H_ -#define FIREBASE_FIRESTORE_SRC_INCLUDE_FIREBASE_FIRESTORE_FILTER_H_ - -#include -#include - -#include "firebase/firestore/field_value.h" - -namespace firebase { -namespace firestore { - -class FilterInternal; - -/** - * @brief A Filter represents a restriction on one or more field values and can - * be used to refine the results of a Query. - */ -class Filter { - public: - /** - * @brief Creates a new filter for checking that the given array field - * contains the given value. - * - * @param[in] field The name of the field containing an array to search. - * @param[in] value The value that must be contained in the array. - * - * @return The newly created filter. - */ - static Filter ArrayContains(const std::string& field, - const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given array field - * contains any of the given values. - * - * @param[in] field The name of the field containing an array to search. - * @param[in] values The list of values to match. - * - * @return The newly created filter. - */ - static Filter ArrayContainsAny(const std::string& field, - const std::vector& values); - - /** - * @brief Creates a new filter for checking that the given field is equal to - * the given value. - * - * @param[in] field The name of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter EqualTo(const std::string& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is not equal - * to the given value. - * - * @param[in] field The name of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter NotEqualTo(const std::string& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is greater - * than the given value. - * - * @param[in] field The name of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter GreaterThan(const std::string& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is greater - * than or equal to the given value. - * - * @param[in] field The name of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter GreaterThanOrEqualTo(const std::string& field, - const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is less than - * the given value. - * - * @param[in] field The name of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter LessThan(const std::string& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is less than - * or equal to the given value. - * - * @param[in] field The name of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter LessThanOrEqualTo(const std::string& field, - const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field equals any of - * the given values. - * - * @param[in] field The name of the field to compare. - * @param[in] values The list of values to match. - * - * @return The newly created filter. - */ - static Filter In(const std::string& field, - const std::vector& values); - - /** - * @brief Creates a new filter for checking that the given field does not - * equal any of the given values. - * - * @param[in] field The name of the field to compare. - * @param[in] values The list of values to match. - * - * @return The newly created filter. - */ - static Filter NotIn(const std::string& field, - const std::vector& values); - - /** - * @brief Creates a new filter for checking that the given array field - * contains the given value. - * - * @param[in] field The path of the field containing an array to search. - * @param[in] value The value that must be contained in the array. - * - * @return The newly created filter. - */ - static Filter ArrayContains(const FieldPath& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given array field - * contains any of the given values. - * - * @param[in] field The path of the field containing an array to search. - * @param[in] values The list of values to match. - * - * @return The newly created filter. - */ - static Filter ArrayContainsAny(const FieldPath& field, - const std::vector& values); - - /** - * @brief Creates a new filter for checking that the given field is equal to - * the given value. - * - * @param[in] field The path of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter EqualTo(const FieldPath& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is not equal - * to the given value. - * - * @param[in] field The path of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter NotEqualTo(const FieldPath& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is greater - * than the given value. - * - * @param[in] field The path of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter GreaterThan(const FieldPath& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is greater - * than or equal to the given value. - * - * @param[in] field The path of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter GreaterThanOrEqualTo(const FieldPath& field, - const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is less than - * the given value. - * - * @param[in] field The path of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter LessThan(const FieldPath& field, const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field is less than - * or equal to the given value. - * - * @param[in] field The path of the field to compare. - * @param[in] value The value for comparison - * - * @return The newly created filter. - */ - static Filter LessThanOrEqualTo(const FieldPath& field, - const FieldValue& value); - - /** - * @brief Creates a new filter for checking that the given field equals any of - * the given values. - * - * @param[in] field The path of the field to compare. - * @param[in] values The list of values to match. - * - * @return The newly created filter. - */ - static Filter In(const FieldPath& field, - const std::vector& values); - - /** - * @brief Creates a new filter for checking that the given field does not - * equal any of the given values. - * - * @param[in] field The path of the field to compare. - * @param[in] values The list of values to match. - * - * @return The newly created filter. - */ - static Filter NotIn(const FieldPath& field, - const std::vector& values); - - /** - * @brief Creates a new filter that is a conjunction of the given filters. A - * conjunction filter includes a document if it satisfies all of the given - * filters. - * - * If no filter is given, the composite filter is a no-op, and if only one - * filter is given, the composite filter has the same behavior as the - * underlying filter. - * - * @param[in] filters The filters to perform a conjunction for. - * - * @return The newly created filter. - */ - template - static Filter And(const Filters&... filters) { - return AndInternal(filters...); - } - - /** - * @brief Creates a new filter that is a conjunction of the given filters. A - * conjunction filter includes a document if it satisfies all of the given - * filters. - * - * If no filter is given, the composite filter is a no-op, and if only one - * filter is given, the composite filter has the same behavior as the - * underlying filter. - * - * @param[in] filters The list that contains filters to perform a conjunction - * for. - * - * @return The newly created filter. - */ - static Filter And(const std::vector& filters); - - /** - * @brief Creates a new filter that is a disjunction of the given filters. A - * disjunction filter includes a document if it satisfies any of the - * given filters. - * - * If no filter is given, the composite filter is a no-op, and if only one - * filter is given, the composite filter has the same behavior as the - * underlying filter. - * - * @param[in] filters The filters to perform a disjunction for. - * - * @return The newly created filter. - */ - template - static Filter Or(const Filters&... filters) { - return OrInternal(filters...); - } - - /** - * @brief Creates a new filter that is a disjunction of the given filters. A - * disjunction filter includes a document if it satisfies any of the - * given filters. - * - * If no filter is given, the composite filter is a no-op, and if only one - * filter is given, the composite filter has the same behavior as the - * underlying filter. - * - * @param[in] filters The list that contains filters to perform a disjunction - * for. - * - * @return The newly created filter. - */ - static Filter Or(const std::vector& filters); - - /** - * @brief Copy constructor. - * - * `Filter` is immutable and can be efficiently copied. - * - * @param[in] other `Filter` to copy from. - */ - Filter(const Filter& other); - - /** - * @brief Move constructor. - * - * @param[in] other `Filter` to move data from. - */ - Filter(Filter&& other) noexcept; - - /** - * @brief Copy assignment operator. - * - * `Filter` is immutable and can be efficiently copied. - * - * @param[in] other `Filter` to copy from. - * - * @return Reference to the destination `Filter`. - */ - Filter& operator=(const Filter& other); - - /** - * @brief Move assignment operator. - * - * @param[in] other `Filter` to move data from. - * - * @return Reference to the destination `Filter`. - */ - Filter& operator=(Filter&& other) noexcept; - - ~Filter(); - - private: - friend class Query; - friend class QueryInternal; - friend class FilterInternal; - friend bool operator==(const Filter& lhs, const Filter& rhs); - friend struct ConverterImpl; - - static inline Filter AndInternal(const Filter& filter) { return filter; } - - template - static inline Filter AndInternal(const Filters&... filters) { - return And(std::vector({filters...})); - } - - static inline Filter OrInternal(const Filter& filter) { return filter; } - - template - static inline Filter OrInternal(const Filters&... filters) { - return Or(std::vector({filters...})); - } - - bool IsEmpty() const; - - explicit Filter(FilterInternal* internal); - FilterInternal* internal_ = nullptr; -}; - -/** Checks `lhs` and `rhs` for equality. */ -bool operator==(const Filter& lhs, const Filter& rhs); - -/** Checks `lhs` and `rhs` for inequality. */ -inline bool operator!=(const Filter& lhs, const Filter& rhs) { - return !(lhs == rhs); -} - -} // namespace firestore -} // namespace firebase - -#endif // FIREBASE_FIRESTORE_SRC_INCLUDE_FIREBASE_FIRESTORE_FILTER_H_ diff --git a/firestore/src/include/firebase/firestore/query.h b/firestore/src/include/firebase/firestore/query.h index d696492146..0586756854 100644 --- a/firestore/src/include/firebase/firestore/query.h +++ b/firestore/src/include/firebase/firestore/query.h @@ -41,7 +41,6 @@ class AggregateQuery; class DocumentSnapshot; template class EventListener; -class Filter; class FieldPath; class FieldValue; class ListenerRegistration; @@ -84,7 +83,8 @@ class Query { /** * @brief Copy constructor. * - * `Query` is immutable and can be efficiently copied. + * `Query` is immutable and can be efficiently copied (no deep copy is + * performed). * * @param[in] other `Query` to copy from. */ @@ -105,7 +105,8 @@ class Query { /** * @brief Copy assignment operator. * - * `Query` is immutable and can be efficiently copied. + * `Query` is immutable and can be efficiently copied (no deep copy is + * performed). * * @param[in] other `Query` to copy from. * @@ -160,14 +161,6 @@ class Query { */ virtual AggregateQuery Count() const; - /** - * @brief Creates and returns a new Query with the additional filter. - * - * @param filter The new filter to apply to the existing query. - * @return The created Query. - */ - virtual Query Where(const Filter& filter) const; - /** * @brief Creates and returns a new Query with the additional filter that * documents must contain the specified field and the value should be equal to @@ -402,7 +395,7 @@ class Query { * A Query can have only one `WhereIn()` filter and it cannot be * combined with `WhereArrayContainsAny()`. * - * @param[in] field The name of the field to compare. + * @param[in] field The name of the field containing an array to search. * @param[in] values The list that contains the values to match. * * @return The created Query. @@ -418,7 +411,7 @@ class Query { * A Query can have only one `WhereIn()` filter and it cannot be * combined with `WhereArrayContainsAny()`. * - * @param[in] field The path of the field to compare. + * @param[in] field The path of the field containing an array to search. * @param[in] values The list that contains the values to match. * * @return The created Query. @@ -440,7 +433,7 @@ class Query { * combined with `WhereArrayContains()`, `WhereArrayContainsAny()`, * `WhereIn()`, or `WhereNotEqualTo()`. * - * @param[in] field The name of the field to compare. + * @param[in] field The name of the field containing an array to search. * @param[in] values The list that contains the values to match. * * @return The created Query. @@ -462,7 +455,7 @@ class Query { * combined with `WhereArrayContains()`, `WhereArrayContainsAny()`, * `WhereIn()`, or `WhereNotEqualTo()`. * - * @param[in] field The path of the field to compare. + * @param[in] field The path of the field containing an array to search. * @param[in] values The list that contains the values to match. * * @return The created Query. diff --git a/firestore/src/main/composite_filter_main.cc b/firestore/src/main/composite_filter_main.cc deleted file mode 100644 index 82666c528b..0000000000 --- a/firestore/src/main/composite_filter_main.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined(__ANDROID__) -#error "This header should not be used on Android." -#endif - -#include -#include - -#include "Firestore/core/src/core/composite_filter.h" -#include "absl/algorithm/container.h" -#include "firestore/src/common/util.h" -#include "firestore/src/main/composite_filter_main.h" -#include "firestore/src/main/converter_main.h" - -namespace firebase { -namespace firestore { - -CompositeFilterInternal::CompositeFilterInternal( - core::CompositeFilter::Operator op, std::vector& filters) - : FilterInternal(FilterType::Composite), op_(op) { - for (FilterInternal* filter_internal : filters) { - filters_.emplace_back(std::shared_ptr(filter_internal)); - } -} - -CompositeFilterInternal* CompositeFilterInternal::clone() { - return new CompositeFilterInternal(*this); -} - -bool CompositeFilterInternal::IsEmpty() const { return filters_.empty(); } - -core::Filter CompositeFilterInternal::ToCoreFilter( - const api::Query& query, - const firebase::firestore::UserDataConverter& user_data_converter) const { - std::vector core_filters{}; - for (auto& filter : filters_) { - core_filters.push_back(filter->ToCoreFilter(query, user_data_converter)); - } - return core::CompositeFilter::Create(std::move(core_filters), op_); -} - -bool operator==(const CompositeFilterInternal& lhs, - const CompositeFilterInternal& rhs) { - return lhs.op_ == rhs.op_ && lhs.filters_.size() == rhs.filters_.size() && - std::equal(lhs.filters_.begin(), lhs.filters_.end(), - rhs.filters_.begin(), rhs.filters_.end(), - [](const std::shared_ptr& lhs_filter, - const std::shared_ptr& rhs_filter) { - return EqualityCompare(lhs_filter.get(), - rhs_filter.get()); - }); -} - -} // namespace firestore -} // namespace firebase diff --git a/firestore/src/main/composite_filter_main.h b/firestore/src/main/composite_filter_main.h deleted file mode 100644 index 4eb1ee5af8..0000000000 --- a/firestore/src/main/composite_filter_main.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIREBASE_FIRESTORE_SRC_MAIN_COMPOSITE_FILTER_MAIN_H_ -#define FIREBASE_FIRESTORE_SRC_MAIN_COMPOSITE_FILTER_MAIN_H_ - -#if defined(__ANDROID__) -#error "This header should not be used on Android." -#endif - -#include -#include - -#include "Firestore/core/src/api/query_core.h" -#include "firestore/src/main/filter_main.h" - -namespace firebase { -namespace firestore { - -class CompositeFilterInternal : public FilterInternal { - public: - CompositeFilterInternal(core::CompositeFilter::Operator op, - std::vector& filters); - - core::Filter ToCoreFilter(const api::Query& query, - const firebase::firestore::UserDataConverter& - user_data_converter) const override; - - friend bool operator==(const CompositeFilterInternal& lhs, - const CompositeFilterInternal& rhs); - - protected: - bool IsEmpty() const override; - - private: - CompositeFilterInternal* clone() override; - - const core::CompositeFilter::Operator op_; - std::vector> filters_; -}; - -bool operator==(const CompositeFilterInternal& lhs, - const CompositeFilterInternal& rhs); - -inline bool operator!=(const CompositeFilterInternal& lhs, - const CompositeFilterInternal& rhs) { - return !(lhs == rhs); -} - -} // namespace firestore -} // namespace firebase - -#endif // FIREBASE_FIRESTORE_SRC_MAIN_COMPOSITE_FILTER_MAIN_H_ diff --git a/firestore/src/main/converter_main.h b/firestore/src/main/converter_main.h index a4f1146e3c..14dac38a59 100644 --- a/firestore/src/main/converter_main.h +++ b/firestore/src/main/converter_main.h @@ -38,7 +38,6 @@ #include "firestore/src/main/aggregate_query_main.h" #include "firestore/src/main/aggregate_query_snapshot_main.h" #include "firestore/src/main/collection_reference_main.h" -#include "firestore/src/main/composite_filter_main.h" #include "firestore/src/main/document_change_main.h" #include "firestore/src/main/document_reference_main.h" #include "firestore/src/main/document_snapshot_main.h" @@ -47,7 +46,6 @@ #include "firestore/src/main/query_main.h" #include "firestore/src/main/query_snapshot_main.h" #include "firestore/src/main/transaction_main.h" -#include "firestore/src/main/unary_filter_main.h" #include "firestore/src/main/write_batch_main.h" #if defined(__ANDROID__) @@ -110,14 +108,6 @@ inline DocumentSnapshot MakePublic(api::DocumentSnapshot&& from) { return ConverterImpl::MakePublicFromCore(std::move(from)); } -inline Filter MakePublic(UnaryFilterInternal&& from) { - return ConverterImpl::MakePublicFromInternal(std::move(from)); -} - -inline Filter MakePublic(CompositeFilterInternal&& from) { - return ConverterImpl::MakePublicFromInternal(std::move(from)); -} - inline FieldValue MakePublic(FieldValueInternal&& from) { return ConverterImpl::MakePublicFromInternal(std::move(from)); } diff --git a/firestore/src/main/filter_main.cc b/firestore/src/main/filter_main.cc deleted file mode 100644 index bbc3afbcb1..0000000000 --- a/firestore/src/main/filter_main.cc +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "firestore/src/main/composite_filter_main.h" -#include "firestore/src/main/converter_main.h" -#include "firestore/src/main/filter_main.h" -#include "firestore/src/main/unary_filter_main.h" - -namespace firebase { -namespace firestore { - -Filter FilterInternal::ArrayContains(const FieldPath& field, - const FieldValue& value) { - return UnaryFilter(field, FieldFilterOperator::ArrayContains, value); -} - -Filter FilterInternal::ArrayContainsAny(const FieldPath& field, - const std::vector& values) { - return UnaryFilter(field, FieldFilterOperator::ArrayContainsAny, values); -} - -Filter FilterInternal::EqualTo(const FieldPath& field, - const FieldValue& value) { - return UnaryFilter(field, FieldFilterOperator::Equal, value); -} - -Filter FilterInternal::NotEqualTo(const FieldPath& field, - const FieldValue& value) { - return UnaryFilter(field, FieldFilterOperator::NotEqual, value); -} - -Filter FilterInternal::GreaterThan(const FieldPath& field, - const FieldValue& value) { - return UnaryFilter(field, FieldFilterOperator::GreaterThan, value); -} - -Filter FilterInternal::GreaterThanOrEqualTo(const FieldPath& field, - const FieldValue& value) { - return UnaryFilter(field, FieldFilterOperator::GreaterThanOrEqual, value); -} - -Filter FilterInternal::LessThan(const FieldPath& field, - const FieldValue& value) { - return UnaryFilter(field, FieldFilterOperator::LessThan, value); -} - -Filter FilterInternal::LessThanOrEqualTo(const FieldPath& field, - const FieldValue& value) { - return UnaryFilter(field, FieldFilterOperator::LessThanOrEqual, value); -} - -Filter FilterInternal::In(const FieldPath& field, - const std::vector& values) { - return UnaryFilter(field, FieldFilterOperator::In, values); -} - -Filter FilterInternal::NotIn(const FieldPath& field, - const std::vector& values) { - return UnaryFilter(field, FieldFilterOperator::NotIn, values); -} - -Filter FilterInternal::Or(const std::vector& filters) { - return CompositeFilter(CompositeOperator::Or, filters); -} - -Filter FilterInternal::And(const std::vector& filters) { - return CompositeFilter(CompositeOperator::And, filters); -} - -FilterInternal::FilterInternal(FilterInternal::FilterType filter_type) - : filter_type_(filter_type) {} - -Filter FilterInternal::UnaryFilter(const FieldPath& field_path, - FieldFilterOperator op, - const FieldValue& value) { - return MakePublic(UnaryFilterInternal(field_path, op, value)); -} - -Filter FilterInternal::UnaryFilter(const FieldPath& field_path, - FieldFilterOperator op, - const std::vector& values) { - return MakePublic(UnaryFilterInternal(field_path, op, values)); -} - -Filter FilterInternal::CompositeFilter(core::CompositeFilter::Operator op, - const std::vector& filters) { - std::vector nonEmptyFilters{}; - for (const Filter& filter : filters) { - FilterInternal* filterInternal = GetInternal(&filter); - if (!filterInternal->IsEmpty()) { - nonEmptyFilters.push_back(filterInternal->clone()); - } - } - if (nonEmptyFilters.size() == 1) { - return Filter(nonEmptyFilters[0]); - } - return MakePublic(CompositeFilterInternal(op, nonEmptyFilters)); -} - -bool operator==(const FilterInternal& lhs, const FilterInternal& rhs) { - if (lhs.filter_type_ == rhs.filter_type_) { - switch (lhs.filter_type_) { - case FilterInternal::Composite: - return *static_cast(&lhs) == - *static_cast(&rhs); - case FilterInternal::Unary: - return *static_cast(&lhs) == - *static_cast(&rhs); - } - } - return false; -} - -} // namespace firestore -} // namespace firebase diff --git a/firestore/src/main/filter_main.h b/firestore/src/main/filter_main.h deleted file mode 100644 index fbe1f4b728..0000000000 --- a/firestore/src/main/filter_main.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIREBASE_FIRESTORE_SRC_MAIN_FILTER_MAIN_H_ -#define FIREBASE_FIRESTORE_SRC_MAIN_FILTER_MAIN_H_ - -#if defined(__ANDROID__) -#error "This header should not be used on Android." -#endif - -#include - -#include "Firestore/core/src/api/query_core.h" -#include "Firestore/core/src/core/composite_filter.h" -#include "Firestore/core/src/core/filter.h" -#include "Firestore/core/src/model/field_path.h" -#include "firestore/src/include/firebase/firestore/filter.h" -#include "firestore/src/main/user_data_converter_main.h" - -namespace firebase { -namespace firestore { - -class Filter; - -class FilterInternal { - public: - static Filter ArrayContains(const FieldPath& field, const FieldValue& value); - static Filter ArrayContainsAny(const FieldPath& field, - const std::vector& values); - static Filter EqualTo(const FieldPath& field, const FieldValue& value); - static Filter NotEqualTo(const FieldPath& field, const FieldValue& value); - static Filter GreaterThan(const FieldPath& field, const FieldValue& value); - static Filter GreaterThanOrEqualTo(const FieldPath& field, - const FieldValue& value); - static Filter LessThan(const FieldPath& field, const FieldValue& value); - static Filter LessThanOrEqualTo(const FieldPath& field, - const FieldValue& value); - static Filter In(const FieldPath& field, - const std::vector& values); - static Filter NotIn(const FieldPath& field, - const std::vector& values); - static Filter Or(const std::vector& filters); - static Filter And(const std::vector& filters); - - virtual core::Filter ToCoreFilter( - const api::Query& query, - const firebase::firestore::UserDataConverter& user_data_converter) - const = 0; - - virtual ~FilterInternal() = default; - - friend bool operator==(const FilterInternal& lhs, const FilterInternal& rhs); - - protected: - enum FilterType { Unary, Composite }; - - explicit FilterInternal(FilterType filterType); - - const FilterType filter_type_; - - virtual bool IsEmpty() const = 0; - - private: - friend class Filter; - friend class QueryInternal; - - virtual FilterInternal* clone() = 0; - - using FieldFilterOperator = core::FieldFilter::Operator; - using CompositeOperator = core::CompositeFilter::Operator; - - static Filter UnaryFilter(const FieldPath& field_path, - FieldFilterOperator op, - const FieldValue& value); - static Filter UnaryFilter(const FieldPath& field_path, - FieldFilterOperator op, - const std::vector& values); - - static Filter CompositeFilter(CompositeOperator op, - const std::vector& filters); -}; - -bool operator==(const FilterInternal& lhs, const FilterInternal& rhs); - -inline bool operator!=(const FilterInternal& lhs, const FilterInternal& rhs) { - return !(lhs == rhs); -} - -} // namespace firestore -} // namespace firebase - -#endif // FIREBASE_FIRESTORE_SRC_MAIN_FILTER_MAIN_H_ diff --git a/firestore/src/main/query_main.cc b/firestore/src/main/query_main.cc index 6dab91109a..ffed058c9e 100644 --- a/firestore/src/main/query_main.cc +++ b/firestore/src/main/query_main.cc @@ -37,7 +37,6 @@ #include "firestore/src/main/aggregate_query_main.h" #include "firestore/src/main/converter_main.h" #include "firestore/src/main/document_snapshot_main.h" -#include "firestore/src/main/filter_main.h" #include "firestore/src/main/listener_main.h" #include "firestore/src/main/promise_main.h" #include "firestore/src/main/set_options_main.h" @@ -99,24 +98,31 @@ Future QueryInternal::Get(Source source) { AggregateQuery QueryInternal::Count() { return MakePublic(query_.Count()); } -Query QueryInternal::Where(const Filter& filter) const { - SIMPLE_HARD_ASSERT(!filter.IsEmpty()); - core::Filter core_filter = - GetInternal(&filter)->ToCoreFilter(query_, user_data_converter_); - api::Query decorated = query_.AddNewFilter(std::move(core_filter)); - return MakePublic(std::move(decorated)); -} - Query QueryInternal::Where(const FieldPath& field_path, Operator op, const FieldValue& value) const { - return Where(UnaryFilterInternal::UnaryFilter(field_path, op, value)); + const model::FieldPath& path = GetInternal(field_path); + Message parsed = + user_data_converter_.ParseQueryValue(value); + auto describer = [&value] { return Describe(value.type()); }; + + api::Query decorated = query_.AddNewFilter( + query_.ParseFieldFilter(path, op, std::move(parsed), describer)); + return MakePublic(std::move(decorated)); } Query QueryInternal::Where(const FieldPath& field_path, Operator op, const std::vector& values) const { - return Where(UnaryFilterInternal::UnaryFilter(field_path, op, values)); + const model::FieldPath& path = GetInternal(field_path); + auto array_value = FieldValue::Array(values); + Message parsed = + user_data_converter_.ParseQueryValue(array_value, true); + auto describer = [&array_value] { return Describe(array_value.type()); }; + + api::Query decorated = query_.AddNewFilter( + query_.ParseFieldFilter(path, op, std::move(parsed), describer)); + return MakePublic(std::move(decorated)); } Query QueryInternal::WithBound(BoundPosition bound_pos, diff --git a/firestore/src/main/query_main.h b/firestore/src/main/query_main.h index ddf773f846..958df81f03 100644 --- a/firestore/src/main/query_main.h +++ b/firestore/src/main/query_main.h @@ -28,7 +28,6 @@ #include "Firestore/core/src/core/query.h" #include "Firestore/core/src/nanopb/message.h" #include "firestore/src/include/firebase/firestore/field_path.h" -#include "firestore/src/include/firebase/firestore/filter.h" #include "firestore/src/include/firebase/firestore/query.h" #include "firestore/src/main/firestore_main.h" #include "firestore/src/main/promise_factory_main.h" @@ -69,7 +68,6 @@ class QueryInternal { callback); // Delegating methods - Query Where(const Filter& filter) const; Query WhereEqualTo(const FieldPath& field, const FieldValue& value) const { return Where(field, Operator::Equal, value); diff --git a/firestore/src/main/unary_filter_main.cc b/firestore/src/main/unary_filter_main.cc deleted file mode 100644 index 3561ba6f60..0000000000 --- a/firestore/src/main/unary_filter_main.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "firestore/src/main/unary_filter_main.h" - -#include "Firestore/core/src/nanopb/message.h" -#include "firestore/src/main/converter_main.h" - -namespace firebase { -namespace firestore { - -using nanopb::Message; - -UnaryFilterInternal::UnaryFilterInternal(FieldPath field_path, - core::FieldFilter::Operator op, - FieldValue value) - : FilterInternal(FilterType::Unary), - allow_arrays_(false), - path_(std::move(field_path)), - op_(op), - value_(std::move(value)) {} - -UnaryFilterInternal::UnaryFilterInternal(FieldPath field_path, - core::FieldFilter::Operator op, - const std::vector& values) - : FilterInternal(FilterType::Unary), - allow_arrays_(true), - path_(std::move(field_path)), - op_(op), - value_(FieldValue::Array(values)) {} - -UnaryFilterInternal* UnaryFilterInternal::clone() { - return new UnaryFilterInternal(*this); -} - -core::Filter UnaryFilterInternal::ToCoreFilter( - const api::Query& query, - const firebase::firestore::UserDataConverter& user_data_converter) const { - const model::FieldPath& path = GetInternal(path_); - Message parsed = - user_data_converter.ParseQueryValue(value_, allow_arrays_); - auto describer = [this] { return Describe(value_.type()); }; - - return query.ParseFieldFilter(path, op_, std::move(parsed), describer); -} - -bool operator==(const UnaryFilterInternal& lhs, - const UnaryFilterInternal& rhs) { - return lhs.op_ == rhs.op_ && lhs.path_ == rhs.path_ && - lhs.value_ == rhs.value_; -} - -} // namespace firestore -} // namespace firebase diff --git a/firestore/src/main/unary_filter_main.h b/firestore/src/main/unary_filter_main.h deleted file mode 100644 index e23d0c9481..0000000000 --- a/firestore/src/main/unary_filter_main.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIREBASE_FIRESTORE_SRC_MAIN_UNARY_FILTER_MAIN_H_ -#define FIREBASE_FIRESTORE_SRC_MAIN_UNARY_FILTER_MAIN_H_ - -#if defined(__ANDROID__) -#error "This header should not be used on Android." -#endif - -#include - -#include "Firestore/core/src/api/query_core.h" -#include "firestore/src/main/filter_main.h" - -namespace firebase { -namespace firestore { - -class UnaryFilterInternal final : public FilterInternal { - public: - UnaryFilterInternal(FieldPath field_path, - core::FieldFilter::Operator op, - FieldValue value); - UnaryFilterInternal(FieldPath field_path, - core::FieldFilter::Operator op, - const std::vector& values); - - core::Filter ToCoreFilter(const api::Query& query, - const firebase::firestore::UserDataConverter& - user_data_converter) const override; - - friend bool operator==(const UnaryFilterInternal& lhs, - const UnaryFilterInternal& rhs); - - protected: - bool IsEmpty() const override { return false; } - - private: - UnaryFilterInternal* clone() override; - - const bool allow_arrays_ = false; - const FieldPath path_; - const core::FieldFilter::Operator op_; - const FieldValue value_; -}; - -bool operator==(const UnaryFilterInternal& lhs, const UnaryFilterInternal& rhs); - -inline bool operator!=(const UnaryFilterInternal& lhs, - const UnaryFilterInternal& rhs) { - return !(lhs == rhs); -} - -} // namespace firestore -} // namespace firebase - -#endif // FIREBASE_FIRESTORE_SRC_MAIN_UNARY_FILTER_MAIN_H_ diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 6264e109c0..e1ff9696b8 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -627,11 +627,6 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes -### Upcoming Release -- Changes - - Firestore: Add support for disjunctions in queries (OR queries) - ([#1335](https://github.com/firebase/firebase-cpp-sdk/pull/1335)). - ### 11.3.0 - Changes - General (Android): Update to Firebase Android BoM version 32.2.0. diff --git a/remote_config/integration_test/src/integration_test.cc b/remote_config/integration_test/src/integration_test.cc index 4bc466276c..2ce5f145af 100644 --- a/remote_config/integration_test/src/integration_test.cc +++ b/remote_config/integration_test/src/integration_test.cc @@ -266,6 +266,10 @@ TEST_F(FirebaseRemoteConfigTest, TestSetDefault) { TEST_F(FirebaseRemoteConfigTest, TestAddOnConfigUpdateListener) { ASSERT_NE(rc_, nullptr); + // This test sometimes times out on Android with the config not updated. +#if defined(__ANDROID__) + FLAKY_TEST_SECTION_BEGIN(); +#endif // defined(__ANDROID__) // Check if the config has default values. If not, we have cached data // from a previous test run, and auto-fetch will not happen. EXPECT_TRUE(WaitForCompletion(SetDefaults(rc_), "SetDefaults")); @@ -302,6 +306,7 @@ TEST_F(FirebaseRemoteConfigTest, TestAddOnConfigUpdateListener) { firebase::remote_config::RemoteConfigError) {}); #else auto config_update_promise = std::make_shared >(); + auto config_update_future = config_update_promise->get_future(); firebase::remote_config::ConfigUpdateListenerRegistration registration = rc_->AddOnConfigUpdateListener( @@ -312,9 +317,8 @@ TEST_F(FirebaseRemoteConfigTest, TestAddOnConfigUpdateListener) { config_update_promise->set_value(); }); if (!has_cached_data) { - auto config_update_future = config_update_promise->get_future(); ASSERT_EQ(std::future_status::ready, - config_update_future.wait_for(std::chrono::milliseconds(30000))); + config_update_future.wait_for(std::chrono::milliseconds(20000))); // On Android WaitForCompletion must be called from the main thread, // so Activate is called here outside of the listener. @@ -324,15 +328,19 @@ TEST_F(FirebaseRemoteConfigTest, TestAddOnConfigUpdateListener) { std::map key_values = rc_->GetAll(); EXPECT_EQ(key_values.size(), 6); - for (auto key_valur_pair : kServerValue) { - firebase::Variant k_value = key_valur_pair.value; - firebase::Variant fetched_value = key_values[key_valur_pair.key]; + for (auto key_value_pair : kServerValue) { + firebase::Variant k_value = key_value_pair.value; + firebase::Variant fetched_value = key_values[key_value_pair.key]; EXPECT_EQ(k_value.type(), fetched_value.type()); EXPECT_EQ(k_value, fetched_value); } registration.Remove(); } #endif // !FIREBASE_PLATFORM_DESKTOP + // This test sometimes times out on Android with the config not updated. +#if defined(__ANDROID__) + FLAKY_TEST_SECTION_END(); +#endif // defined(__ANDROID__) } TEST_F(FirebaseRemoteConfigTest, TestRemoveConfigUpdateListener) { @@ -377,9 +385,9 @@ TEST_F(FirebaseRemoteConfigTest, TestGetAll) { std::map key_values = rc_->GetAll(); EXPECT_EQ(key_values.size(), 6); - for (auto key_valur_pair : kServerValue) { - firebase::Variant k_value = key_valur_pair.value; - firebase::Variant fetched_value = key_values[key_valur_pair.key]; + for (auto key_value_pair : kServerValue) { + firebase::Variant k_value = key_value_pair.value; + firebase::Variant fetched_value = key_values[key_value_pair.key]; EXPECT_EQ(k_value.type(), fetched_value.type()); EXPECT_EQ(k_value, fetched_value); } diff --git a/scripts/gha/report_build_status.py b/scripts/gha/report_build_status.py index 1bc1b5cab4..76b6b974df 100644 --- a/scripts/gha/report_build_status.py +++ b/scripts/gha/report_build_status.py @@ -112,6 +112,10 @@ "summary_include_crashes", True, "Whether to include CRASH/TIMEOUT in the test summary.") +flags.DEFINE_bool( + "firestore", False, + "Report on Firestore tests rather than on general tests.") + _WORKFLOW_TESTS = 'integration_tests.yml' _WORKFLOW_PACKAGING = 'cpp-packaging.yml' _TRIGGER_USER = 'firebase-workflow-trigger[bot]' @@ -380,11 +384,10 @@ def main(argv): if run['status'] != 'completed': continue if run['day'] < start_date or run['day'] > end_date: continue run['duration'] = dateutil.parser.parse(run['updated_at'], ignoretz=True) - run['date'] - if general_test_time in str(run['date']): + compare_test_time = firestore_test_time if FLAGS.firestore else general_test_time + if compare_test_time in str(run['date']): source_tests[day] = run all_days.add(day) - # elif firestore_test_time in str(run['date']): - # firestore_tests[day] = run workflow_id = _WORKFLOW_PACKAGING all_runs = firebase_github.list_workflow_runs(FLAGS.token, workflow_id, _BRANCH, 'schedule', _LIMIT) @@ -426,9 +429,15 @@ def main(argv): with progress.bar.Bar('Downloading triggered workflow logs...', max=len(package_tests_all)) as bar: for run in package_tests_all: day = str(run['date'].date()) - if day in package_tests and int(package_tests[day]['id']) < int(run['id']): - bar.next() - continue + if day in package_tests: + # Packaging triggers two tests. For Firestore, we want the larger run ID (the second run triggered). + if FLAGS.firestore and int(package_tests[day]['id']) > int(run['id']): + bar.next() + continue + # For general tests we want the smaller run ID (the first run triggered). + if not FLAGS.firestore and int(package_tests[day]['id']) < int(run['id']): + bar.next() + continue packaging_run = 0 From 570104d8e03779be53058bc7d0a22e98e9fff7b2 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Thu, 3 Aug 2023 11:03:52 -0700 Subject: [PATCH 02/13] Add header and stub for User Messaging Platform SDK. (#1391) * Added initial header and empty stub for UMP ConsentInfo. * Added error message getters. * Add ConsentInfo methods. * Format code. * Comment tweak. * Fix lint error. * Add LastResult methods. * Additional implementation. * Fix build. * Fix lint errors. * Added integration test for initializing library. * Update test. * Fix initialization. * Add internal methods. * Add mappings from interface class to internal class. * Add string conversion for error code. * Add conversion of form errors. * Add stub function implementations. * Add stub operations and unit tests. * Add missing file. * Format code. * Add check for form. * Add test for expected error not specifying tag for age of consent. * Clean up tests by moving initialization into shared method. * Fix TODO. * Fix lint issues. * Add Doxygen comments to public interface. * Add LastResult implementations, and tests to confirm. * Add method stubs for new UserMessagingPlatform API. * Handle invalid internal pointers. * Format code. * Add objective-C header for FormParent. * Add ump.h to top-level CMake file, so it gets added to the framework. * Change RequestConsentStatus to RequestConsentInfoUpdate. * Update integration test method name. * Update all Future return types to Future. Added GetInstance() with no parameters for Android, for convenience. * Add a test to ensure that GetInstance() always returns the same instance. * Change params to a struct. Add ConsentFormErrorUnavailable and remove some other enum entries. * Document the workflow that the stub simulates. * Clean up stub workflow for privacy options. * Add comment to struct. * Fix comments & enum text. * Newline removed. * Lint error. * Added comment explaining what EEA means. * Add a comment about ResetInfo in the UMP tests. * Add expectation for privacy also being unknown. * Move GetConsent*ErrorMessage to internal. * Update method documentation and fixed FormUnavailable/Available logic. * Fix comments. --- app/CMakeLists.txt | 5 +- gma/CMakeLists.txt | 5 + gma/integration_test/src/integration_test.cc | 385 ++++++++++++++++++ gma/src/common/ump/consent_info.cc | 177 ++++++++ gma/src/common/ump/consent_info_internal.cc | 90 ++++ gma/src/common/ump/consent_info_internal.h | 133 ++++++ gma/src/include/firebase/gma/ump.h | 23 ++ .../include/firebase/gma/ump/consent_info.h | 228 +++++++++++ gma/src/include/firebase/gma/ump/types.h | 179 ++++++++ .../stub/ump/consent_info_internal_stub.cc | 164 ++++++++ gma/src/stub/ump/consent_info_internal_stub.h | 86 ++++ 11 files changed, 1474 insertions(+), 1 deletion(-) create mode 100644 gma/src/common/ump/consent_info.cc create mode 100644 gma/src/common/ump/consent_info_internal.cc create mode 100644 gma/src/common/ump/consent_info_internal.h create mode 100644 gma/src/include/firebase/gma/ump.h create mode 100644 gma/src/include/firebase/gma/ump/consent_info.h create mode 100644 gma/src/include/firebase/gma/ump/types.h create mode 100644 gma/src/stub/ump/consent_info_internal_stub.cc create mode 100644 gma/src/stub/ump/consent_info_internal_stub.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index b008b7de78..ac52251529 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -546,7 +546,10 @@ if (IOS) ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/interstitial_ad.h ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/internal/native_ad.h ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/rewarded_ad.h - ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/types.h) + ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/types.h + ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/ump.h + ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/ump/consent_info.h + ${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/ump/types.h) set(installations_HDRS ${FIREBASE_SOURCE_DIR}/installations/src/include/firebase/installations.h) set(messaging_HDRS diff --git a/gma/CMakeLists.txt b/gma/CMakeLists.txt index caf0a32508..440d0db7f0 100644 --- a/gma/CMakeLists.txt +++ b/gma/CMakeLists.txt @@ -16,6 +16,8 @@ # Common source files used by all platforms set(common_SRCS + src/common/ump/consent_info.cc + src/common/ump/consent_info_internal.cc src/common/gma_common.cc src/common/ad_view.cc src/common/ad_view_internal.cc @@ -38,6 +40,7 @@ binary_to_array("gma_resources" # Source files used by the Android implementation. set(android_SRCS ${gma_resources_source} + src/stub/ump/consent_info_internal_stub.cc src/android/ad_request_converter.cc src/android/ad_error_android.cc src/android/adapter_response_info_android.cc @@ -51,6 +54,7 @@ set(android_SRCS # Source files used by the iOS implementation. set(ios_SRCS + src/stub/ump/consent_info_internal_stub.cc src/ios/FADAdSize.mm src/ios/FADAdView.mm src/ios/FADInterstitialDelegate.mm @@ -69,6 +73,7 @@ set(ios_SRCS # Source files used by the stub implementation. set(stub_SRCS + src/stub/ump/consent_info_internal_stub.cc src/stub/ad_error_stub.cc src/stub/adapter_response_info_stub.cc src/stub/gma_stub.cc diff --git a/gma/integration_test/src/integration_test.cc b/gma/integration_test/src/integration_test.cc index 2a48d0066f..c98bbb748f 100644 --- a/gma/integration_test/src/integration_test.cc +++ b/gma/integration_test/src/integration_test.cc @@ -26,6 +26,7 @@ #include "firebase/app.h" #include "firebase/gma.h" #include "firebase/gma/types.h" +#include "firebase/gma/ump.h" #include "firebase/util.h" #include "firebase_test_framework.h" // NOLINT @@ -2439,4 +2440,388 @@ TEST_F(FirebaseGmaTest, TestAdViewMultithreadDeletion) { #endif // #if defined(ANDROID) || (defined(TARGET_OS_IPHONE) && // TARGET_OS_IPHONE) +class FirebaseGmaUmpTest : public FirebaseGmaTest { + public: + FirebaseGmaUmpTest() : consent_info_(nullptr) {} + + // Whether to call ConsentInfo::Reset() upon initialization, which + // resets UMP's consent state to as if the app was first installed. + enum ResetOption { kReset, kNoReset }; + + void InitializeUmp(ResetOption reset = kReset); + void TerminateUmp(); + + void SetUp() override; + void TearDown() override; + + protected: + firebase::gma::ump::ConsentInfo* consent_info_; +}; + +void FirebaseGmaUmpTest::InitializeUmp(ResetOption reset) { + using firebase::gma::ump::ConsentInfo; + consent_info_ = ConsentInfo::GetInstance(*shared_app_); + if (consent_info_ != nullptr && reset == kReset) { + consent_info_->Reset(); + } +} + +void FirebaseGmaUmpTest::TerminateUmp() { + if (consent_info_) { + delete consent_info_; + consent_info_ = nullptr; + } +} + +void FirebaseGmaUmpTest::SetUp() { + FirebaseGmaTest::SetUp(); + InitializeUmp(); + ASSERT_NE(consent_info_, nullptr); +} + +void FirebaseGmaUmpTest::TearDown() { + TerminateUmp(); + FirebaseGmaTest::TearDown(); +} + +// Tests for User Messaging Platform +TEST_F(FirebaseGmaUmpTest, TestUmpInitialization) { + // Initialize handled automatically in test setup. + EXPECT_NE(consent_info_, nullptr); + // Terminate handled automatically in test teardown. +} + +// Tests for User Messaging Platform +TEST_F(FirebaseGmaUmpTest, TestUmpDefaultsToUnknownStatus) { + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusUnknown); + EXPECT_EQ(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusUnknown); + EXPECT_EQ(consent_info_->GetPrivacyOptionsRequirementStatus(), + firebase::gma::ump::kPrivacyOptionsRequirementStatusUnknown); + EXPECT_FALSE(consent_info_->CanRequestAds()); +} + +// Tests for User Messaging Platform +TEST_F(FirebaseGmaUmpTest, TestUmpGetInstanceIsAlwaysEqual) { + using firebase::gma::ump::ConsentInfo; + + EXPECT_NE(consent_info_, nullptr); + + // Ensure that GetInstance() with any options is always equal. + EXPECT_EQ(consent_info_, ConsentInfo::GetInstance()); + EXPECT_EQ(consent_info_, ConsentInfo::GetInstance(*shared_app_)); + +#if defined(ANDROID) + EXPECT_EQ(consent_info_, + ConsentInfo::GetInstance(app_framework::GetJniEnv(), + app_framework::GetActivity())); + + firebase::App* second_app = firebase::App::Create( + firebase::AppOptions(), "2ndApp", app_framework::GetJniEnv(), + app_framework::GetActivity()); +#else + firebase::App* second_app = + firebase::App::Create(firebase::AppOptions(), "2ndApp"); +#endif // defined(ANDROID) + + EXPECT_EQ(consent_info_, ConsentInfo::GetInstance(*second_app)); + + delete second_app; +} + +TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdate) { + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + + firebase::Future future = + consent_info_->RequestConsentInfoUpdate(params); + + EXPECT_TRUE(future == consent_info_->RequestConsentInfoUpdateLastResult()); + + WaitForCompletion(future, "RequestConsentInfoUpdate"); + + EXPECT_NE(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusUnknown); + EXPECT_NE(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusUnknown); + EXPECT_NE(consent_info_->GetPrivacyOptionsRequirementStatus(), + firebase::gma::ump::kPrivacyOptionsRequirementStatusUnknown); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugEEA) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + + firebase::Future future = + consent_info_->RequestConsentInfoUpdate(params); + + WaitForCompletion(future, "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugNonEEA) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyNonEEA; + + firebase::Future future = + consent_info_->RequestConsentInfoUpdate(params); + + WaitForCompletion(future, "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusNotRequired); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpLoadForm) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); + + EXPECT_EQ(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusAvailable); + + // Load the form. + firebase::Future future = consent_info_->LoadConsentForm(); + + EXPECT_TRUE(future == consent_info_->LoadConsentFormLastResult()); + + WaitForCompletion(future, "LoadConsentForm"); + + EXPECT_EQ(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusAvailable); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpShowForm) { + TEST_REQUIRES_USER_INTERACTION; + + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); + + EXPECT_EQ(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusAvailable); + + WaitForCompletion(consent_info_->LoadConsentForm(), "LoadConsentForm"); + + EXPECT_EQ(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusAvailable); + + firebase::Future future = consent_info_->ShowConsentForm(nullptr); + + EXPECT_TRUE(future == consent_info_->ShowConsentFormLastResult()); + + WaitForCompletion(future, "ShowConsentForm"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusObtained); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpLoadFormUnavailableDueUnderAgeOfConsent) { + TEST_REQUIRES_USER_INTERACTION; + + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = true; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); + + EXPECT_EQ(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusUnavailable); + + WaitForCompletion(consent_info_->LoadConsentForm(), "LoadConsentForm", + firebase::gma::ump::kConsentFormErrorUnavailable); + + EXPECT_EQ(consent_info_->GetConsentFormStatus(), + firebase::gma::ump::kConsentFormStatusUnavailable); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpLoadAndShowIfRequired) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + TEST_REQUIRES_USER_INTERACTION; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); + + firebase::Future future = + consent_info_->LoadAndShowConsentFormIfRequired(nullptr); + + EXPECT_TRUE(future == + consent_info_->LoadAndShowConsentFormIfRequiredLastResult()); + + WaitForCompletion(future, "LoadAndShowConsentFormIfRequired"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusObtained); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpPrivacyOptions) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + using firebase::gma::ump::PrivacyOptionsRequirementStatus; + + TEST_REQUIRES_USER_INTERACTION; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); + + EXPECT_FALSE(consent_info_->CanRequestAds()); + + WaitForCompletion(consent_info_->LoadAndShowConsentFormIfRequired(nullptr), + "LoadAndShowConsentFormIfRequired"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusObtained); + + EXPECT_TRUE(consent_info_->CanRequestAds()); + + EXPECT_EQ(consent_info_->GetPrivacyOptionsRequirementStatus(), + firebase::gma::ump::kPrivacyOptionsRequirementStatusRequired); + + firebase::Future future = + consent_info_->ShowPrivacyOptionsForm(nullptr); + + EXPECT_TRUE(future == consent_info_->ShowPrivacyOptionsFormLastResult()); + + WaitForCompletion(future, "ShowPrivacyOptionsForm"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); + + EXPECT_FALSE(consent_info_->CanRequestAds()); +} + +TEST_F(FirebaseGmaUmpTest, TestCanRequestAdsNonEEA) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + TEST_REQUIRES_USER_INTERACTION; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyNonEEA; + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusNotRequired); + + EXPECT_TRUE(consent_info_->CanRequestAds()); +} + +TEST_F(FirebaseGmaUmpTest, TestCanRequestAdsEEA) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + TEST_REQUIRES_USER_INTERACTION; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusRequired); + + EXPECT_FALSE(consent_info_->CanRequestAds()); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpCleanup) { + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + firebase::Future future_request = + consent_info_->RequestConsentInfoUpdate(params); + firebase::Future future_load = consent_info_->LoadConsentForm(); + firebase::Future future_show = consent_info_->ShowConsentForm(nullptr); + + delete consent_info_; + consent_info_ = nullptr; + + EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid); +} + } // namespace firebase_testapp_automated diff --git a/gma/src/common/ump/consent_info.cc b/gma/src/common/ump/consent_info.cc new file mode 100644 index 0000000000..89f2ed0410 --- /dev/null +++ b/gma/src/common/ump/consent_info.cc @@ -0,0 +1,177 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "firebase/gma/ump/consent_info.h" + +#include "app/src/assert.h" +#include "firebase/app.h" +#include "firebase/gma/ump.h" +#include "firebase/internal/platform.h" +#include "gma/src/common/ump/consent_info_internal.h" + +namespace firebase { +namespace gma { +namespace ump { + +ConsentInfo* ConsentInfo::s_instance_ = nullptr; + +ConsentInfo* ConsentInfo::GetInstance(const ::firebase::App& app, + ::firebase::InitResult* init_result_out) { + if (s_instance_) { + if (init_result_out) *init_result_out = kInitResultSuccess; + return s_instance_; + } +#if FIREBASE_PLATFORM_ANDROID + return GetInstance(app.GetJNIEnv(), app.activity(), init_result_out); +#else // !FIREBASE_PLATFORM_ANDROID + return GetInstance(init_result_out); +#endif // FIREBASE_PLATFORM_ANDROID +} + +#if FIREBASE_PLATFORM_ANDROID +ConsentInfo* ConsentInfo::GetInstance() { return s_instance_; } + +ConsentInfo* ConsentInfo::GetInstance(JNIEnv* jni_env, jobject activity, + ::firebase::InitResult* init_result_out) { +#else // !FIREBASE_PLATFORM_ANDROID +ConsentInfo* ConsentInfo::GetInstance(::firebase::InitResult* init_result_out) { +#endif + if (s_instance_) { + if (init_result_out) *init_result_out = kInitResultSuccess; + return s_instance_; + } + + ConsentInfo* consent_info = new ConsentInfo(); +#if FIREBASE_PLATFORM_ANDROID + InitResult result = + consent_info->Initialize(/* jni_env, activity */); // TODO(b/291622888) +#else + InitResult result = consent_info->Initialize(); +#endif + if (result != kInitResultSuccess) { + if (init_result_out) *init_result_out = result; + delete consent_info; + return nullptr; + } + return consent_info; +} + +ConsentInfo::ConsentInfo() { + internal_ = nullptr; +#if FIREBASE_PLATFORM_ANDROID + java_vm_ = nullptr; +#endif + s_instance_ = this; +} + +ConsentInfo::~ConsentInfo() { + if (internal_) { + delete internal_; + internal_ = nullptr; + } + s_instance_ = nullptr; +} + +InitResult ConsentInfo::Initialize() { + FIREBASE_ASSERT(!internal_); + internal_ = internal::ConsentInfoInternal::CreateInstance(); + return kInitResultSuccess; +} + +// Below this, everything is a passthrough to ConsentInfoInternal. If there is +// no internal_ pointer (e.g. it's been cleaned up), return default values and +// invalid futures. + +ConsentStatus ConsentInfo::GetConsentStatus() { + if (!internal_) return kConsentStatusUnknown; + return internal_->GetConsentStatus(); +} + +ConsentFormStatus ConsentInfo::GetConsentFormStatus() { + if (!internal_) return kConsentFormStatusUnknown; + return internal_->GetConsentFormStatus(); +} + +Future ConsentInfo::RequestConsentInfoUpdate( + const ConsentRequestParameters& params) { + if (!internal_) return Future(); + return internal_->RequestConsentInfoUpdate(params); +} + +Future ConsentInfo::RequestConsentInfoUpdateLastResult() { + if (!internal_) return Future(); + return internal_->RequestConsentInfoUpdateLastResult(); +} + +Future ConsentInfo::LoadConsentForm() { + if (!internal_) return Future(); + return internal_->LoadConsentForm(); +} + +Future ConsentInfo::LoadConsentFormLastResult() { + if (!internal_) return Future(); + return internal_->LoadConsentFormLastResult(); +} + +Future ConsentInfo::ShowConsentForm(FormParent parent) { + if (!internal_) return Future(); + return internal_->ShowConsentForm(parent); +} + +Future ConsentInfo::ShowConsentFormLastResult() { + if (!internal_) return Future(); + return internal_->ShowConsentFormLastResult(); +} + +Future ConsentInfo::LoadAndShowConsentFormIfRequired(FormParent parent) { + if (!internal_) return Future(); + return internal_->LoadAndShowConsentFormIfRequired(parent); +} + +Future ConsentInfo::LoadAndShowConsentFormIfRequiredLastResult() { + if (!internal_) return Future(); + return internal_->LoadAndShowConsentFormIfRequiredLastResult(); +} + +PrivacyOptionsRequirementStatus +ConsentInfo::GetPrivacyOptionsRequirementStatus() { + if (!internal_) return kPrivacyOptionsRequirementStatusUnknown; + return internal_->GetPrivacyOptionsRequirementStatus(); +} + +Future ConsentInfo::ShowPrivacyOptionsForm(FormParent parent) { + if (!internal_) return Future(); + return internal_->ShowPrivacyOptionsForm(parent); +} + +Future ConsentInfo::ShowPrivacyOptionsFormLastResult() { + if (!internal_) return Future(); + return internal_->ShowPrivacyOptionsFormLastResult(); +} + +bool ConsentInfo::CanRequestAds() { + if (!internal_) return false; + return internal_->CanRequestAds(); +} + +void ConsentInfo::Reset() { + if (!internal_) return; + internal_->Reset(); +} + +} // namespace ump +} // namespace gma +} // namespace firebase diff --git a/gma/src/common/ump/consent_info_internal.cc b/gma/src/common/ump/consent_info_internal.cc new file mode 100644 index 0000000000..ef58873575 --- /dev/null +++ b/gma/src/common/ump/consent_info_internal.cc @@ -0,0 +1,90 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gma/src/common/ump/consent_info_internal.h" + +#include "app/src/include/firebase/internal/platform.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +ConsentInfoInternal::ConsentInfoInternal() : futures_(kConsentInfoFnCount) {} + +ConsentInfoInternal::~ConsentInfoInternal() {} + +const char* ConsentInfoInternal::GetConsentRequestErrorMessage( + ConsentRequestError error_code) { + switch (error_code) { + case kConsentRequestSuccess: + return "Success"; + case kConsentRequestErrorInvalidAppId: +#if FIREBASE_PLATFORM_ANDROID + return "Missing or invalid com.google.android.gms.ads.APPLICATION_ID in " + "AndroidManifest.xml"; +#elif FIREBASE_PLATFORM_IOS + return "Missing or invalid GADApplicationidentifier in Info.plist"; +#else + return "Missing or invalid App ID"; +#endif + case kConsentRequestErrorNetwork: + return "Network error"; + case kConsentRequestErrorInternal: + return "Internal error"; + case kConsentRequestErrorCodeMisconfiguration: + return "A misconfiguration exists in the UI"; + case kConsentRequestErrorUnknown: + return "Unknown error"; + case kConsentRequestErrorInvalidOperation: + return "Invalid operation"; + case kConsentRequestErrorOperationInProgress: + return "Operation already in progress. Please wait for it to finish by " + "checking RequestConsentInfoUpdateLastResult()."; + default: + return "Bad error code"; + } +} + +const char* ConsentInfoInternal::GetConsentFormErrorMessage( + ConsentFormError error_code) { + switch (error_code) { + case kConsentFormSuccess: + return "Success"; + case kConsentFormErrorTimeout: + return "Timed out"; + case kConsentFormErrorUnavailable: + return "The form is unavailable."; + case kConsentFormErrorInternal: + return "Internal error"; + case kConsentFormErrorUnknown: + return "Unknown error"; + case kConsentFormErrorCodeAlreadyUsed: + return "Code already used"; + case kConsentFormErrorInvalidOperation: + return "Invalid operation"; + case kConsentFormErrorOperationInProgress: + return "Operation already in progress. Please wait for it to finish by " + "checking LoadFormLastResult() or ShowFormLastResult()."; + default: + return "Bad error code"; + } +} + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase diff --git a/gma/src/common/ump/consent_info_internal.h b/gma/src/common/ump/consent_info_internal.h new file mode 100644 index 0000000000..3438526ef0 --- /dev/null +++ b/gma/src/common/ump/consent_info_internal.h @@ -0,0 +1,133 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_GMA_SRC_COMMON_UMP_CONSENT_INFO_INTERNAL_H_ +#define FIREBASE_GMA_SRC_COMMON_UMP_CONSENT_INFO_INTERNAL_H_ + +#include "app/src/cleanup_notifier.h" +#include "app/src/reference_counted_future_impl.h" +#include "firebase/future.h" +#include "firebase/gma/ump.h" +#include "firebase/gma/ump/types.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +// Constants representing each ConsentInfo function that returns a Future. +enum ConsentInfoFn { + kConsentInfoFnRequestConsentInfoUpdate, + kConsentInfoFnLoadConsentForm, + kConsentInfoFnShowConsentForm, + kConsentInfoFnLoadAndShowConsentFormIfRequired, + kConsentInfoFnShowPrivacyOptionsForm, + kConsentInfoFnCount +}; + +class ConsentInfoInternal { + public: + virtual ~ConsentInfoInternal(); + + // Implemented in platform-specific code to instantiate a + // platform-specific subclass. + static ConsentInfoInternal* CreateInstance(); + + virtual ConsentStatus GetConsentStatus() const = 0; + virtual ConsentFormStatus GetConsentFormStatus() const = 0; + + virtual Future RequestConsentInfoUpdate( + const ConsentRequestParameters& params) = 0; + Future RequestConsentInfoUpdateLastResult() { + return static_cast&>( + futures()->LastResult(kConsentInfoFnRequestConsentInfoUpdate)); + } + virtual Future LoadConsentForm() = 0; + + Future LoadConsentFormLastResult() { + return static_cast&>( + futures()->LastResult(kConsentInfoFnLoadConsentForm)); + } + + virtual Future ShowConsentForm(FormParent parent) = 0; + + Future ShowConsentFormLastResult() { + return static_cast&>( + futures()->LastResult(kConsentInfoFnShowConsentForm)); + } + + virtual Future LoadAndShowConsentFormIfRequired(FormParent parent) = 0; + + Future LoadAndShowConsentFormIfRequiredLastResult() { + return static_cast&>( + futures()->LastResult(kConsentInfoFnLoadAndShowConsentFormIfRequired)); + } + + virtual PrivacyOptionsRequirementStatus + GetPrivacyOptionsRequirementStatus() = 0; + + virtual Future ShowPrivacyOptionsForm(FormParent parent) = 0; + + Future ShowPrivacyOptionsFormLastResult() { + return static_cast&>( + futures()->LastResult(kConsentInfoFnShowPrivacyOptionsForm)); + } + + virtual bool CanRequestAds() = 0; + + virtual void Reset() = 0; + + protected: + ConsentInfoInternal(); + + static const char* GetConsentRequestErrorMessage( + ConsentRequestError error_code); + + static const char* GetConsentFormErrorMessage(ConsentFormError error_code); + + SafeFutureHandle CreateFuture() { return futures()->SafeAlloc(); } + SafeFutureHandle CreateFuture(ConsentInfoFn fn_idx) { + return futures()->SafeAlloc(fn_idx); + } + + // Complete a Future with the given error code. + void CompleteFuture(SafeFutureHandle handle, ConsentRequestError error, + const char* message = nullptr) { + return futures()->Complete( + handle, error, + message ? message : GetConsentRequestErrorMessage(error)); + } + // Complete the future with the given error code. + void CompleteFuture(SafeFutureHandle handle, ConsentFormError error, + const char* message = nullptr) { + return futures()->Complete( + handle, error, message ? message : GetConsentFormErrorMessage(error)); + } + + ReferenceCountedFutureImpl* futures() { return &futures_; } + CleanupNotifier* cleanup() { return &cleanup_; } + + private: + ReferenceCountedFutureImpl futures_; + CleanupNotifier cleanup_; +}; + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase + +#endif // FIREBASE_GMA_SRC_COMMON_UMP_CONSENT_INFO_INTERNAL_H_ diff --git a/gma/src/include/firebase/gma/ump.h b/gma/src/include/firebase/gma/ump.h new file mode 100644 index 0000000000..26e90d630b --- /dev/null +++ b/gma/src/include/firebase/gma/ump.h @@ -0,0 +1,23 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_H_ +#define FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_H_ + +#include "firebase/gma/ump/consent_info.h" +#include "firebase/gma/ump/types.h" + +#endif // FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_H_ diff --git a/gma/src/include/firebase/gma/ump/consent_info.h b/gma/src/include/firebase/gma/ump/consent_info.h new file mode 100644 index 0000000000..32abf089f8 --- /dev/null +++ b/gma/src/include/firebase/gma/ump/consent_info.h @@ -0,0 +1,228 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_CONSENT_INFO_H_ +#define FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_CONSENT_INFO_H_ + +#include "firebase/app.h" +#include "firebase/future.h" +#include "firebase/gma/ump/types.h" +#include "firebase/internal/platform.h" + +#if FIREBASE_PLATFORM_ANDROID +#include +#endif // FIREBASE_PLATFORM_ANDROID + +namespace firebase { +namespace gma { +/// @brief API for User Messaging Platform. +/// +/// The User Messaging Platform (UMP) SDK is Google’s option to handle user +/// privacy and consent in mobile apps. +namespace ump { + +namespace internal { +// Forward declaration for platform-specific data, implemented in each library. +class ConsentInfoInternal; +} // namespace internal + +/// This class contains all of the methods necessary for obtaining +/// consent from the user. +class ConsentInfo { + public: + /// Shut down the User Messaging Platform Consent SDK + ~ConsentInfo(); + + /// Initializes the User Messaging Platform Consent SDK. + /// + /// @param[in] app Any Firebase App instance. + /// + /// @param[out] init_result_out Optional: If provided, write the basic init + /// result here. kInitResultSuccess if initialization succeeded, or + /// kInitResultFailedMissingDependency on Android if there are Android + /// dependencies missing. + /// + /// @return A pointer to the ConsentInfo instance if UMP was successfully + /// initialized, nullptr otherwise. Each call to GetInstance() will return the + /// same pointer; when you are finished using the SDK, you can delete the + /// pointer and the UMP SDK will shut down. + static ConsentInfo* GetInstance(const ::firebase::App& app, + InitResult* init_result_out = nullptr); + +#if FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN) + /// Initializes the User Messaging Platform Consent SDK without Firebase for + /// Android. + /// + /// The arguments to GetInstance() are platform-specific so the caller must + /// do something like this: + /// @code + /// #if defined(__ANDROID__) + /// consent_info = firebase::gma::ump::ConsentInfo::GetInstance(jni_env, + /// activity); #else consent_info = firebase::gma::ump::GetInstance(); #endif + /// @endcode + /// + /// @param[in] jni_env JNIEnv pointer. + /// @param[in] activity Activity used to start the application. + /// @param[out] init_result_out Optional: If provided, write the basic init + /// result here. kInitResultSuccess if initialization succeeded, or + /// kInitResultFailedMissingDependency on Android if there are Android + /// dependencies missing. + /// + /// @return A pointer to the ConsentInfo instance if UMP was successfully + /// initialized, nullptr otherwise. Each call to GetInstance() will return the + /// same pointer; when you are finished using the SDK, you can delete the + /// pointer and the UMP SDK will shut down. + static ConsentInfo* GetInstance(JNIEnv* jni_env, jobject activity, + InitResult* init_result_out = nullptr); + +#if !defined(DOXYGEN) + // On Android, this convenience function exists so you can easily get the + // existing ConsentInfo instance after it's first initialized. Returns nullptr + // if no instance has been created yet; make sure you have called + // GetInstance(JNIEnv*, jobject) first. + static ConsentInfo* GetInstance(); +#endif // defined(DOXYGEN) +#endif // FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN) + +#if !FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN) + /// Initializes User Messaging Platform for iOS without Firebase. + /// + /// @param[out] init_result_out Optional: If provided, write the basic init + /// result here. kInitResultSuccess if initialization succeeded, or + /// kInitResultFailedMissingDependency if a dependency is missing. On iOS, + /// this will always return kInitResultSuccess, as missing dependencies would + /// have caused a linker error at build time. + /// + /// @return A pointer to the ConsentInfo instance. Each call to GetInstance() + /// will return the same pointer; when you are finished using the SDK, you can + /// delete the pointer, and the UMP SDK will shut down. + static ConsentInfo* GetInstance(InitResult* init_result_out = nullptr); +#endif // !defined(__ANDROID__) || defined(DOXYGEN) + + /// The user’s consent status. This value defaults to kConsentStatusUnknown + /// until RequestConsentInfoUpdate() is called, and defaults to the previous + /// session’s value until RequestConsentInfoUpdate() completes. + ConsentStatus GetConsentStatus(); + + /// Requests consent information update. Must be called in every app session + /// before checking the user’s consent status or loading a consent form. After + /// calling this method, GetConsentStatus() will be updated immediately to + /// hold the consent state from the previous app session, if one + /// exists. GetConsentStatus() may be updated again immediately before the + /// returned future is completed. + Future RequestConsentInfoUpdate(const ConsentRequestParameters& params); + + /// Get the Future from the most recent call to RequestConsentInfoUpdate(). + Future RequestConsentInfoUpdateLastResult(); + + /// Consent form status. This value defaults to kConsentFormStatusUnknown and + /// requires a call to RequestConsentInfoUpdate() to update. + ConsentFormStatus GetConsentFormStatus(); + + /// Loads a consent form. Returns an error if the consent form is unavailable + /// or cannot be loaded. + Future LoadConsentForm(); + + /// Get the Future from the most recent call to LoadConsentForm(). + Future LoadConsentFormLastResult(); + + /// Presents the full screen consent form using the given FormParent, which is + /// defined as an Activity on Android and a UIViewController on iOS. The form + /// will be dismissed and the Future will be completed after the user selects + /// an option. + /// + /// GetConsentStatus() is updated when the returned Future is completed. + /// + /// @note You must call LoadConsentForm() and wait for it to complete before + /// calling this method. + Future ShowConsentForm(FormParent parent); + + /// Get the Future from the most recent call to ShowConsentForm(). + Future ShowConsentFormLastResult(); + + /// Loads a consent form and immediately presents it using the given + /// FormParent, if ConsentStatus is kConsentStatusRequired. The FormParent is + /// defined as an Activity on Android and a UIViewController on iOS. The + /// Future will be completed successfully after the user selects an option + /// (and the form is dismissed), or if the form is not required. The Future + /// will be completed with an error if the form fails to load or show. + /// + /// GetConsentStatus() will be updated prior to the Future being completed. + Future LoadAndShowConsentFormIfRequired(FormParent parent); + + /// Get the Future from the most recent call to + /// LoadAndShowConsentFormIfRequired(). + Future LoadAndShowConsentFormIfRequiredLastResult(); + + /// Check whether the privacy options form needs to be displayed. + /// This is updated by RequestConsentInfoUpdate(). + PrivacyOptionsRequirementStatus GetPrivacyOptionsRequirementStatus(); + + /// If GetPrivacyOptionsRequirementStatus() is + /// kPrivacyOptionsRequirementStatusRequired, presents a privacy options form + /// from the provided FormParent, which is defined as an Activity on Android + /// and a UIViewController on iOS. + /// + /// This method should only be called in response to a user input to request a + /// privacy options form to be shown. + /// + /// The future completes when the user selects an option and dismisses the + /// form or is completed immediately with an error code if no form is + /// presented. The privacy options form is preloaded by the SDK automatically + /// when a form becomes available. If no form has been preloaded, the SDK will + /// try to load one asynchronously. + Future ShowPrivacyOptionsForm(FormParent parent); + + /// Get the Future from the most recent call to ShowPrivacyOptionsForm(). + Future ShowPrivacyOptionsFormLastResult(); + + /// Indicates whether the app has completed the necessary steps for gathering + /// updated user consent. Returns true if RequestConsentInfoUpdate() has been + /// called and GetConsentStatus returns either kConsentStatusNotRequired or + /// kConsentStatusObtained. + bool CanRequestAds(); + + /// Clears all consent state from persistent storage. This can be used in + /// development to simulate a new installation. + void Reset(); + + private: + ConsentInfo(); +#if FIREBASE_PLATFORM_ANDROID + // TODO(b/291622888) Implement Android-specific Initialize.. + InitResult Initialize(/* JNIEnv* jni_env, jobject activity */); +#else + InitResult Initialize(); +#endif // FIREBASE_PLATFORM_ANDROID + void Terminate(); + + static ConsentInfo* s_instance_; + +#if FIREBASE_PLATFORM_ANDROID + JavaVM* java_vm() { return java_vm_; } + JavaVM* java_vm_; +#endif + + // An internal, platform-specific implementation object that this class uses + // to interact with the User Messaging Platform SDKs for iOS and Android. + internal::ConsentInfoInternal* internal_; +}; + +} // namespace ump +} // namespace gma +} // namespace firebase + +#endif // FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_CONSENT_INFO_H_ diff --git a/gma/src/include/firebase/gma/ump/types.h b/gma/src/include/firebase/gma/ump/types.h new file mode 100644 index 0000000000..bf380d16be --- /dev/null +++ b/gma/src/include/firebase/gma/ump/types.h @@ -0,0 +1,179 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_TYPES_H_ +#define FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_TYPES_H_ + +#include +#include +#include + +#include "firebase/internal/platform.h" + +#if FIREBASE_PLATFORM_ANDROID +#include +#elif FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS +extern "C" { +#include +} // extern "C" +#endif // FIREBASE_PLATFORM_ANDROID, FIREBASE_PLATFORM_IOS, + // FIREBASE_PLATFORM_TVOS + +namespace firebase { +namespace gma { +namespace ump { + +/// Debug values for testing geography. +enum ConsentDebugGeography { + /// Disable geography debugging. + kConsentDebugGeographyDisabled = 0, + /// Geography appears as in EEA (European Economic Area) for debug devices. + kConsentDebugGeographyEEA, + /// Geography appears as not in EEA for debug devices. + kConsentDebugGeographyNonEEA +}; + +/// Debug settings for `ConsentInfo::RequestConsentInfoUpdate()`. These let you +/// force a speific geographic location. Be sure to include debug device IDs to +/// enable this on hardware. Debug features are always enabled for simulators. +struct ConsentDebugSettings { + /// Create a default debug setting, with debugging disabled. + ConsentDebugSettings() : debug_geography(kConsentDebugGeographyDisabled) {} + + /// The geographical location, for debugging. + ConsentDebugGeography debug_geography; + /// A list of all device IDs that are allowed to use debug settings. You can + /// obtain this from the device log after running with debug settings enabled. + std::vector debug_device_ids; +}; + +/// Parameters for the `ConsentInfo::RequestConsentInfoUpdate()` operation. +struct ConsentRequestParameters { + ConsentRequestParameters() : tag_for_under_age_of_consent(false) {} + + /// Debug settings for the consent request. + ConsentDebugSettings debug_settings; + + /// Whether the user is under the age of consent. + bool tag_for_under_age_of_consent; +}; + +/// This is a platform specific datatype that is required to show a consent form +/// on screen. +/// +/// The following defines the datatype on each platform: +///
    +///
  • Android: A `jobject` which references an Android Activity.
  • +///
  • iOS: An `id` which references an iOS UIViewController.
  • +///
+#if FIREBASE_PLATFORM_ANDROID +/// An Android Activity from Java. +typedef jobject FormParent; +#elif FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS +/// A pointer to an iOS UIViewController. +typedef id FormParent; +#else +/// A void pointer for stub classes. +typedef void* FormParent; +#endif // FIREBASE_PLATFORM_ANDROID, FIREBASE_PLATFORM_IOS, + // FIREBASE_PLATFORM_TVOS + +/// Consent status values. +enum ConsentStatus { + /// Unknown status, e.g. prior to calling Request, or if the request fails. + kConsentStatusUnknown = 0, + /// Consent is required, but not obtained + kConsentStatusRequired, + /// Consent is not required + kConsentStatusNotRequired, + /// Consent was required, and has been obtained + kConsentStatusObtained +}; + +/// Errors that can occur during a RequestConsentInfoUpdate operation. +enum ConsentRequestError { + /// The operation succeeded. + kConsentRequestSuccess = 0, + /// Invalid GMA App ID specified in AndroidManifest.xml or Info.plist. + kConsentRequestErrorInvalidAppId, + /// A network error occurred. + kConsentRequestErrorNetwork, + /// An internal error occurred. + kConsentRequestErrorInternal, + /// A misconfiguration exists in the UI. + kConsentRequestErrorCodeMisconfiguration, + /// An unknown error occurred. + kConsentRequestErrorUnknown, + /// An invalid operation occurred. Try again. + kConsentRequestErrorInvalidOperation, + /// The operation is already in progress. Use + /// `ConsentInfo::RequestConsentInfoUpdateLastResult()` + /// to get the status. + kConsentRequestErrorOperationInProgress +}; + +/// Status of the consent form, whether it is available to show or not. +enum ConsentFormStatus { + /// Status is unknown. Call `ConsentInfo::RequestConsentInfoUpdate()` to + /// update this. + kConsentFormStatusUnknown = 0, + /// The consent form is unavailable. Call `ConsentInfo::LoadConsentForm()` to + /// load it. + kConsentFormStatusUnavailable, + /// The consent form is available. Call `ConsentInfo::ShowConsentForm()` to + /// display it. + kConsentFormStatusAvailable, +}; + +/// Errors when loading or showing the consent form. +enum ConsentFormError { + /// The operation succeeded. + kConsentFormSuccess = 0, + /// The load request timed out. Try again. + kConsentFormErrorTimeout, + /// An internal error occurred. + kConsentFormErrorInternal, + /// An unknown error occurred. + kConsentFormErrorUnknown, + /// The form is unavailable. + kConsentFormErrorUnavailable, + /// This form was already used. + kConsentFormErrorCodeAlreadyUsed, + /// An invalid operation occurred. Try again. + kConsentFormErrorInvalidOperation, + /// The operation is already in progress. Call + /// `ConsentInfo::LoadConsentFormLastResult()` or + /// `ConsentInfo::ShowConsentFormLastResult()` to get the status. + kConsentFormErrorOperationInProgress +}; + +/// Whether the privacy options need to be displayed. +enum PrivacyOptionsRequirementStatus { + /// Privacy options requirement status is unknown. Call + /// `ConsentInfo::RequestConsentInfoUpdate()` to update. + kPrivacyOptionsRequirementStatusUnknown = 0, + /// Privacy options are not required to be shown. + kPrivacyOptionsRequirementStatusNotRequired, + /// Privacy options must be shown. Call + /// `ConsentInfo::ShowPrivacyOptionsForm()` to fulfil this requirement. + kPrivacyOptionsRequirementStatusRequired +}; + +} // namespace ump +} // namespace gma +} // namespace firebase + +#endif // FIREBASE_GMA_SRC_INCLUDE_FIREBASE_GMA_UMP_TYPES_H_ diff --git a/gma/src/stub/ump/consent_info_internal_stub.cc b/gma/src/stub/ump/consent_info_internal_stub.cc new file mode 100644 index 0000000000..8f4d033896 --- /dev/null +++ b/gma/src/stub/ump/consent_info_internal_stub.cc @@ -0,0 +1,164 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gma/src/stub/ump/consent_info_internal_stub.h" + +#include "app/src/thread.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +// This explicitly implements the constructor for the outer class, +// ConsentInfoInternal. +ConsentInfoInternal* ConsentInfoInternal::CreateInstance() { + return new ConsentInfoInternalStub(); +} + +ConsentInfoInternalStub::ConsentInfoInternalStub() + : consent_status_(kConsentStatusUnknown), + consent_form_status_(kConsentFormStatusUnknown), + privacy_options_requirement_status_( + kPrivacyOptionsRequirementStatusUnknown), + under_age_of_consent_(false), + debug_geo_(kConsentDebugGeographyDisabled) {} + +ConsentInfoInternalStub::~ConsentInfoInternalStub() {} + +Future ConsentInfoInternalStub::RequestConsentInfoUpdate( + const ConsentRequestParameters& params) { + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnRequestConsentInfoUpdate); + + // See the header file for an explanation of these default settings. + ConsentStatus new_consent_status = kConsentStatusObtained; + PrivacyOptionsRequirementStatus new_privacy_req = + kPrivacyOptionsRequirementStatusNotRequired; + // Simulate consent status based on debug geo. + if (params.debug_settings.debug_geography == kConsentDebugGeographyEEA) { + new_consent_status = kConsentStatusRequired; + } else if (params.debug_settings.debug_geography == + kConsentDebugGeographyNonEEA) { + new_consent_status = kConsentStatusNotRequired; + } + + consent_status_ = new_consent_status; + under_age_of_consent_ = params.tag_for_under_age_of_consent; + consent_form_status_ = under_age_of_consent_ ? kConsentFormStatusUnavailable + : kConsentFormStatusAvailable; + debug_geo_ = params.debug_settings.debug_geography; + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusNotRequired; + + CompleteFuture(handle, kConsentRequestSuccess); + return MakeFuture(futures(), handle); +} + +Future ConsentInfoInternalStub::LoadConsentForm() { + SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadConsentForm); + + if (consent_form_status_ != kConsentFormStatusAvailable) { + CompleteFuture(handle, kConsentFormErrorUnavailable); + return MakeFuture(futures(), handle); + } + CompleteFuture(handle, kConsentFormSuccess); + return MakeFuture(futures(), handle); +} + +Future ConsentInfoInternalStub::ShowConsentForm(FormParent parent) { + SafeFutureHandle handle = CreateFuture(kConsentInfoFnShowConsentForm); + + consent_status_ = kConsentStatusObtained; + + if (debug_geo_ == kConsentDebugGeographyEEA) { + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusRequired; + } else if (debug_geo_ == kConsentDebugGeographyNonEEA) { + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusNotRequired; + } else { // no debug option + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusNotRequired; + } + + CompleteFuture(handle, kConsentRequestSuccess); + return MakeFuture(futures(), handle); +} + +Future ConsentInfoInternalStub::LoadAndShowConsentFormIfRequired( + FormParent parent) { + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnLoadAndShowConsentFormIfRequired); + + if (consent_form_status_ != kConsentFormStatusAvailable) { + CompleteFuture(handle, kConsentFormErrorUnavailable); + return MakeFuture(futures(), handle); + } + + if (consent_status_ == kConsentStatusRequired) { + consent_status_ = kConsentStatusObtained; + if (debug_geo_ == kConsentDebugGeographyEEA) { + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusRequired; + } else if (debug_geo_ == kConsentDebugGeographyNonEEA) { + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusNotRequired; + } else { // no debug option + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusNotRequired; + } + } + CompleteFuture(handle, kConsentRequestSuccess); + return MakeFuture(futures(), handle); +} + +PrivacyOptionsRequirementStatus +ConsentInfoInternalStub::GetPrivacyOptionsRequirementStatus() { + return privacy_options_requirement_status_; +} + +Future ConsentInfoInternalStub::ShowPrivacyOptionsForm( + FormParent parent) { + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnShowPrivacyOptionsForm); + + if (consent_status_ == kConsentStatusObtained) { + consent_status_ = kConsentStatusRequired; + privacy_options_requirement_status_ = + kPrivacyOptionsRequirementStatusNotRequired; + } + CompleteFuture(handle, kConsentRequestSuccess); + return MakeFuture(futures(), handle); +} + +bool ConsentInfoInternalStub::CanRequestAds() { + bool consent_status_ok = (consent_status_ == kConsentStatusObtained || + consent_status_ == kConsentStatusNotRequired); + bool privacy_options_ok = (privacy_options_requirement_status_ != + kPrivacyOptionsRequirementStatusUnknown); + return consent_status_ok && privacy_options_ok; +} + +void ConsentInfoInternalStub::Reset() { + consent_status_ = kConsentStatusUnknown; + consent_form_status_ = kConsentFormStatusUnknown; +} + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase diff --git a/gma/src/stub/ump/consent_info_internal_stub.h b/gma/src/stub/ump/consent_info_internal_stub.h new file mode 100644 index 0000000000..23d44dfbaa --- /dev/null +++ b/gma/src/stub/ump/consent_info_internal_stub.h @@ -0,0 +1,86 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_GMA_SRC_STUB_UMP_CONSENT_INFO_INTERNAL_STUB_H_ +#define FIREBASE_GMA_SRC_STUB_UMP_CONSENT_INFO_INTERNAL_STUB_H_ + +#include "gma/src/common/ump/consent_info_internal.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +// The stub interface implements a few specific workflows, for testing: +// +// Before requesting: consent and privacy options requirement will be Unknown. +// +// After requesting: +// +// If debug_geography == EEA, consent will be Required, privacy options +// NotRequired. After calling ShowConsentForm() or +// LoadAndShowConsentFormIfRequired(), it will change to change to Obtained and +// privacy options will become Required, and when the privacy options form is +// shown, consent will go back to Required. +// +// If debug_geography == NonEEA, consent will be NotRequired. No privacy options +// form is required. +// +// If debug_geography == Disabled, consent will be Obtained and privacy options +// will be NotRequired. +// +// If tag_for_under_age_of_consent = true, LoadConsentForm and +// LoadAndShowConsentFormIfRequired will fail with kConsentFormErrorUnavailable. +// +// CanRequestAds returns true if consent is NotRequired or Obtained. +class ConsentInfoInternalStub : public ConsentInfoInternal { + public: + ConsentInfoInternalStub(); + ~ConsentInfoInternalStub() override; + + ConsentStatus GetConsentStatus() const override { return consent_status_; } + ConsentFormStatus GetConsentFormStatus() const override { + return consent_form_status_; + } + + Future RequestConsentInfoUpdate( + const ConsentRequestParameters& params) override; + Future LoadConsentForm() override; + Future ShowConsentForm(FormParent parent) override; + + Future LoadAndShowConsentFormIfRequired(FormParent parent) override; + + PrivacyOptionsRequirementStatus GetPrivacyOptionsRequirementStatus() override; + Future ShowPrivacyOptionsForm(FormParent parent) override; + + bool CanRequestAds() override; + + void Reset() override; + + private: + ConsentStatus consent_status_; + ConsentFormStatus consent_form_status_; + PrivacyOptionsRequirementStatus privacy_options_requirement_status_; + ConsentDebugGeography debug_geo_; + bool under_age_of_consent_; +}; + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase + +#endif // FIREBASE_GMA_SRC_STUB_UMP_CONSENT_INFO_INTERNAL_STUB_H_ From 64369f403b17f5d030b837eed95ad653c28ec084 Mon Sep 17 00:00:00 2001 From: "firebase-workflow-trigger[bot]" <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 21:03:26 +0000 Subject: [PATCH 03/13] Automatic merge of main into feature_branch/ump-sdk - Aug 07, 2023 (#1419) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae98f767c45f0a402fc9492bf6cc2ce55885. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d48d28c52352f5e40640831934ff6921e4e. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Jon Simantov Co-authored-by: almostmatt@google.com * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang --------- Co-authored-by: Jon Simantov Co-authored-by: Tom Andersen Co-authored-by: Matthew Hyndman Co-authored-by: a-maurice Co-authored-by: Saleem Abdulrasool Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Cynthia J Co-authored-by: Cynthia Jiang --- .github/workflows/cpp-packaging.yml | 2 +- .github/workflows/update-dependencies.yml | 2 +- .gitignore | 2 + Android/firebase_dependencies.gradle | 2 +- analytics/integration_test/Podfile | 4 +- analytics/ios_headers/FIREventNames.h | 2 +- analytics/ios_headers/FIRParameterNames.h | 2 +- analytics/ios_headers/FIRUserPropertyNames.h | 2 +- app/app_resources/build.gradle | 2 +- app/google_api_resources/build.gradle | 2 +- app/integration_test/Podfile | 2 +- app/invites_resources/build.gradle | 2 +- app/src/include/firebase/app.h | 3 - app/src/tests/runner/ios/Info.plist | 4 +- app_check/app_check_resources/build.gradle | 2 +- app_check/integration_test/Podfile | 20 +- auth/auth_resources/build.gradle | 2 +- auth/integration_test/Podfile | 4 +- auth/src/android/auth_android.cc | 30 + auth/src/desktop/auth_desktop.h | 1 + auth/src/desktop/rpcs/auth_request.cc | 38 + auth/src/desktop/rpcs/auth_request.h | 18 + .../desktop/rpcs/create_auth_uri_request.cc | 9 +- .../desktop/rpcs/delete_account_request.cc | 9 +- .../desktop/rpcs/get_account_info_request.cc | 9 +- .../rpcs/get_oob_confirmation_code_request.cc | 9 +- .../desktop/rpcs/reset_password_request.cc | 9 +- .../desktop/rpcs/set_account_info_request.cc | 9 +- .../desktop/rpcs/sign_up_new_user_request.cc | 9 +- .../desktop/rpcs/verify_assertion_request.cc | 9 +- .../rpcs/verify_custom_token_request.cc | 9 +- .../desktop/rpcs/verify_password_request.cc | 9 +- auth/src/include/firebase/auth.h | 1 + auth/src/ios/auth_ios.mm | 23 + build_scripts/ios/Info.plist | 8 +- build_scripts/ios/build.sh | 24 +- build_scripts/tvos/Info_ios_and_tvos.plist | 6 +- build_scripts/tvos/build.sh | 2 +- cmake/external/firestore.cmake | 2 +- cmake/external_rules.cmake | 4 +- database/database_resources/build.gradle | 2 +- database/integration_test/Podfile | 8 +- dynamic_links/integration_test/Podfile | 2 +- firestore/firestore_resources/build.gradle | 2 +- firestore/integration_test/Podfile | 8 +- firestore/integration_test_internal/Podfile | 8 +- functions/integration_test/Podfile | 8 +- gma/gma_resources/build.gradle | 2 +- gma/integration_test/Podfile | 4 +- gma/integration_test/src/integration_test.cc | 40 +- gma/src/android/gma_android.cc | 13 +- installations/integration_test/Podfile | 4 +- ios_pod/Podfile | 28 +- .../FirebaseAnalyticsSwift-Swift.h | 523 ++++-- .../FirebaseCoreInternal-Swift.h | 581 +++++-- .../FirebaseDatabaseSwift-Swift.h | 529 ++++-- .../FirebaseFirestoreSwift-Swift.h | 553 ++++-- .../swift_headers/FirebaseFunctions-Swift.h | 930 +++++++--- .../FirebaseInAppMessagingSwift-Swift.h | 524 ++++-- .../FirebaseMLModelDownloader-Swift.h | 527 ++++-- .../FirebaseRemoteConfigSwift-Swift.h | 529 ++++-- .../swift_headers/FirebaseSharedSwift-Swift.h | 523 ++++-- ios_pod/swift_headers/FirebaseStorage-Swift.h | 1505 +++++++++++++---- ios_pod/swift_headers/SwiftProtobuf-Swift.h | 523 ++++-- messaging/integration_test/Podfile | 4 +- messaging/messaging_java/build.gradle | 2 +- .../Android/firebase_dependencies.gradle | 2 +- release_build_files/readme.md | 80 +- remote_config/integration_test/Podfile | 4 +- .../remote_config_resources/build.gradle | 2 +- scripts/gha/build_ios_tvos.py | 34 +- .../integration_testing/ftl_gha_validator.py | 19 +- .../gameloop_apple/gameloop/Info.plist | 2 +- scripts/gha/print_matrix_configuration.py | 2 +- .../FirebaseCppUITestApp/Info.plist | 2 +- storage/integration_test/Podfile | 8 +- storage/storage_resources/build.gradle | 2 +- 77 files changed, 5992 insertions(+), 1855 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index acd7069d5a..5d40d5e33b 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -5,7 +5,7 @@ on: # Run a full packaging step any time a new branch is merged into main. - main schedule: - - cron: "0 9 * * *" # 9am UTC = 1am PST / 2am PDT + - cron: "0 8 * * *" # 8am UTC = 12am PST / 1am PDT workflow_dispatch: inputs: preserveIntermediateArtifacts: diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 9ce467996d..f40aa5743d 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -142,7 +142,7 @@ jobs: cd - # Copy all *-Swift.h header files into ios_pod/swift_headers/ echo "Copying headers..." - find "${ziptmp}" -name '*-Swift.h' -print0 | xargs -0 -n 1 -J REPLACETEXT cp -f REPLACETEXT ios_pod/swift_headers/ + find "${ziptmp}" -name '*-Swift.h' -path '*ios*arm64*x86_64*simulator*' -print0 | xargs -0 -n 1 -J REPLACETEXT cp -f REPLACETEXT ios_pod/swift_headers/ copyright_line="// Copyright $(date +%Y) Google LLC" # Add a note to each file about its source. for ios_header in ios_pod/swift_headers/*.h; do diff --git a/.gitignore b/.gitignore index be6008e2cc..d86b432e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,8 @@ gcs_key_file.json *_build/ cmake-build-*/ testing/test_framework/external/ +CMakeFiles/ +CMakeCache.txt # XCode user specific folders **/xcuserdata/ diff --git a/Android/firebase_dependencies.gradle b/Android/firebase_dependencies.gradle index a2f751f0a2..2481bd4c38 100644 --- a/Android/firebase_dependencies.gradle +++ b/Android/firebase_dependencies.gradle @@ -158,7 +158,7 @@ project.afterEvaluate { // Add the bill-of-materials project.dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') } for (String lib : firebaseCpp.dependencies.libSet) { // Generate and include the proguard file diff --git a/analytics/integration_test/Podfile b/analytics/integration_test/Podfile index 31bec9d850..2bd2ef9ca3 100644 --- a/analytics/integration_test/Podfile +++ b/analytics/integration_test/Podfile @@ -5,12 +5,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Analytics', '10.12.0' + pod 'Firebase/Analytics', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Analytics', '10.12.0' + pod 'Firebase/Analytics', '10.13.0' end post_install do |installer| diff --git a/analytics/ios_headers/FIREventNames.h b/analytics/ios_headers/FIREventNames.h index 9d677883f0..317bfab42d 100644 --- a/analytics/ios_headers/FIREventNames.h +++ b/analytics/ios_headers/FIREventNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.12.0. +// Copied from Firebase Analytics iOS SDK 10.13.0. /// @file FIREventNames.h /// diff --git a/analytics/ios_headers/FIRParameterNames.h b/analytics/ios_headers/FIRParameterNames.h index 65f7e3ea7c..c6664d14f7 100644 --- a/analytics/ios_headers/FIRParameterNames.h +++ b/analytics/ios_headers/FIRParameterNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.12.0. +// Copied from Firebase Analytics iOS SDK 10.13.0. /// @file FIRParameterNames.h /// diff --git a/analytics/ios_headers/FIRUserPropertyNames.h b/analytics/ios_headers/FIRUserPropertyNames.h index 935289b468..00851e1395 100644 --- a/analytics/ios_headers/FIRUserPropertyNames.h +++ b/analytics/ios_headers/FIRUserPropertyNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.12.0. +// Copied from Firebase Analytics iOS SDK 10.13.0. /// @file FIRUserPropertyNames.h /// diff --git a/app/app_resources/build.gradle b/app/app_resources/build.gradle index f0d956e39c..6fecf213be 100644 --- a/app/app_resources/build.gradle +++ b/app/app_resources/build.gradle @@ -50,7 +50,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' } diff --git a/app/google_api_resources/build.gradle b/app/google_api_resources/build.gradle index 721547e028..f299d7ac6a 100644 --- a/app/google_api_resources/build.gradle +++ b/app/google_api_resources/build.gradle @@ -53,7 +53,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-base:18.2.0' implementation project(':app:app_resources') diff --git a/app/integration_test/Podfile b/app/integration_test/Podfile index 68829105b6..d0c27722ff 100644 --- a/app/integration_test/Podfile +++ b/app/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/Analytics', '10.12.0' + pod 'Firebase/Analytics', '10.13.0' end post_install do |installer| diff --git a/app/invites_resources/build.gradle b/app/invites_resources/build.gradle index 3e906204d9..90e7eaa71e 100644 --- a/app/invites_resources/build.gradle +++ b/app/invites_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-dynamic-links' implementation project(':app:app_resources') diff --git a/app/src/include/firebase/app.h b/app/src/include/firebase/app.h index f32f8bf33f..03f0ad2dde 100644 --- a/app/src/include/firebase/app.h +++ b/app/src/include/firebase/app.h @@ -571,11 +571,8 @@ class App { /// Get the App with the given name, or nullptr if none have been created. static App* GetInstance(const char* name); -#if !defined(DOXYGEN) - // Hidden from the public documentation for now /// Get all the apps, including the default one. static std::vector GetApps(); -#endif // !defined(DOXYGEN) #ifndef SWIG // diff --git a/app/src/tests/runner/ios/Info.plist b/app/src/tests/runner/ios/Info.plist index 7b5e300a2b..a71b32aedb 100644 --- a/app/src/tests/runner/ios/Info.plist +++ b/app/src/tests/runner/ios/Info.plist @@ -30,7 +30,7 @@ Main UIRequiredDeviceCapabilities - armv7 + arm64 UISupportedInterfaceOrientations @@ -46,4 +46,4 @@ UIInterfaceOrientationLandscapeRight - \ No newline at end of file + diff --git a/app_check/app_check_resources/build.gradle b/app_check/app_check_resources/build.gradle index 29f4663f6e..56fd0ab30a 100644 --- a/app_check/app_check_resources/build.gradle +++ b/app_check/app_check_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-appcheck' } diff --git a/app_check/integration_test/Podfile b/app_check/integration_test/Podfile index 23b6635378..a809bb6f62 100644 --- a/app_check/integration_test/Podfile +++ b/app_check/integration_test/Podfile @@ -4,20 +4,20 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/AppCheck', '10.12.0' - pod 'Firebase/Database', '10.12.0' - pod 'Firebase/Auth', '10.12.0' - pod 'Firebase/Storage', '10.12.0' - pod 'Firebase/Functions', '10.12.0' + pod 'Firebase/AppCheck', '10.13.0' + pod 'Firebase/Database', '10.13.0' + pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Storage', '10.13.0' + pod 'Firebase/Functions', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/AppCheck', '10.12.0' - pod 'Firebase/Database', '10.12.0' - pod 'Firebase/Auth', '10.12.0' - pod 'Firebase/Storage', '10.12.0' - pod 'Firebase/Functions', '10.12.0' + pod 'Firebase/AppCheck', '10.13.0' + pod 'Firebase/Database', '10.13.0' + pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Storage', '10.13.0' + pod 'Firebase/Functions', '10.13.0' end post_install do |installer| diff --git a/auth/auth_resources/build.gradle b/auth/auth_resources/build.gradle index 2a39b9b0a1..1f5801963e 100644 --- a/auth/auth_resources/build.gradle +++ b/auth/auth_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-auth' implementation project(':app:app_resources') diff --git a/auth/integration_test/Podfile b/auth/integration_test/Podfile index 30d8c003c4..0a7cf70936 100644 --- a/auth/integration_test/Podfile +++ b/auth/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Auth', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Auth', '10.13.0' end post_install do |installer| diff --git a/auth/src/android/auth_android.cc b/auth/src/android/auth_android.cc index 7b588dbb9b..2f8ccda645 100644 --- a/auth/src/android/auth_android.cc +++ b/auth/src/android/auth_android.cc @@ -17,6 +17,8 @@ #include #include +#include + #include "app/src/assert.h" #include "app/src/embedded_file.h" #include "app/src/include/firebase/internal/mutex.h" @@ -53,6 +55,7 @@ using util::JniStringToString; X(RemoveIdTokenListener, "removeIdTokenListener", \ "(Lcom/google/firebase/auth/FirebaseAuth$IdTokenListener;)V"), \ X(SignOut, "signOut", "()V"), \ + X(UseEmulator, "useEmulator", "(Ljava/lang/String;I)V"), \ X(FetchSignInMethodsForEmail, "fetchSignInMethodsForEmail", \ "(Ljava/lang/String;)" \ "Lcom/google/android/gms/tasks/Task;"), \ @@ -185,6 +188,31 @@ void UpdateCurrentUser(AuthData* auth_data) { } } +const char* const kEmulatorLocalHost = "10.0.2.2"; +const char* const kEmulatorPort = "9099"; +void CheckEmulator(AuthData* auth_data) { + JNIEnv* env = Env(auth_data); + + // Use emulator as long as this env variable is set, regardless its value. + if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { + LogDebug("Using Auth Prod for testing."); + return; + } + + // Use AUTH_EMULATOR_PORT if it is set to non empty string, + // otherwise use the default port. + uint32_t port = std::stoi(kEmulatorPort); + if (std::getenv("AUTH_EMULATOR_PORT") != nullptr) { + port = std::stoi(std::getenv("AUTH_EMULATOR_PORT")); + } + + jstring j_host = env->NewStringUTF(kEmulatorLocalHost); + env->CallVoidMethod(AuthImpl(auth_data), + auth::GetMethodId(auth::kUseEmulator), j_host, port); + env->DeleteLocalRef(j_host); + firebase::util::CheckAndClearJniExceptions(env); +} + // Release cached Java classes. static void ReleaseClasses(JNIEnv* env) { ReleaseAuthClasses(env); @@ -269,6 +297,8 @@ void Auth::InitPlatformAuth(AuthData* auth_data) { // Ensure our User is in-line with underlying API's user. // It's possible for a user to already be logged-in on start-up. UpdateCurrentUser(auth_data); + + CheckEmulator(auth_data); } void Auth::DestroyPlatformAuth(AuthData* auth_data) { diff --git a/auth/src/desktop/auth_desktop.h b/auth/src/desktop/auth_desktop.h index 6210d47712..2d407cab16 100644 --- a/auth/src/desktop/auth_desktop.h +++ b/auth/src/desktop/auth_desktop.h @@ -16,6 +16,7 @@ #define FIREBASE_AUTH_SRC_DESKTOP_AUTH_DESKTOP_H_ #include +#include #include "app/rest/request.h" #include "app/src/scheduler.h" diff --git a/auth/src/desktop/rpcs/auth_request.cc b/auth/src/desktop/rpcs/auth_request.cc index 4db7ac46ae..c9af69f789 100644 --- a/auth/src/desktop/rpcs/auth_request.cc +++ b/auth/src/desktop/rpcs/auth_request.cc @@ -23,6 +23,7 @@ #include "app/src/heartbeat/heartbeat_controller_desktop.h" #include "app/src/include/firebase/app.h" #include "app/src/include/firebase/internal/mutex.h" +#include "firebase/log.h" namespace firebase { namespace auth { @@ -37,6 +38,8 @@ AuthRequest::AuthRequest(::firebase::App& app, const char* schema, // dependencies upon other parts of this library. This complication is due to // the way the tests are currently configured where each library has minimal // dependencies. + + CheckEmulator(); static std::string auth_user_agent; // NOLINT static std::string extended_auth_user_agent; // NOLINT static Mutex* user_agent_mutex = new Mutex(); @@ -77,5 +80,40 @@ AuthRequest::AuthRequest(::firebase::App& app, const char* schema, } } +std::string AuthRequest::GetUrl() { + if (emulator_url.empty()) { + std::string url(kHttps); + url += kServerURL; + return url; + } else { + std::string url(kHttp); + url += emulator_url; + url += kServerURL; + return url; + } +} + +void AuthRequest::CheckEmulator() { + if (!emulator_url.empty()) { + LogDebug("Emulator Url already set: %s", emulator_url.c_str()); + return; + } + // Use emulator as long as this env variable is set, regardless its value. + if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { + LogDebug("Using Auth Prod for testing."); + return; + } + + emulator_url.append(kEmulatorLocalHost); + emulator_url.append(":"); + // Use AUTH_EMULATOR_PORT if it is set to non empty string, + // otherwise use the default port. + if (std::getenv("AUTH_EMULATOR_PORT") == nullptr) { + emulator_url.append(kEmulatorPort); + } else { + emulator_url.append(std::getenv("AUTH_EMULATOR_PORT")); + } +} + } // namespace auth } // namespace firebase diff --git a/auth/src/desktop/rpcs/auth_request.h b/auth/src/desktop/rpcs/auth_request.h index 670571e5af..88835e946c 100644 --- a/auth/src/desktop/rpcs/auth_request.h +++ b/auth/src/desktop/rpcs/auth_request.h @@ -17,6 +17,8 @@ #ifndef FIREBASE_AUTH_SRC_DESKTOP_RPCS_AUTH_REQUEST_H_ #define FIREBASE_AUTH_SRC_DESKTOP_RPCS_AUTH_REQUEST_H_ +#include + #include "app/rest/request_json.h" #include "app/src/include/firebase/app.h" #include "auth/request_generated.h" @@ -28,6 +30,16 @@ namespace auth { // Key name for header when sending language code data. extern const char* kHeaderFirebaseLocale; +const char* const kHttps = "https://"; + +const char* const kHttp = "http://"; + +const char* const kServerURL = + "www.googleapis.com/identitytoolkit/v3/relyingparty/"; + +const char* const kEmulatorLocalHost = "localhost"; +const char* const kEmulatorPort = "9099"; + class AuthRequest : public firebase::rest::RequestJson { public: @@ -39,6 +51,12 @@ class AuthRequest bool deliver_heartbeat) : AuthRequest(app, reinterpret_cast(schema), deliver_heartbeat) {} + + std::string GetUrl(); + + private: + void CheckEmulator(); + std::string emulator_url; }; } // namespace auth diff --git a/auth/src/desktop/rpcs/create_auth_uri_request.cc b/auth/src/desktop/rpcs/create_auth_uri_request.cc index 04ee9efc2e..e0de666b47 100644 --- a/auth/src/desktop/rpcs/create_auth_uri_request.cc +++ b/auth/src/desktop/rpcs/create_auth_uri_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/create_auth_uri_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" #include "app/src/log.h" @@ -27,11 +29,8 @@ CreateAuthUriRequest::CreateAuthUriRequest(::firebase::App& app, : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "createAuthUri?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "createAuthUri?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/delete_account_request.cc b/auth/src/desktop/rpcs/delete_account_request.cc index efe3935738..359fb0d74c 100644 --- a/auth/src/desktop/rpcs/delete_account_request.cc +++ b/auth/src/desktop/rpcs/delete_account_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/delete_account_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" @@ -25,11 +27,8 @@ DeleteAccountRequest::DeleteAccountRequest(::firebase::App& app, : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "deleteAccount?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "deleteAccount?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/get_account_info_request.cc b/auth/src/desktop/rpcs/get_account_info_request.cc index 0dad730f18..e5f6cd4e78 100644 --- a/auth/src/desktop/rpcs/get_account_info_request.cc +++ b/auth/src/desktop/rpcs/get_account_info_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/get_account_info_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" @@ -39,11 +41,8 @@ GetAccountInfoRequest::GetAccountInfoRequest(::firebase::App& app, void GetAccountInfoRequest::SetUrl(const char* const api_key) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "getAccountInfo?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "getAccountInfo?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/get_oob_confirmation_code_request.cc b/auth/src/desktop/rpcs/get_oob_confirmation_code_request.cc index 3087837a6a..3a1805884c 100644 --- a/auth/src/desktop/rpcs/get_oob_confirmation_code_request.cc +++ b/auth/src/desktop/rpcs/get_oob_confirmation_code_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/get_oob_confirmation_code_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" @@ -25,11 +27,8 @@ GetOobConfirmationCodeRequest::GetOobConfirmationCodeRequest( : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "getOobConfirmationCode?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "getOobConfirmationCode?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/reset_password_request.cc b/auth/src/desktop/rpcs/reset_password_request.cc index b8fc65654e..a8c64d1ffe 100644 --- a/auth/src/desktop/rpcs/reset_password_request.cc +++ b/auth/src/desktop/rpcs/reset_password_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/reset_password_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" #include "app/src/log.h" @@ -28,11 +30,8 @@ ResetPasswordRequest::ResetPasswordRequest(::firebase::App& app, : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "resetPassword?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "resetPassword?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/set_account_info_request.cc b/auth/src/desktop/rpcs/set_account_info_request.cc index 48105661b1..618cbef902 100644 --- a/auth/src/desktop/rpcs/set_account_info_request.cc +++ b/auth/src/desktop/rpcs/set_account_info_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/set_account_info_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" @@ -25,11 +27,8 @@ SetAccountInfoRequest::SetAccountInfoRequest(::firebase::App& app, : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "setAccountInfo?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "setAccountInfo?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/sign_up_new_user_request.cc b/auth/src/desktop/rpcs/sign_up_new_user_request.cc index 5a098b4b10..bd8d5ed099 100644 --- a/auth/src/desktop/rpcs/sign_up_new_user_request.cc +++ b/auth/src/desktop/rpcs/sign_up_new_user_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/sign_up_new_user_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" @@ -53,11 +55,8 @@ SignUpNewUserRequest::SignUpNewUserRequest(::firebase::App& app, void SignUpNewUserRequest::SetUrl(const char* api_key) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "signupNewUser?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "signupNewUser?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/verify_assertion_request.cc b/auth/src/desktop/rpcs/verify_assertion_request.cc index 84dc5e4f70..cca72d5787 100644 --- a/auth/src/desktop/rpcs/verify_assertion_request.cc +++ b/auth/src/desktop/rpcs/verify_assertion_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/verify_assertion_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" @@ -26,11 +28,8 @@ VerifyAssertionRequest::VerifyAssertionRequest(::firebase::App& app, : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "verifyAssertion?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "verifyAssertion?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/verify_custom_token_request.cc b/auth/src/desktop/rpcs/verify_custom_token_request.cc index 83754219f0..af53e6f3f2 100644 --- a/auth/src/desktop/rpcs/verify_custom_token_request.cc +++ b/auth/src/desktop/rpcs/verify_custom_token_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/verify_custom_token_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" #include "app/src/log.h" @@ -27,11 +29,8 @@ VerifyCustomTokenRequest::VerifyCustomTokenRequest(::firebase::App& app, : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "verifyCustomToken?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "verifyCustomToken?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/desktop/rpcs/verify_password_request.cc b/auth/src/desktop/rpcs/verify_password_request.cc index bbfddfa338..db840685a3 100644 --- a/auth/src/desktop/rpcs/verify_password_request.cc +++ b/auth/src/desktop/rpcs/verify_password_request.cc @@ -14,6 +14,8 @@ #include "auth/src/desktop/rpcs/verify_password_request.h" +#include + #include "app/src/assert.h" #include "app/src/include/firebase/app.h" #include "app/src/log.h" @@ -28,11 +30,8 @@ VerifyPasswordRequest::VerifyPasswordRequest(::firebase::App& app, : AuthRequest(app, request_resource_data, true) { FIREBASE_ASSERT_RETURN_VOID(api_key); - const char api_host[] = - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/" - "verifyPassword?key="; - std::string url; - url.reserve(strlen(api_host) + strlen(api_key)); + const char api_host[] = "verifyPassword?key="; + std::string url = GetUrl(); url.append(api_host); url.append(api_key); set_url(url.c_str()); diff --git a/auth/src/include/firebase/auth.h b/auth/src/include/firebase/auth.h index bec3ce8ff8..f9c8bfbf36 100644 --- a/auth/src/include/firebase/auth.h +++ b/auth/src/include/firebase/auth.h @@ -17,6 +17,7 @@ #ifndef FIREBASE_AUTH_SRC_INCLUDE_FIREBASE_AUTH_H_ #define FIREBASE_AUTH_SRC_INCLUDE_FIREBASE_AUTH_H_ +#include #include #include "firebase/app.h" diff --git a/auth/src/ios/auth_ios.mm b/auth/src/ios/auth_ios.mm index b8b52573a1..e66af55dd6 100644 --- a/auth/src/ios/auth_ios.mm +++ b/auth/src/ios/auth_ios.mm @@ -41,6 +41,9 @@ @implementation FIRCPPAuthListenerHandle namespace firebase { namespace auth { +const char *const kEmulatorLocalHost = "localhost"; +const char *const kEmulatorPort = "9099"; + static const struct { int ios_error; AuthError cpp_error; @@ -154,6 +157,24 @@ void UpdateCurrentUser(AuthData *auth_data) { SetUserImpl(auth_data, user); } +void CheckEmulator(AuthData *auth_data) { + // Use emulator as long as this env variable is set, regardless its value. + if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { + LogDebug("Using Auth Prod for testing."); + return; + } + + // Use AUTH_EMULATOR_PORT if it is set to non empty string, + // otherwise use the default port. + uint32_t port = std::stoi(kEmulatorPort); + if (std::getenv("AUTH_EMULATOR_PORT") != nullptr) { + port = std::stoi(std::getenv("AUTH_EMULATOR_PORT")); + } + + NSUInteger ns_port = port; + [AuthImpl(auth_data) useEmulatorWithHost:@(kEmulatorLocalHost) port:ns_port]; +} + // Platform-specific method to initialize AuthData. void Auth::InitPlatformAuth(AuthData *auth_data) { FIRCPPAuthListenerHandle *listener_cpp_handle = [[FIRCPPAuthListenerHandle alloc] init]; @@ -191,6 +212,8 @@ void UpdateCurrentUser(AuthData *auth_data) { // It's possible for the user to be signed-in at creation, if the user signed-in during a // previous run, for example. UpdateCurrentUser(auth_data); + + CheckEmulator(auth_data); } // Platform-specific method to destroy the wrapped Auth class. diff --git a/build_scripts/ios/Info.plist b/build_scripts/ios/Info.plist index 92f3bb83db..ba4d5c05b0 100644 --- a/build_scripts/ios/Info.plist +++ b/build_scripts/ios/Info.plist @@ -6,13 +6,12 @@ LibraryIdentifier - ios-arm64_i386_x86_64-simulator + ios-arm64_x86_64-simulator LibraryPath LIBRARY_PATH SupportedArchitectures arm64 - i386 x86_64 SupportedPlatform @@ -22,13 +21,12 @@ LibraryIdentifier - ios-arm64_armv7 + ios-arm64 LibraryPath LIBRARY_PATH SupportedArchitectures arm64 - armv7 SupportedPlatform ios @@ -39,4 +37,4 @@ XCFrameworkFormatVersion 1.0 - \ No newline at end of file + diff --git a/build_scripts/ios/build.sh b/build_scripts/ios/build.sh index 95d134a23d..12ac66e93b 100755 --- a/build_scripts/ios/build.sh +++ b/build_scripts/ios/build.sh @@ -3,7 +3,7 @@ # Copyright 2020 Google LLC # # Script to build iOS XCFrameworks -# If built for all architectures (arm64 armv7 x86_64 i386), +# If built for all architectures (arm64 x86_64), # it will build universal framework as well # @@ -24,9 +24,9 @@ usage(){ set -e readonly SUPPORTED_PLATFORMS=(device simulator) -readonly SUPPORTED_ARCHITECTURES=(arm64 armv7 x86_64 i386) -readonly DEVICE_ARCHITECTURES=(arm64 armv7) -readonly SIMULATOR_ARCHITECTURES=(arm64 x86_64 i386) +readonly SUPPORTED_ARCHITECTURES=(arm64 x86_64) +readonly DEVICE_ARCHITECTURES=(arm64) +readonly SIMULATOR_ARCHITECTURES=(arm64 x86_64) readonly SUPPORTED_TARGETS=(firebase_analytics firebase_auth firebase_app_check firebase_database firebase_dynamic_links firebase_firestore firebase_functions firebase_gma firebase_installations firebase_messaging firebase_remote_config firebase_storage) # build default value @@ -198,7 +198,7 @@ if ${cmakeBuild}; then done done - # if we built for all architectures (arm64 armv7 x86_64 i386) + # if we built for all architectures (arm64 x86_64) # build universal framework as well if [[ ${#architectures[@]} < ${#SUPPORTED_ARCHITECTURES[@]} ]]; then exit 0 @@ -209,8 +209,6 @@ if ${cmakeBuild}; then mkdir -p universal/${target}.framework libsubpath="${target}.framework/${target}" lipo -create "device-arm64/${libsubpath}" \ - "device-armv7/${libsubpath}" \ - "simulator-i386/${libsubpath}" \ "simulator-x86_64/${libsubpath}" \ -output "universal/${libsubpath}" done @@ -228,17 +226,15 @@ if ${cmakeBuild}; then for target in ${targets[@]}; do libsubpath="${target}.framework/${target}" if [[ "${platform}" == "device" ]]; then - outputdir="${xcframeworkspath}/${target}.xcframework/ios-arm64_armv7/${target}.framework" + outputdir="${xcframeworkspath}/${target}.xcframework/ios-arm64/${target}.framework" mkdir -p ${outputdir} lipo -create "${frameworkspath}/device-arm64/${libsubpath}" \ - "${frameworkspath}/device-armv7/${libsubpath}" \ -output "${outputdir}/${target}" elif [[ "${platform}" == "simulator" ]]; then - outputdir="${xcframeworkspath}/${target}.xcframework/ios-arm64_i386_x86_64-simulator/${target}.framework" + outputdir="${xcframeworkspath}/${target}.xcframework/ios-arm64_x86_64-simulator/${target}.framework" mkdir -p ${outputdir} lipo -create "${frameworkspath}/simulator-arm64/${libsubpath}" \ - "${frameworkspath}/simulator-i386/${libsubpath}" \ "${frameworkspath}/simulator-x86_64/${libsubpath}" \ -output "${outputdir}/${target}" fi @@ -252,11 +248,11 @@ if ${cmakeBuild}; then done # create Headers for xcframework - if [[ ! -d "${xcframeworkspath}/firebase.xcframework/ios-arm64_armv7/firebase.framework/Headers" ]]; then + if [[ ! -d "${xcframeworkspath}/firebase.xcframework/ios-arm64/firebase.framework/Headers" ]]; then cp -R ${frameworkspath}/device-arm64/firebase.framework/Headers \ - ${xcframeworkspath}/firebase.xcframework/ios-arm64_armv7/firebase.framework/Headers + ${xcframeworkspath}/firebase.xcframework/ios-arm64/firebase.framework/Headers cp -R ${frameworkspath}/device-arm64/firebase.framework/Headers \ - ${xcframeworkspath}/firebase.xcframework/ios-arm64_i386_x86_64-simulator/firebase.framework/Headers + ${xcframeworkspath}/firebase.xcframework/ios-arm64_x86_64-simulator/firebase.framework/Headers fi echo "xcframeworks build end & ready to use" fi diff --git a/build_scripts/tvos/Info_ios_and_tvos.plist b/build_scripts/tvos/Info_ios_and_tvos.plist index 9095d8a567..0cb263b90d 100644 --- a/build_scripts/tvos/Info_ios_and_tvos.plist +++ b/build_scripts/tvos/Info_ios_and_tvos.plist @@ -6,13 +6,12 @@ LibraryIdentifier - ios-arm64_i386_x86_64-simulator + ios-arm64_x86_64-simulator LibraryPath LIBRARY_PATH SupportedArchitectures arm64 - i386 x86_64 SupportedPlatform @@ -22,13 +21,12 @@ LibraryIdentifier - ios-arm64_armv7 + ios-arm64 LibraryPath LIBRARY_PATH SupportedArchitectures arm64 - armv7 SupportedPlatform ios diff --git a/build_scripts/tvos/build.sh b/build_scripts/tvos/build.sh index bf79551ad7..c47f93042d 100755 --- a/build_scripts/tvos/build.sh +++ b/build_scripts/tvos/build.sh @@ -200,7 +200,7 @@ if ${cmakeBuild}; then done done - # if we built for all architectures (arm64 armv7 x86_64 i386) + # if we built for all architectures (arm64 armv7 x86_64) # build universal framework as well if [[ ${#architectures[@]} < ${#SUPPORTED_ARCHITECTURES[@]} ]]; then exit 0 diff --git a/cmake/external/firestore.cmake b/cmake/external/firestore.cmake index b38c6beb3b..5715648693 100644 --- a/cmake/external/firestore.cmake +++ b/cmake/external/firestore.cmake @@ -20,7 +20,7 @@ endif() # If the format of the line below changes, then be sure to update # https://github.com/firebase/firebase-cpp-sdk/blob/fd054fa016/.github/workflows/update-dependencies.yml#L81 -set(version CocoaPods-10.12.0) +set(version CocoaPods-10.13.0) function(GetReleasedDep) message("Getting released firebase-ios-sdk @ ${version}") diff --git a/cmake/external_rules.cmake b/cmake/external_rules.cmake index 2d1ce79a2d..bdd38b0eda 100644 --- a/cmake/external_rules.cmake +++ b/cmake/external_rules.cmake @@ -241,7 +241,7 @@ function(build_external_dependencies) if(NOT ANDROID AND NOT IOS) if (FIREBASE_USE_BORINGSSL) execute_process( - COMMAND ${ENV_COMMAND} cmake -DOPENSSL_NO_ASM=TRUE ${CMAKE_SUB_CONFIGURE_OPTIONS} ../boringssl + COMMAND ${ENV_COMMAND} ${CMAKE_COMMAND} -DOPENSSL_NO_ASM=TRUE ${CMAKE_SUB_CONFIGURE_OPTIONS} ../boringssl WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external/src/boringssl-build RESULT_VARIABLE boringssl_configure_status ) @@ -255,7 +255,7 @@ function(build_external_dependencies) endif() execute_process( - COMMAND ${ENV_COMMAND} cmake --build . ${CMAKE_SUB_BUILD_OPTIONS} --target ssl crypto -- ${cmake_build_args} + COMMAND ${ENV_COMMAND} ${CMAKE_COMMAND} --build . ${CMAKE_SUB_BUILD_OPTIONS} --target ssl crypto -- ${cmake_build_args} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external/src/boringssl-build RESULT_VARIABLE boringssl_build_status ) diff --git a/database/database_resources/build.gradle b/database/database_resources/build.gradle index 4d7cdccedb..02b23cb111 100644 --- a/database/database_resources/build.gradle +++ b/database/database_resources/build.gradle @@ -45,7 +45,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-database' //implementation project(':app:app_resources') diff --git a/database/integration_test/Podfile b/database/integration_test/Podfile index bfbd81bc49..beea7f84d9 100644 --- a/database/integration_test/Podfile +++ b/database/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Database', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Database', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Database', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Database', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end post_install do |installer| diff --git a/dynamic_links/integration_test/Podfile b/dynamic_links/integration_test/Podfile index 7dfa40e9c8..9dff3be5be 100644 --- a/dynamic_links/integration_test/Podfile +++ b/dynamic_links/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/DynamicLinks', '10.12.0' + pod 'Firebase/DynamicLinks', '10.13.0' end post_install do |installer| diff --git a/firestore/firestore_resources/build.gradle b/firestore/firestore_resources/build.gradle index d559110b87..9f4bfd98ab 100644 --- a/firestore/firestore_resources/build.gradle +++ b/firestore/firestore_resources/build.gradle @@ -53,7 +53,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-firestore' } diff --git a/firestore/integration_test/Podfile b/firestore/integration_test/Podfile index eb8a2fe9ef..89a8007786 100644 --- a/firestore/integration_test/Podfile +++ b/firestore/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Firestore', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Firestore', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Firestore', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end post_install do |installer| diff --git a/firestore/integration_test_internal/Podfile b/firestore/integration_test_internal/Podfile index 7d87a571b6..3cbb9cce62 100644 --- a/firestore/integration_test_internal/Podfile +++ b/firestore/integration_test_internal/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Firestore', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Firestore', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Firestore', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end post_install do |installer| diff --git a/functions/integration_test/Podfile b/functions/integration_test/Podfile index aa8a3c7f5d..22ef139816 100644 --- a/functions/integration_test/Podfile +++ b/functions/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Functions', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Functions', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Functions', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Functions', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end post_install do |installer| diff --git a/gma/gma_resources/build.gradle b/gma/gma_resources/build.gradle index 8bf2bc611f..79dc1bb0a8 100644 --- a/gma/gma_resources/build.gradle +++ b/gma/gma_resources/build.gradle @@ -45,7 +45,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-ads:22.2.0' } diff --git a/gma/integration_test/Podfile b/gma/integration_test/Podfile index 3943eeadd6..8f9a305cdf 100644 --- a/gma/integration_test/Podfile +++ b/gma/integration_test/Podfile @@ -4,8 +4,8 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/CoreOnly', '10.12.0' - pod 'Google-Mobile-Ads-SDK', '10.8.0' + pod 'Firebase/CoreOnly', '10.13.0' + pod 'Google-Mobile-Ads-SDK', '10.9.0' end post_install do |installer| diff --git a/gma/integration_test/src/integration_test.cc b/gma/integration_test/src/integration_test.cc index c98bbb748f..7143237873 100644 --- a/gma/integration_test/src/integration_test.cc +++ b/gma/integration_test/src/integration_test.cc @@ -174,6 +174,12 @@ class FirebaseGmaUITest : public FirebaseGmaTest { void SetUp() override; }; +class FirebaseGmaMinimalTest : public FirebaseTest { + public: + FirebaseGmaMinimalTest(); + ~FirebaseGmaMinimalTest() override; +}; + // Runs GMA Tests on methods and functions that should be run // before GMA initializes. class FirebaseGmaPreInitializationTests : public FirebaseGmaTest { @@ -229,11 +235,11 @@ void FirebaseGmaTest::SetUpTestSuite() { } void FirebaseGmaTest::TearDownTestSuite() { - // Workaround: GMA does some of its initialization in the main - // thread, so if you terminate it too quickly after initialization - // it can cause issues. Add a small delay here in case most of the - // tests are skipped. - ProcessEvents(1000); + // GMA does some of its initialization in the main thread, so if you terminate + // it before initialization has completed, it can cause issues. So wait for + // any pending GMA initialization to be completed before calling terminate. + WaitForCompletion(firebase::gma::InitializeLastResult(), + "gma::InitializeLastResult"); LogDebug("Shutdown GMA."); firebase::gma::Terminate(); LogDebug("Shutdown Firebase App."); @@ -302,6 +308,10 @@ firebase::Variant FirebaseGmaTest::GetVariantMap() { return variant_map; } +FirebaseGmaMinimalTest::FirebaseGmaMinimalTest() {} + +FirebaseGmaMinimalTest::~FirebaseGmaMinimalTest() {} + FirebaseGmaUITest::FirebaseGmaUITest() {} FirebaseGmaUITest::~FirebaseGmaUITest() {} @@ -341,6 +351,26 @@ void FirebaseGmaPreInitializationTests::SetUpTestSuite() { // Test cases below. +TEST_F(FirebaseGmaMinimalTest, TestInitializeGmaWithoutFirebase) { + // Don't initialize mediation in this test so that a later test can still + // verify that mediation has not been initialized. + firebase::gma::DisableMediationInitialization(); + LogDebug("Initializing GMA without a Firebase App."); + firebase::InitResult result; +#if defined(ANDROID) + ::firebase::gma::Initialize(app_framework::GetJniEnv(), + app_framework::GetActivity(), &result); +#else // !defined(ANDROID) + ::firebase::gma::Initialize(&result); +#endif // defined(ANDROID) + EXPECT_EQ(result, ::firebase::kInitResultSuccess); + WaitForCompletion(firebase::gma::InitializeLastResult(), "gma::Initialize"); + LogDebug("Successfully initialized GMA."); + + LogDebug("Shutdown GMA."); + firebase::gma::Terminate(); +} + TEST_F(FirebaseGmaPreInitializationTests, TestDisableMediationInitialization) { // Note: This test should be disabled or put in an entirely different test // binrary if we ever wish to test mediation in this application. diff --git a/gma/src/android/gma_android.cc b/gma/src/android/gma_android.cc index a1459e20b8..bcc7e35949 100644 --- a/gma/src/android/gma_android.cc +++ b/gma/src/android/gma_android.cc @@ -285,11 +285,7 @@ Future Initialize(JNIEnv* env, jobject activity, env->GetJavaVM(&g_java_vm); } - // GMA requires Google Play services if the class - // "com.google.android.gms.ads.internal.ClientApi" does not exist. - if (!util::FindClass(env, "com/google/android/gms/ads/internal/ClientApi") && - google_play_services::CheckAvailability(env, activity) != - google_play_services::kAvailabilityAvailable) { + if (!util::Initialize(env, activity)) { if (init_result_out) { *init_result_out = kInitResultFailedMissingDependency; } @@ -298,7 +294,12 @@ Future Initialize(JNIEnv* env, jobject activity, return Future(); } - if (!util::Initialize(env, activity)) { + // GMA requires Google Play services if the class + // "com.google.android.gms.ads.internal.ClientApi" does not exist. + if (!util::FindClass(env, "com/google/android/gms/ads/internal/ClientApi") && + google_play_services::CheckAvailability(env, activity) != + google_play_services::kAvailabilityAvailable) { + util::Terminate(env); if (init_result_out) { *init_result_out = kInitResultFailedMissingDependency; } diff --git a/installations/integration_test/Podfile b/installations/integration_test/Podfile index 7a73a24d5e..5c001d5b3a 100644 --- a/installations/integration_test/Podfile +++ b/installations/integration_test/Podfile @@ -4,8 +4,8 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/Analytics', '10.12.0' - pod 'Firebase/Installations', '10.12.0' + pod 'Firebase/Analytics', '10.13.0' + pod 'Firebase/Installations', '10.13.0' end post_install do |installer| diff --git a/ios_pod/Podfile b/ios_pod/Podfile index f45fd75556..85d0daf610 100644 --- a/ios_pod/Podfile +++ b/ios_pod/Podfile @@ -3,20 +3,20 @@ platform :ios, '11.0' use_frameworks! target 'GetPods' do - pod 'Firebase/Core', '10.12.0' + pod 'Firebase/Core', '10.13.0' - pod 'Google-Mobile-Ads-SDK', '10.8.0' - pod 'Firebase/Analytics', '10.12.0' - pod 'Firebase/AppCheck', '10.12.0' - pod 'Firebase/Auth', '10.12.0' - pod 'Firebase/Crashlytics', '10.12.0' - pod 'Firebase/Database', '10.12.0' - pod 'Firebase/DynamicLinks', '10.12.0' - pod 'Firebase/Firestore', '10.12.0' - pod 'Firebase/Functions', '10.12.0' - pod 'Firebase/Installations', '10.12.0' - pod 'Firebase/Messaging', '10.12.0' - pod 'Firebase/RemoteConfig', '10.12.0' - pod 'Firebase/Storage', '10.12.0' + pod 'Google-Mobile-Ads-SDK', '10.9.0' + pod 'Firebase/Analytics', '10.13.0' + pod 'Firebase/AppCheck', '10.13.0' + pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Crashlytics', '10.13.0' + pod 'Firebase/Database', '10.13.0' + pod 'Firebase/DynamicLinks', '10.13.0' + pod 'Firebase/Firestore', '10.13.0' + pod 'Firebase/Functions', '10.13.0' + pod 'Firebase/Installations', '10.13.0' + pod 'Firebase/Messaging', '10.13.0' + pod 'Firebase/RemoteConfig', '10.13.0' + pod 'Firebase/Storage', '10.13.0' end diff --git a/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h b/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h index 4ef68a494a..75a6cfd445 100644 --- a/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h @@ -1,246 +1,527 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASEANALYTICSSWIFT_SWIFT_H #define FIREBASEANALYTICSSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseAnalyticsSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASEANALYTICSSWIFT_SWIFT_H +#define FIREBASEANALYTICSSWIFT_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else +#include +#include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +# define SWIFT_NORETURN #endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseAnalyticsSwift", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseAnalyticsSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h b/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h index 04f937100e..900a26353e 100644 --- a/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h +++ b/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h @@ -1,207 +1,548 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASECOREINTERNAL_SWIFT_H #define FIREBASECOREINTERNAL_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import ObjectiveC; +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseCoreInternal",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) + +@class NSString; +@class FIRHeartbeatsPayload; + +/// An object that provides API to log and flush heartbeats from a synchronized storage container. +SWIFT_CLASS_NAMED("_ObjC_HeartbeatController") +@interface FIRHeartbeatController : NSObject +/// Public initializer. +/// \param id The id to associate this controller’s heartbeat storage with. +/// +- (nonnull instancetype)initWithId:(NSString * _Nonnull)id OBJC_DESIGNATED_INITIALIZER; +/// Asynchronously logs a new heartbeat, if needed. +/// note: +/// This API is thread-safe. +/// \param agent The string agent (i.e. Firebase User Agent) to associate the logged +/// heartbeat with. +/// +- (void)log:(NSString * _Nonnull)agent; +/// Synchronously flushes heartbeats from storage into a heartbeats payload. +/// note: +/// This API is thread-safe. +/// +/// returns: +/// A heartbeats payload for the flushed heartbeat(s). +- (FIRHeartbeatsPayload * _Nonnull)flush SWIFT_WARN_UNUSED_RESULT; +/// Synchronously flushes the heartbeat for today. +/// If no heartbeat was logged today, the returned payload is empty. +/// note: +/// This API is thread-safe. +/// +/// returns: +/// A heartbeats payload for the flushed heartbeat. +- (FIRHeartbeatsPayload * _Nonnull)flushHeartbeatFromToday SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +/// A model object representing a payload of heartbeat data intended for sending in network +/// requests. +SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") +@interface FIRHeartbeatsPayload : NSObject +/// Returns a processed payload string intended for use in a HTTP header. +/// +/// returns: +/// A string value from the heartbeats payload. +- (NSString * _Nonnull)headerValue SWIFT_WARN_UNUSED_RESULT; +/// A Boolean value indicating whether the payload is empty. +@property (nonatomic, readonly) BOOL isEmpty; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASECOREINTERNAL_SWIFT_H +#define FIREBASECOREINTERNAL_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else +#include +#include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +# define SWIFT_COMPILE_NAME(X) #endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT +#endif +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} #endif #endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" @@ -209,24 +550,25 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); @import ObjectiveC; #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseCoreInternal", generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseCoreInternal",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) + @class NSString; @class FIRHeartbeatsPayload; @@ -236,20 +578,21 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatController") /// Public initializer. /// \param id The id to associate this controller’s heartbeat storage with. /// -- (nonnull instancetype)initWithId:(NSString* _Nonnull)id OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithId:(NSString * _Nonnull)id OBJC_DESIGNATED_INITIALIZER; /// Asynchronously logs a new heartbeat, if needed. /// note: /// This API is thread-safe. -/// \param agent The string agent (i.e. Firebase User Agent) to associate the logged heartbeat with. +/// \param agent The string agent (i.e. Firebase User Agent) to associate the logged +/// heartbeat with. /// -- (void)log:(NSString* _Nonnull)agent; +- (void)log:(NSString * _Nonnull)agent; /// Synchronously flushes heartbeats from storage into a heartbeats payload. /// note: /// This API is thread-safe. /// /// returns: /// A heartbeats payload for the flushed heartbeat(s). -- (FIRHeartbeatsPayload* _Nonnull)flush SWIFT_WARN_UNUSED_RESULT; +- (FIRHeartbeatsPayload * _Nonnull)flush SWIFT_WARN_UNUSED_RESULT; /// Synchronously flushes the heartbeat for today. /// If no heartbeat was logged today, the returned payload is empty. /// note: @@ -257,11 +600,12 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatController") /// /// returns: /// A heartbeats payload for the flushed heartbeat. -- (FIRHeartbeatsPayload* _Nonnull)flushHeartbeatFromToday SWIFT_WARN_UNUSED_RESULT; +- (FIRHeartbeatsPayload * _Nonnull)flushHeartbeatFromToday SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end + /// A model object representing a payload of heartbeat data intended for sending in network /// requests. SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") @@ -270,15 +614,22 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") /// /// returns: /// A string value from the heartbeats payload. -- (NSString* _Nonnull)headerValue SWIFT_WARN_UNUSED_RESULT; +- (NSString * _Nonnull)headerValue SWIFT_WARN_UNUSED_RESULT; /// A Boolean value indicating whether the payload is empty. -@property(nonatomic, readonly) BOOL isEmpty; +@property (nonatomic, readonly) BOOL isEmpty; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h b/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h index 6e0deec083..6858831af3 100644 --- a/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h @@ -1,246 +1,533 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASEDATABASESWIFT_SWIFT_H #define FIREBASEDATABASESWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseDatabaseSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) + + + +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASEDATABASESWIFT_SWIFT_H +#define FIREBASEDATABASESWIFT_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +#include +#include +#include #endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT +#endif +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} #endif #endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseDatabaseSwift", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseDatabaseSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) + + + +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h b/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h index 263646d1ad..4a0c82b7e6 100644 --- a/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h @@ -1,246 +1,557 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASEFIRESTORESWIFT_SWIFT_H #define FIREBASEFIRESTORESWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction #endif #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFirestoreSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) + + + + + + + + + + + + + + + +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASEFIRESTORESWIFT_SWIFT_H +#define FIREBASEFIRESTORESWIFT_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +#include +#include +#include #endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT +#endif +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} #endif #endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseFirestoreSwift", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFirestoreSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) + + + + + + + + + + + + + + + +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseFunctions-Swift.h b/ios_pod/swift_headers/FirebaseFunctions-Swift.h index 4cbd092ca8..30701d8af1 100644 --- a/ios_pod/swift_headers/FirebaseFunctions-Swift.h +++ b/ios_pod/swift_headers/FirebaseFunctions-Swift.h @@ -1,207 +1,726 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASEFUNCTIONS_SWIFT_H #define FIREBASEFUNCTIONS_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import Foundation; +@import ObjectiveC; +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFunctions",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +@class FIRApp; +@class NSString; +@class FIRHTTPSCallable; +@class FIRHTTPSCallableOptions; +@class NSURL; + +/// Functions is the client for Cloud Functions for a Firebase project. +SWIFT_CLASS_NAMED("Functions") +@interface FIRFunctions : NSObject +/// Creates a Cloud Functions client using the default or returns a pre-existing instance if it already exists. +/// +/// returns: +/// A shared Functions instance initialized with the default FirebaseApp. ++ (FIRFunctions * _Nonnull)functions SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app, or returns a pre-existing +/// instance if one already exists. +/// \param app The app for the Firebase project. +/// +/// +/// returns: +/// A shared Functions instance initialized with the specified FirebaseApp. ++ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the default app and given region. +/// \param region The region for the HTTP trigger, such as us-central1. +/// +/// +/// returns: +/// A shared Functions instance initialized with the default FirebaseApp and a custom region. ++ (FIRFunctions * _Nonnull)functionsForRegion:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing +/// instance if one already exists. +/// \param customDomain A custom domain for the HTTP trigger, such as “https //mydomain.com”. +/// +/// +/// returns: +/// A shared Functions instance initialized with the default FirebaseApp and a custom HTTP trigger domain. ++ (FIRFunctions * _Nonnull)functionsForCustomDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing +/// instance if one already exists. +/// \param app The app for the Firebase project. +/// +/// \param region The region for the HTTP trigger, such as us-central1. +/// +/// +/// returns: +/// An instance of Functions with a custom app and region. ++ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app region:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing +/// instance if one already exists. +/// \param app The app for the Firebase project. +/// +/// \param customDomain A custom domain for the HTTP trigger, such as https://mydomain.com. +/// +/// +/// returns: +/// An instance of Functions with a custom app and HTTP trigger domain. ++ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app customDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name. +/// \param name The name of the Callable HTTPS trigger. +/// +/// +/// returns: +/// A reference to a Callable HTTPS trigger. +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and configuration +/// options. +/// \param name The name of the Callable HTTPS trigger. +/// +/// \param options The options with which to customize the Callable HTTPS trigger. +/// +/// +/// returns: +/// A reference to a Callable HTTPS trigger. +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name. +/// \param url The URL of the Callable HTTPS trigger. +/// +/// +/// returns: +/// A reference to a Callable HTTPS trigger. +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and configuration +/// options. +/// \param url The URL of the Callable HTTPS trigger. +/// +/// \param options The options with which to customize the Callable HTTPS trigger. +/// +/// +/// returns: +/// A reference to a Callable HTTPS trigger. +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; +/// Changes this instance to point to a Cloud Functions emulator running locally. +/// See https://firebase.google.com/docs/functions/local-emulator +/// \param host The host of the local emulator, such as “localhost”. +/// +/// \param port The port of the local emulator, for example 5005. +/// +- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// The set of error status codes that can be returned from a Callable HTTPS tigger. These are the +/// canonical error codes for Google APIs, as documented here: +/// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto#L26 +typedef SWIFT_ENUM_NAMED(NSInteger, FIRFunctionsErrorCode, "FunctionsErrorCode", open) { +/// The operation completed successfully. + FIRFunctionsErrorCodeOK = 0, +/// The operation was cancelled (typically by the caller). + FIRFunctionsErrorCodeCancelled = 1, +/// Unknown error or an error from a different error domain. + FIRFunctionsErrorCodeUnknown = 2, +/// Client specified an invalid argument. Note that this differs from FailedPrecondition. +/// InvalidArgument indicates arguments that are problematic regardless of the state of the +/// system (e.g., an invalid field name). + FIRFunctionsErrorCodeInvalidArgument = 3, +/// Deadline expired before operation could complete. For operations that change the state of the +/// system, this error may be returned even if the operation has completed successfully. For +/// example, a successful response from a server could have been delayed long enough for the +/// deadline to expire. + FIRFunctionsErrorCodeDeadlineExceeded = 4, +/// Some requested document was not found. + FIRFunctionsErrorCodeNotFound = 5, +/// Some document that we attempted to create already exists. + FIRFunctionsErrorCodeAlreadyExists = 6, +/// The caller does not have permission to execute the specified operation. + FIRFunctionsErrorCodePermissionDenied = 7, +/// Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system +/// is out of space. + FIRFunctionsErrorCodeResourceExhausted = 8, +/// Operation was rejected because the system is not in a state required for the operation’s +/// execution. + FIRFunctionsErrorCodeFailedPrecondition = 9, +/// The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. + FIRFunctionsErrorCodeAborted = 10, +/// Operation was attempted past the valid range. + FIRFunctionsErrorCodeOutOfRange = 11, +/// Operation is not implemented or not supported/enabled. + FIRFunctionsErrorCodeUnimplemented = 12, +/// Internal errors. Means some invariant expected by underlying system has been broken. If you +/// see one of these errors, something is very broken. + FIRFunctionsErrorCodeInternal = 13, +/// The service is currently unavailable. This is a most likely a transient condition and may be +/// corrected by retrying with a backoff. + FIRFunctionsErrorCodeUnavailable = 14, +/// Unrecoverable data loss or corruption. + FIRFunctionsErrorCodeDataLoss = 15, +/// The request does not have valid authentication credentials for the operation. + FIRFunctionsErrorCodeUnauthenticated = 16, +}; + +@class FIRHTTPSCallableResult; + +/// A HTTPSCallable is a reference to a particular Callable HTTPS trigger in Cloud Functions. +SWIFT_CLASS_NAMED("HTTPSCallable") +@interface FIRHTTPSCallable : NSObject +/// The timeout to use when calling the function. Defaults to 70 seconds. +@property (nonatomic) NSTimeInterval timeoutInterval; +/// Executes this Callable HTTPS trigger asynchronously. +/// The data passed into the trigger can be any of the following types: +///
    +///
  • +/// nil or NSNull +///
  • +///
  • +/// String +///
  • +///
  • +/// NSNumber, or any Swift numeric type bridgeable to NSNumber +///
  • +///
  • +/// [Any], where the contained objects are also one of these types. +///
  • +///
  • +/// [String: Any] where the values are also one of these types. +///
  • +///
+/// The request to the Cloud Functions backend made by this method automatically includes a +/// Firebase Installations ID token to identify the app instance. If a user is logged in with +/// Firebase Auth, an auth ID token for the user is also automatically included. +/// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information +/// regarding the app instance. To stop this, see Messaging.deleteData(). It +/// resumes with a new FCM Token the next time you call this method. +/// \param data Parameters to pass to the trigger. +/// +/// \param completion The block to call when the HTTPS request has completed. +/// +- (void)callWithObject:(id _Nullable)data completion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; +/// Executes this Callable HTTPS trigger asynchronously. This API should only be used from Objective-C. +/// The request to the Cloud Functions backend made by this method automatically includes a +/// Firebase Installations ID token to identify the app instance. If a user is logged in with +/// Firebase Auth, an auth ID token for the user is also automatically included. +/// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information +/// regarding the app instance. To stop this, see Messaging.deleteData(). It +/// resumes with a new FCM Token the next time you call this method. +/// \param completion The block to call when the HTTPS request has completed. +/// +- (void)callWithCompletion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +/// Configuration options for a HTTPSCallable instance. +SWIFT_CLASS_NAMED("HTTPSCallableOptions") +@interface FIRHTTPSCallableOptions : NSObject +/// Whether or not to protect the callable function with a limited-use App Check token. +@property (nonatomic, readonly) BOOL requireLimitedUseAppCheckTokens; +/// Designated initializer. +/// \param requireLimitedUseAppCheckTokens A boolean used to decide whether or not to +/// protect the callable function with a limited use App Check token. +/// +- (nonnull instancetype)initWithRequireLimitedUseAppCheckTokens:(BOOL)requireLimitedUseAppCheckTokens OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +/// A HTTPSCallableResult contains the result of calling a HTTPSCallable. +SWIFT_CLASS_NAMED("HTTPSCallableResult") +@interface FIRHTTPSCallableResult : NSObject +/// The data that was returned from the Callable HTTPS trigger. +/// The data is in the form of native objects. For example, if your trigger returned an +/// array, this object would be an Array. If your trigger returned a JavaScript object with +/// keys and values, this object would be an instance of [String: Any]. +@property (nonatomic, readonly) id _Nonnull data; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASEFUNCTIONS_SWIFT_H +#define FIREBASEFUNCTIONS_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +#include +#include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA #endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" @@ -210,24 +729,24 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); @import ObjectiveC; #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseFunctions", generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFunctions",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) @class FIRApp; @class NSString; @class FIRHTTPSCallable; @@ -237,38 +756,34 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); /// Functions is the client for Cloud Functions for a Firebase project. SWIFT_CLASS_NAMED("Functions") @interface FIRFunctions : NSObject -/// Creates a Cloud Functions client using the default or returns a pre-existing instance if it -/// already exists. +/// Creates a Cloud Functions client using the default or returns a pre-existing instance if it already exists. /// /// returns: /// A shared Functions instance initialized with the default FirebaseApp. -+ (FIRFunctions* _Nonnull)functions SWIFT_WARN_UNUSED_RESULT; ++ (FIRFunctions * _Nonnull)functions SWIFT_WARN_UNUSED_RESULT; /// Creates a Cloud Functions client with the given app, or returns a pre-existing /// instance if one already exists. -/// \param app The app for the Firebase project. +/// \param app The app for the Firebase project. /// /// /// returns: /// A shared Functions instance initialized with the specified FirebaseApp. -+ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app SWIFT_WARN_UNUSED_RESULT; ++ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; /// Creates a Cloud Functions client with the default app and given region. /// \param region The region for the HTTP trigger, such as us-central1. /// /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp and a custom -/// region. -+ (FIRFunctions* _Nonnull)functionsForRegion:(NSString* _Nonnull)region SWIFT_WARN_UNUSED_RESULT; +/// A shared Functions instance initialized with the default FirebaseApp and a custom region. ++ (FIRFunctions * _Nonnull)functionsForRegion:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; /// Creates a Cloud Functions client with the given app and region, or returns a pre-existing /// instance if one already exists. /// \param customDomain A custom domain for the HTTP trigger, such as “https //mydomain.com”. /// /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp and a custom -/// HTTP trigger domain. -+ (FIRFunctions* _Nonnull)functionsForCustomDomain:(NSString* _Nonnull)customDomain - SWIFT_WARN_UNUSED_RESULT; +/// A shared Functions instance initialized with the default FirebaseApp and a custom HTTP trigger domain. ++ (FIRFunctions * _Nonnull)functionsForCustomDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; /// Creates a Cloud Functions client with the given app and region, or returns a pre-existing /// instance if one already exists. /// \param app The app for the Firebase project. @@ -278,29 +793,26 @@ SWIFT_CLASS_NAMED("Functions") /// /// returns: /// An instance of Functions with a custom app and region. -+ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app - region:(NSString* _Nonnull)region SWIFT_WARN_UNUSED_RESULT; ++ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app region:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; /// Creates a Cloud Functions client with the given app and region, or returns a pre-existing /// instance if one already exists. -/// \param app The app for the Firebase project. +/// \param app The app for the Firebase project. /// -/// \param customDomain A custom domain for the HTTP trigger, such as -/// https://mydomain.com. +/// \param customDomain A custom domain for the HTTP trigger, such as https://mydomain.com. /// /// /// returns: /// An instance of Functions with a custom app and HTTP trigger domain. -+ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app - customDomain:(NSString* _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; ++ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app customDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; /// Creates a reference to the Callable HTTPS trigger with the given name. /// \param name The name of the Callable HTTPS trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithName:(NSString* _Nonnull)name - SWIFT_WARN_UNUSED_RESULT; -/// Creates a reference to the Callable HTTPS trigger with the given name and configuration options. +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and configuration +/// options. /// \param name The name of the Callable HTTPS trigger. /// /// \param options The options with which to customize the Callable HTTPS trigger. @@ -308,17 +820,16 @@ SWIFT_CLASS_NAMED("Functions") /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithName:(NSString* _Nonnull)name - options:(FIRHTTPSCallableOptions* _Nonnull)options - SWIFT_WARN_UNUSED_RESULT; +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; /// Creates a reference to the Callable HTTPS trigger with the given name. /// \param url The URL of the Callable HTTPS trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithURL:(NSURL* _Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates a reference to the Callable HTTPS trigger with the given name and configuration options. +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and configuration +/// options. /// \param url The URL of the Callable HTTPS trigger. /// /// \param options The options with which to customize the Callable HTTPS trigger. @@ -326,16 +837,14 @@ SWIFT_CLASS_NAMED("Functions") /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithURL:(NSURL* _Nonnull)url - options:(FIRHTTPSCallableOptions* _Nonnull)options - SWIFT_WARN_UNUSED_RESULT; +- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; /// Changes this instance to point to a Cloud Functions emulator running locally. /// See https://firebase.google.com/docs/functions/local-emulator /// \param host The host of the local emulator, such as “localhost”. /// /// \param port The port of the local emulator, for example 5005. /// -- (void)useEmulatorWithHost:(NSString* _Nonnull)host port:(NSInteger)port; +- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end @@ -343,65 +852,59 @@ SWIFT_CLASS_NAMED("Functions") /// The set of error status codes that can be returned from a Callable HTTPS tigger. These are the /// canonical error codes for Google APIs, as documented here: /// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto#L26 -typedef SWIFT_ENUM_NAMED(NSInteger, FIRFunctionsErrorCode, "FunctionsErrorCode", open){ - /// The operation completed successfully. - FIRFunctionsErrorCodeOK = 0, - /// The operation was cancelled (typically by the caller). - FIRFunctionsErrorCodeCancelled = 1, - /// Unknown error or an error from a different error domain. - FIRFunctionsErrorCodeUnknown = 2, - /// Client specified an invalid argument. Note that this differs from - /// FailedPrecondition. - /// InvalidArgument indicates arguments that are problematic regardless of the - /// state of the - /// system (e.g., an invalid field name). - FIRFunctionsErrorCodeInvalidArgument = 3, - /// Deadline expired before operation could complete. For operations that change the state of - /// the - /// system, this error may be returned even if the operation has completed successfully. For - /// example, a successful response from a server could have been delayed long enough for the - /// deadline to expire. - FIRFunctionsErrorCodeDeadlineExceeded = 4, - /// Some requested document was not found. - FIRFunctionsErrorCodeNotFound = 5, - /// Some document that we attempted to create already exists. - FIRFunctionsErrorCodeAlreadyExists = 6, - /// The caller does not have permission to execute the specified operation. - FIRFunctionsErrorCodePermissionDenied = 7, - /// Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file - /// system - /// is out of space. - FIRFunctionsErrorCodeResourceExhausted = 8, - /// Operation was rejected because the system is not in a state required for the operation’s - /// execution. - FIRFunctionsErrorCodeFailedPrecondition = 9, - /// The operation was aborted, typically due to a concurrency issue like transaction aborts, - /// etc. - FIRFunctionsErrorCodeAborted = 10, - /// Operation was attempted past the valid range. - FIRFunctionsErrorCodeOutOfRange = 11, - /// Operation is not implemented or not supported/enabled. - FIRFunctionsErrorCodeUnimplemented = 12, - /// Internal errors. Means some invariant expected by underlying system has been broken. If you - /// see one of these errors, something is very broken. - FIRFunctionsErrorCodeInternal = 13, - /// The service is currently unavailable. This is a most likely a transient condition and may be - /// corrected by retrying with a backoff. - FIRFunctionsErrorCodeUnavailable = 14, - /// Unrecoverable data loss or corruption. - FIRFunctionsErrorCodeDataLoss = 15, - /// The request does not have valid authentication credentials for the operation. - FIRFunctionsErrorCodeUnauthenticated = 16, +typedef SWIFT_ENUM_NAMED(NSInteger, FIRFunctionsErrorCode, "FunctionsErrorCode", open) { +/// The operation completed successfully. + FIRFunctionsErrorCodeOK = 0, +/// The operation was cancelled (typically by the caller). + FIRFunctionsErrorCodeCancelled = 1, +/// Unknown error or an error from a different error domain. + FIRFunctionsErrorCodeUnknown = 2, +/// Client specified an invalid argument. Note that this differs from FailedPrecondition. +/// InvalidArgument indicates arguments that are problematic regardless of the state of the +/// system (e.g., an invalid field name). + FIRFunctionsErrorCodeInvalidArgument = 3, +/// Deadline expired before operation could complete. For operations that change the state of the +/// system, this error may be returned even if the operation has completed successfully. For +/// example, a successful response from a server could have been delayed long enough for the +/// deadline to expire. + FIRFunctionsErrorCodeDeadlineExceeded = 4, +/// Some requested document was not found. + FIRFunctionsErrorCodeNotFound = 5, +/// Some document that we attempted to create already exists. + FIRFunctionsErrorCodeAlreadyExists = 6, +/// The caller does not have permission to execute the specified operation. + FIRFunctionsErrorCodePermissionDenied = 7, +/// Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system +/// is out of space. + FIRFunctionsErrorCodeResourceExhausted = 8, +/// Operation was rejected because the system is not in a state required for the operation’s +/// execution. + FIRFunctionsErrorCodeFailedPrecondition = 9, +/// The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. + FIRFunctionsErrorCodeAborted = 10, +/// Operation was attempted past the valid range. + FIRFunctionsErrorCodeOutOfRange = 11, +/// Operation is not implemented or not supported/enabled. + FIRFunctionsErrorCodeUnimplemented = 12, +/// Internal errors. Means some invariant expected by underlying system has been broken. If you +/// see one of these errors, something is very broken. + FIRFunctionsErrorCodeInternal = 13, +/// The service is currently unavailable. This is a most likely a transient condition and may be +/// corrected by retrying with a backoff. + FIRFunctionsErrorCodeUnavailable = 14, +/// Unrecoverable data loss or corruption. + FIRFunctionsErrorCodeDataLoss = 15, +/// The request does not have valid authentication credentials for the operation. + FIRFunctionsErrorCodeUnauthenticated = 16, }; @class FIRHTTPSCallableResult; -/// A HTTPSCallable is a reference to a particular Callable HTTPS trigger in Cloud -/// Functions. +/// A HTTPSCallable is a reference to a particular Callable HTTPS trigger in Cloud Functions. SWIFT_CLASS_NAMED("HTTPSCallable") @interface FIRHTTPSCallable : NSObject /// The timeout to use when calling the function. Defaults to 70 seconds. -@property(nonatomic) NSTimeInterval timeoutInterval; +@property (nonatomic) NSTimeInterval timeoutInterval; /// Executes this Callable HTTPS trigger asynchronously. /// The data passed into the trigger can be any of the following types: ///
    @@ -431,53 +934,58 @@ SWIFT_CLASS_NAMED("HTTPSCallable") /// /// \param completion The block to call when the HTTPS request has completed. /// -- (void)callWithObject:(id _Nullable)data - completion: - (void (^_Nonnull)(FIRHTTPSCallableResult* _Nullable, NSError* _Nullable))completion; -/// Executes this Callable HTTPS trigger asynchronously. This API should only be used from -/// Objective-C. The request to the Cloud Functions backend made by this method automatically -/// includes a Firebase Installations ID token to identify the app instance. If a user is logged in -/// with Firebase Auth, an auth ID token for the user is also automatically included. Firebase Cloud -/// Messaging sends data to the Firebase backend periodically to collect information regarding the -/// app instance. To stop this, see Messaging.deleteData(). It resumes with a new FCM -/// Token the next time you call this method. \param completion The block to call when the HTTPS -/// request has completed. -/// -- (void)callWithCompletion:(void (^_Nonnull)(FIRHTTPSCallableResult* _Nullable, - NSError* _Nullable))completion; +- (void)callWithObject:(id _Nullable)data completion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; +/// Executes this Callable HTTPS trigger asynchronously. This API should only be used from Objective-C. +/// The request to the Cloud Functions backend made by this method automatically includes a +/// Firebase Installations ID token to identify the app instance. If a user is logged in with +/// Firebase Auth, an auth ID token for the user is also automatically included. +/// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information +/// regarding the app instance. To stop this, see Messaging.deleteData(). It +/// resumes with a new FCM Token the next time you call this method. +/// \param completion The block to call when the HTTPS request has completed. +/// +- (void)callWithCompletion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end + /// Configuration options for a HTTPSCallable instance. SWIFT_CLASS_NAMED("HTTPSCallableOptions") @interface FIRHTTPSCallableOptions : NSObject /// Whether or not to protect the callable function with a limited-use App Check token. -@property(nonatomic, readonly) BOOL requireLimitedUseAppCheckTokens; +@property (nonatomic, readonly) BOOL requireLimitedUseAppCheckTokens; /// Designated initializer. /// \param requireLimitedUseAppCheckTokens A boolean used to decide whether or not to /// protect the callable function with a limited use App Check token. /// -- (nonnull instancetype)initWithRequireLimitedUseAppCheckTokens: - (BOOL)requireLimitedUseAppCheckTokens OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithRequireLimitedUseAppCheckTokens:(BOOL)requireLimitedUseAppCheckTokens OBJC_DESIGNATED_INITIALIZER; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end + /// A HTTPSCallableResult contains the result of calling a HTTPSCallable. SWIFT_CLASS_NAMED("HTTPSCallableResult") @interface FIRHTTPSCallableResult : NSObject /// The data that was returned from the Callable HTTPS trigger. /// The data is in the form of native objects. For example, if your trigger returned an -/// array, this object would be an Array. If your trigger returned a JavaScript -/// object with keys and values, this object would be an instance of [String: Any]. -@property(nonatomic, readonly) id _Nonnull data; +/// array, this object would be an Array. If your trigger returned a JavaScript object with +/// keys and values, this object would be an instance of [String: Any]. +@property (nonatomic, readonly) id _Nonnull data; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h b/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h index 4385483012..ce52b04787 100644 --- a/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h @@ -1,247 +1,527 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H #define FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseInAppMessagingSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H +#define FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else +#include +#include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +# define SWIFT_NORETURN #endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", \ - defined_in = "FirebaseInAppMessagingSwift", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseInAppMessagingSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h b/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h index 32272ef80a..b404b4e97b 100644 --- a/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h +++ b/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h @@ -1,246 +1,531 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASEMLMODELDOWNLOADER_SWIFT_H #define FIREBASEMLMODELDOWNLOADER_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseMLModelDownloader",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) + + +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASEMLMODELDOWNLOADER_SWIFT_H +#define FIREBASEMLMODELDOWNLOADER_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else +#include +#include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif #endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseMLModelDownloader", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseMLModelDownloader",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) + + +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h b/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h index e10f33c736..9d335c54d5 100644 --- a/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h @@ -1,246 +1,533 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASEREMOTECONFIGSWIFT_SWIFT_H #define FIREBASEREMOTECONFIGSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseRemoteConfigSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) + + + +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASEREMOTECONFIGSWIFT_SWIFT_H +#define FIREBASEREMOTECONFIGSWIFT_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +#include +#include +#include #endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT +#endif +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} #endif #endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseRemoteConfigSwift", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseRemoteConfigSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) + + + +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h b/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h index b5a37ed830..5e028d4fde 100644 --- a/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h @@ -1,246 +1,527 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASESHAREDSWIFT_SWIFT_H #define FIREBASESHAREDSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseSharedSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASESHAREDSWIFT_SWIFT_H +#define FIREBASESHAREDSWIFT_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else +#include +#include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +# define SWIFT_NORETURN #endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "FirebaseSharedSwift", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseSharedSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/FirebaseStorage-Swift.h b/ios_pod/swift_headers/FirebaseStorage-Swift.h index 2ca8b040aa..f9e5c97b1d 100644 --- a/ios_pod/swift_headers/FirebaseStorage-Swift.h +++ b/ios_pod/swift_headers/FirebaseStorage-Swift.h @@ -1,207 +1,1062 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef FIREBASESTORAGE_SWIFT_H #define FIREBASESTORAGE_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else +#include #include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif +#else +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT +#endif +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import Dispatch; +@import Foundation; +@import ObjectiveC; +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseStorage",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +@class NSString; +@class FIRApp; +@class FIRStorageReference; + +/// Firebase Storage is a service that supports uploading and downloading binary objects, +/// such as images, videos, and other files to Google Cloud Storage. Instances of Storage +/// are not thread-safe. +/// If you call Storage.storage(), the instance will initialize with the default FirebaseApp, +/// FirebaseApp.app(), and the storage location will come from the provided +/// GoogleService-Info.plist. +/// If you provide a custom instance of FirebaseApp, +/// the storage location will be specified via the FirebaseOptions.storageBucket property. +SWIFT_CLASS_NAMED("Storage") +@interface FIRStorage : NSObject +/// The default Storage instance. +/// +/// returns: +/// An instance of Storage, configured with the default FirebaseApp. ++ (FIRStorage * _Nonnull)storage SWIFT_WARN_UNUSED_RESULT; +/// A method used to create Storage instances initialized with a custom storage bucket URL. +/// Any StorageReferences generated from this instance of Storage will reference files +/// and directories within the specified bucket. +/// \param url The gs:// URL to your Firebase Storage bucket. +/// +/// +/// returns: +/// A Storage instance, configured with the custom storage bucket. ++ (FIRStorage * _Nonnull)storageWithURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom FirebaseApp. StorageReferences +/// generated from a resulting instance will reference files in the Firebase project +/// associated with custom FirebaseApp. +/// \param app The custom FirebaseApp used for initialization. +/// +/// +/// returns: +/// A Storage instance, configured with the custom FirebaseApp. ++ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom FirebaseApp and a custom storage +/// bucket URL. +/// \param app The custom FirebaseApp used for initialization. +/// +/// \param url The gs:// url to your Firebase Storage bucket. +/// +/// +/// returns: +/// the Storage instance, configured with the custom FirebaseApp and storage bucket URL. ++ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app URL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// The FirebaseApp associated with this Storage instance. +@property (nonatomic, readonly, strong) FIRApp * _Nonnull app; +/// The maximum time in seconds to retry an upload if a failure occurs. +/// Defaults to 10 minutes (600 seconds). +@property (nonatomic) NSTimeInterval maxUploadRetryTime; +/// The maximum time in seconds to retry a download if a failure occurs. +/// Defaults to 10 minutes (600 seconds). +@property (nonatomic) NSTimeInterval maxDownloadRetryTime; +/// The maximum time in seconds to retry operations other than upload and download if a failure occurs. +/// Defaults to 2 minutes (120 seconds). +@property (nonatomic) NSTimeInterval maxOperationRetryTime; +/// Specify the maximum upload chunk size. Values less than 256K (262144) will be rounded up to 256K. Values +/// above 256K will be rounded down to the nearest 256K multiple. The default is no maximum. +@property (nonatomic) int64_t uploadChunkSizeBytes; +/// A DispatchQueue that all developer callbacks are fired on. Defaults to the main queue. +@property (nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue; +/// Creates a StorageReference initialized at the root Firebase Storage location. +/// +/// returns: +/// An instance of StorageReference referencing the root of the storage bucket. +- (FIRStorageReference * _Nonnull)reference SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference given a gs://, http://, or https:// URL pointing to a +/// Firebase Storage location. For example, you can pass in an https:// download URL retrieved from +/// StorageReference.downloadURL(completion:) or the gs:// URL from +/// StorageReference.description. +/// \param url A gs // or https:// URL to initialize the reference with. +/// +/// +/// throws: +/// Throws a fatal error if url is not associated with the FirebaseApp used to initialize +/// this Storage instance. +/// +/// returns: +/// An instance of StorageReference at the given child path. +- (FIRStorageReference * _Nonnull)referenceForURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference initialized at a location specified by the path parameter. +/// \param path A relative path from the root of the storage bucket, +/// for instance @“path/to/object”. +/// +/// +/// returns: +/// An instance of StorageReference pointing to the given path. +- (FIRStorageReference * _Nonnull)referenceWithPath:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; +/// Configures the Storage SDK to use an emulated backend instead of the default remote backend. +/// This method should be called before invoking any other methods on a new instance of Storage. +- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; +- (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; +- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic, readonly) NSUInteger hash; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + +/// Defines task operations such as pause, resume, cancel, and enqueue for all tasks. +/// All tasks are required to implement enqueue, which begins the task, and may optionally +/// implement pause, resume, and cancel, which operate on the task to pause, resume, and cancel +/// operations. +SWIFT_PROTOCOL_NAMED("StorageTaskManagement") +@protocol FIRStorageTaskManagement +/// Prepares a task and begins execution. +- (void)enqueue; +@optional +/// Pauses a task currently in progress. +- (void)pause; +/// Cancels a task. +- (void)cancel; +/// Resumes a paused task. +- (void)resume; +@end + +@class FIRStorageTaskSnapshot; + +/// A superclass to all Storage tasks, including StorageUploadTask +/// and StorageDownloadTask, to provide state transitions, event raising, and common storage +/// for metadata and errors. +/// Callbacks are always fired on the developer-specified callback queue. +/// If no queue is specified, it defaults to the main queue. +/// This class is not thread safe, so only call methods on the main thread. +SWIFT_CLASS_NAMED("StorageTask") +@interface FIRStorageTask : NSObject +/// An immutable view of the task and associated metadata, progress, error, etc. +@property (nonatomic, readonly, strong) FIRStorageTaskSnapshot * _Nonnull snapshot; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +enum FIRStorageTaskStatus : NSInteger; + +/// An extended StorageTask providing observable semantics that can be used for responding to changes +/// in task state. +/// Observers produce a StorageHandle, which is used to keep track of and remove specific +/// observers at a later date. +/// This class is not thread safe and can only be called on the main thread. +SWIFT_CLASS_NAMED("StorageObservableTask") +@interface FIRStorageObservableTask : FIRStorageTask +/// Observes changes in the upload status: Resume, Pause, Progress, Success, and Failure. +/// \param status The StorageTaskStatus change to observe. +/// +/// \param handler A callback that fires every time the status event occurs, +/// containing a StorageTaskSnapshot describing task state. +/// +/// +/// returns: +/// A task handle that can be used to remove the observer at a later date. +- (NSString * _Nonnull)observeStatus:(enum FIRStorageTaskStatus)status handler:(void (^ _Nonnull)(FIRStorageTaskSnapshot * _Nonnull))handler; +/// Removes the single observer with the provided handle. +/// \param handle The handle of the task to remove. +/// +- (void)removeObserverWithHandle:(NSString * _Nonnull)handle; +/// Removes all observers for a single status. +/// \param status A StorageTaskStatus to remove all listeners for. +/// +- (void)removeAllObserversForStatus:(enum FIRStorageTaskStatus)status; +/// Removes all observers. +- (void)removeAllObservers; +@end + + +/// StorageDownloadTask implements resumable downloads from an object in Firebase Storage. +/// Downloads can be returned on completion with a completion handler, and can be monitored +/// by attaching observers, or controlled by calling pause(), resume(), +/// or cancel(). +/// Downloads can currently be returned as Data in memory, or as a URL to a file on disk. +/// Downloads are performed on a background queue, and callbacks are raised on the developer +/// specified callbackQueue in Storage, or the main queue if left unspecified. +/// Currently all downloads must be initiated and managed on the main queue. +SWIFT_CLASS_NAMED("StorageDownloadTask") +@interface FIRStorageDownloadTask : FIRStorageObservableTask +/// Prepares a task and begins execution. +- (void)enqueue; +/// Pauses a task currently in progress. Calling this on a paused task has no effect. +- (void)pause; +/// Cancels a task. +- (void)cancel; +/// Resumes a paused task. Calling this on a running task has no effect. +- (void)resume; +@end + +/// Adds wrappers for common Firebase Storage errors (including creating errors from GCS errors). +/// For more information on unwrapping GCS errors, see the GCS errors docs: +/// https://cloud.google.com/storage/docs/json_api/v1/status-codes +/// This is never publicly exposed to end developers (as they will simply see an NSError). +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", open) { + FIRStorageErrorCodeUnknown = -13000, + FIRStorageErrorCodeObjectNotFound = -13010, + FIRStorageErrorCodeBucketNotFound = -13011, + FIRStorageErrorCodeProjectNotFound = -13012, + FIRStorageErrorCodeQuotaExceeded = -13013, + FIRStorageErrorCodeUnauthenticated = -13020, + FIRStorageErrorCodeUnauthorized = -13021, + FIRStorageErrorCodeRetryLimitExceeded = -13030, + FIRStorageErrorCodeNonMatchingChecksum = -13031, + FIRStorageErrorCodeDownloadSizeExceeded = -13032, + FIRStorageErrorCodeCancelled = -13040, + FIRStorageErrorCodeInvalidArgument = -13050, +}; +static NSString * _Nonnull const FIRStorageErrorCodeDomain = @"FirebaseStorage.StorageErrorCode"; + + +/// Contains the prefixes and items returned by a StorageReference.list() call. +SWIFT_CLASS_NAMED("StorageListResult") +@interface FIRStorageListResult : NSObject +/// The prefixes (folders) returned by a list() operation. +/// +/// returns: +/// A list of prefixes (folders). +@property (nonatomic, readonly, copy) NSArray * _Nonnull prefixes; +/// The objects (files) returned by a list() operation. +/// +/// returns: +/// A page token if more results are available. +@property (nonatomic, readonly, copy) NSArray * _Nonnull items; +/// Returns a token that can be used to resume a previous list() operation. nil +/// indicates that there are no more results. +/// +/// returns: +/// A page token if more results are available. +@property (nonatomic, readonly, copy) NSString * _Nullable pageToken; +- (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class NSDate; + +/// Class which represents the metadata on an object in Firebase Storage. This metadata is +/// returned on successful operations, and can be used to retrieve download URLs, content types, +/// and a Storage reference to the object in question. Full documentation can be found at the GCS +/// Objects#resource docs. +/// @see https://cloud.google.com/storage/docs/json_api/v1/objects#resource +SWIFT_CLASS_NAMED("StorageMetadata") +@interface FIRStorageMetadata : NSObject +/// The name of the bucket containing this object. +@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; +/// Cache-Control directive for the object data. +@property (nonatomic, copy) NSString * _Nullable cacheControl; +/// Content-Disposition of the object data. +@property (nonatomic, copy) NSString * _Nullable contentDisposition; +/// Content-Encoding of the object data. +@property (nonatomic, copy) NSString * _Nullable contentEncoding; +/// Content-Language of the object data. +@property (nonatomic, copy) NSString * _Nullable contentLanguage; +/// Content-Type of the object data. +@property (nonatomic, copy) NSString * _Nullable contentType; +/// MD5 hash of the data; encoded using base64. +@property (nonatomic, readonly, copy) NSString * _Nullable md5Hash; +/// The content generation of this object. Used for object versioning. +@property (nonatomic, readonly) int64_t generation; +/// User-provided metadata, in key/value pairs. +@property (nonatomic, copy) NSDictionary * _Nullable customMetadata; +/// The version of the metadata for this object at this generation. Used +/// for preconditions and for detecting changes in metadata. A metageneration number is only +/// meaningful in the context of a particular generation of a particular object. +@property (nonatomic, readonly) int64_t metageneration; +/// The name of this object, in gs://bucket/path/to/object.txt, this is object.txt. +@property (nonatomic, readonly, copy) NSString * _Nullable name; +/// The full path of this object, in gs://bucket/path/to/object.txt, this is path/to/object.txt. +@property (nonatomic, readonly, copy) NSString * _Nullable path; +/// Content-Length of the data in bytes. +@property (nonatomic, readonly) int64_t size; +/// The creation time of the object in RFC 3339 format. +@property (nonatomic, readonly, copy) NSDate * _Nullable timeCreated; +/// The modification time of the object metadata in RFC 3339 format. +@property (nonatomic, readonly, copy) NSDate * _Nullable updated; +/// Never used API +@property (nonatomic, readonly, strong) FIRStorageReference * _Nullable storageReference SWIFT_DEPRECATED; +/// Creates a Dictionary from the contents of the metadata. +/// @return A Dictionary that represents the contents of the metadata. +- (NSDictionary * _Nonnull)dictionaryRepresentation SWIFT_WARN_UNUSED_RESULT; +/// Determines if the current metadata represents a “file”. +@property (nonatomic, readonly) BOOL isFile; +/// Determines if the current metadata represents a “folder”. +@property (nonatomic, readonly) BOOL isFolder; +- (nonnull instancetype)init; +/// Creates an instance of StorageMetadata from the contents of a dictionary. +/// @return An instance of StorageMetadata that represents the contents of a dictionary. +- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary OBJC_DESIGNATED_INITIALIZER; +- (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; +- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic, readonly) NSUInteger hash; +@property (nonatomic, readonly, copy) NSString * _Nonnull description; +@end + + +@class NSData; +@class FIRStorageUploadTask; +@class NSURL; + +/// StorageReference represents a reference to a Google Cloud Storage object. Developers can +/// upload and download objects, as well as get/set object metadata, and delete an object at the +/// path. See the Cloud docs for more details: https://cloud.google.com/storage/ +SWIFT_CLASS_NAMED("StorageReference") +@interface FIRStorageReference : NSObject +/// The Storage service object which created this reference. +@property (nonatomic, readonly, strong) FIRStorage * _Nonnull storage; +/// The name of the Google Cloud Storage bucket associated with this reference. +/// For example, in gs://bucket/path/to/object.txt, the bucket would be ‘bucket’. +@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; +/// The full path to this object, not including the Google Cloud Storage bucket. +/// In gs://bucket/path/to/object.txt, the full path would be: path/to/object.txt +@property (nonatomic, readonly, copy) NSString * _Nonnull fullPath; +/// The short name of the object associated with this reference. +/// In gs://bucket/path/to/object.txt, the name of the object would be object.txt. +@property (nonatomic, readonly, copy) NSString * _Nonnull name; +/// Creates a new StorageReference pointing to the root object. +/// +/// returns: +/// A new StorageReference pointing to the root object. +- (FIRStorageReference * _Nonnull)root SWIFT_WARN_UNUSED_RESULT; +/// Creates a new StorageReference pointing to the parent of the current reference +/// or nil if this instance references the root location. +/// For example: +/// path = foo/bar/baz parent = foo/bar +/// path = foo parent = (root) +/// path = (root) parent = nil +/// +/// returns: +/// A new StorageReference pointing to the parent of the current reference. +- (FIRStorageReference * _Nullable)parent SWIFT_WARN_UNUSED_RESULT; +/// Creates a new StorageReference pointing to a child object of the current reference. +/// path = foo child = bar newPath = foo/bar +/// path = foo/bar child = baz ntask.impl.snapshotwPath = foo/bar/baz +/// All leading and trailing slashes will be removed, and consecutive slashes will be +/// compressed to single slashes. For example: +/// child = /foo/bar newPath = foo/bar +/// child = foo/bar/ newPath = foo/bar +/// child = foo///bar newPath = foo/bar +/// \param path The path to append to the current path. +/// +/// +/// returns: +/// A new StorageReference pointing to a child location of the current reference. +- (FIRStorageReference * _Nonnull)child:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; +/// Asynchronously uploads data to the currently specified StorageReference, +/// without additional metadata. +/// This is not recommended for large files, and one should instead upload a file from disk. +/// \param uploadData The data to upload. +/// +/// \param metadata StorageMetadata containing additional information (MIME type, etc.) +/// about the object being uploaded. +/// +/// +/// returns: +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata; +/// Asynchronously uploads data to the currently specified StorageReference. +/// This is not recommended for large files, and one should instead upload a file from disk. +/// \param uploadData The data to upload. +/// +/// +/// returns: +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData; +/// Asynchronously uploads data to the currently specified StorageReference. +/// This is not recommended for large files, and one should instead upload a file from disk. +/// \param uploadData The data to upload. +/// +/// \param metadata StorageMetadata containing additional information (MIME type, etc.) +/// about the object being uploaded. +/// +/// \param completion A closure that either returns the object metadata on success, +/// or an error on failure. +/// +/// +/// returns: +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +/// Asynchronously uploads a file to the currently specified StorageReference. +/// putData should be used instead of putFile in Extensions. +/// \param fileURL A URL representing the system file path of the object to be uploaded. +/// +/// \param metadata StorageMetadata containing additional information (MIME type, etc.) +/// about the object being uploaded. +/// +/// +/// returns: +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata; +/// Asynchronously uploads a file to the currently specified StorageReference, +/// without additional metadata. +/// putData should be used instead of putFile in Extensions. +/// @param fileURL A URL representing the system file path of the object to be uploaded. +/// @return An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL; +/// Asynchronously uploads a file to the currently specified StorageReference. +/// putData should be used instead of putFile in Extensions. +/// \param fileURL A URL representing the system file path of the object to be uploaded. +/// +/// \param metadata StorageMetadata containing additional information (MIME type, etc.) +/// about the object being uploaded. +/// +/// \param completion A completion block that either returns the object metadata on success, +/// or an error on failure. +/// +/// +/// returns: +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +/// Asynchronously downloads the object at the StorageReference to a Data instance in memory. +/// A Data buffer of the provided max size will be allocated, so ensure that the device has enough free +/// memory to complete the download. For downloading large files, write(toFile:) may be a better option. +/// \param maxSize The maximum size in bytes to download. If the download exceeds this size, +/// the task will be cancelled and an error will be returned. +/// +/// \param completion A completion block that either returns the object data on success, +/// or an error on failure. +/// +/// +/// returns: +/// An StorageDownloadTask that can be used to monitor or manage the download. +- (FIRStorageDownloadTask * _Nonnull)dataWithMaxSize:(int64_t)maxSize completion:(void (^ _Nonnull)(NSData * _Nullable, NSError * _Nullable))completion; +/// Asynchronously retrieves a long lived download URL with a revokable token. +/// This can be used to share the file with others, but can be revoked by a developer +/// in the Firebase Console. +/// \param completion A completion block that either returns the URL on success, +/// or an error on failure. +/// +- (void)downloadURLWithCompletion:(void (^ _Nonnull)(NSURL * _Nullable, NSError * _Nullable))completion; +/// Asynchronously downloads the object at the current path to a specified system filepath. +///
      +///
    • +/// Returns An StorageDownloadTask that can be used to monitor or manage the download. +///
    • +///
    +/// \param fileURL A file system URL representing the path the object should be downloaded to. +/// +- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL; +/// Asynchronously downloads the object at the current path to a specified system filepath. +/// \param fileURL A file system URL representing the path the object should be downloaded to. +/// +/// \param completion A closure that fires when the file download completes, passed either +/// a URL pointing to the file path of the downloaded file on success, +/// or an error on failure. +/// +/// +/// returns: +/// A StorageDownloadTask that can be used to monitor or manage the download. +- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL completion:(void (^ _Nullable)(NSURL * _Nullable, NSError * _Nullable))completion; +/// Lists all items (files) and prefixes (folders) under this StorageReference. +/// This is a helper method for calling list() repeatedly until there are no more results. +/// Consistency of the result is not guaranteed if objects are inserted or removed while this +/// operation is executing. All results are buffered in memory. +/// listAll(completion:) is only available for projects using Firebase Rules Version 2. +/// \param completion A completion handler that will be invoked with all items and prefixes under +/// the current StorageReference. +/// +- (void)listAllWithCompletion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; +/// List up to maxResults items (files) and prefixes (folders) under this StorageReference. +/// “/” is treated as a path delimiter. Firebase Storage does not support unsupported object +/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be +/// filtered. +/// list(maxResults:completion:) is only available for projects using Firebase Rules Version 2. +/// \param maxResults The maximum number of results to return in a single page. Must be greater +/// than 0 and at most 1000. +/// +/// \param completion A completion handler that will be invoked with up to maxResults items and +/// prefixes under the current StorageReference. +/// +- (void)listWithMaxResults:(int64_t)maxResults completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; +/// Resumes a previous call to list(maxResults:completion:), starting after a pagination token. +/// Returns the next set of items (files) and prefixes (folders) under this StorageReference. +/// “/” is treated as a path delimiter. Storage does not support unsupported object +/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be +/// filtered. +/// list(maxResults:pageToken:completion:)is only available for projects using Firebase Rules +/// Version 2. +/// \param maxResults The maximum number of results to return in a single page. Must be greater +/// than 0 and at most 1000. +/// +/// \param pageToken A page token from a previous call to list. +/// +/// \param completion A completion handler that will be invoked with the next items and prefixes +/// under the current StorageReference. +/// +- (void)listWithMaxResults:(int64_t)maxResults pageToken:(NSString * _Nonnull)pageToken completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; +/// Retrieves metadata associated with an object at the current path. +/// \param completion A completion block which returns the object metadata on success, +/// or an error on failure. +/// +- (void)metadataWithCompletion:(void (^ _Nonnull)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +/// Updates the metadata associated with an object at the current path. +/// \param metadata A StorageMetadata object with the metadata to update. +/// +/// \param completion A completion block which returns the StorageMetadata on success, +/// or an error on failure. +/// +- (void)updateMetadata:(FIRStorageMetadata * _Nonnull)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +/// Deletes the object at the current path. +/// \param completion A completion block which returns a nonnull error on failure. +/// +- (void)deleteWithCompletion:(void (^ _Nullable)(NSError * _Nullable))completion; +- (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; +- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; +@property (nonatomic, readonly) NSUInteger hash; +@property (nonatomic, readonly, copy) NSString * _Nonnull description; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + + + + +@class NSProgress; + +/// StorageTaskSnapshot represents an immutable view of a task. +/// A snapshot contains a task, storage reference, metadata (if it exists), +/// progress, and an error (if one occurred). +SWIFT_CLASS_NAMED("StorageTaskSnapshot") +@interface FIRStorageTaskSnapshot : NSObject +/// The task this snapshot represents. +@property (nonatomic, readonly, strong) FIRStorageTask * _Nonnull task; +/// Metadata returned by the task, or nil if no metadata returned. +@property (nonatomic, readonly, strong) FIRStorageMetadata * _Nullable metadata; +/// The StorageReference this task operates on. +@property (nonatomic, readonly, strong) FIRStorageReference * _Nonnull reference; +/// An object which tracks the progress of an upload or download. +@property (nonatomic, readonly, strong) NSProgress * _Nullable progress; +/// An error raised during task execution, or nil if no error occurred. +@property (nonatomic, readonly) NSError * _Nullable error; +/// The status of the task. +@property (nonatomic, readonly) enum FIRStorageTaskStatus status; +@property (nonatomic, readonly, copy) NSString * _Nonnull description; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", open) { + FIRStorageTaskStatusUnknown = 0, + FIRStorageTaskStatusResume = 1, + FIRStorageTaskStatusProgress = 2, + FIRStorageTaskStatusPause = 3, + FIRStorageTaskStatusSuccess = 4, + FIRStorageTaskStatusFailure = 5, +}; + + +/// StorageUploadTask implements resumable uploads to a file in Firebase Storage. +/// Uploads can be returned on completion with a completion callback, and can be monitored +/// by attaching observers, or controlled by calling pause(), resume(), +/// or cancel(). +/// Uploads can be initialized from Data in memory, or a URL to a file on disk. +/// Uploads are performed on a background queue, and callbacks are raised on the developer +/// specified callbackQueue in Storage, or the main queue if unspecified. +/// Currently all uploads must be initiated and managed on the main queue. +SWIFT_CLASS_NAMED("StorageUploadTask") +@interface FIRStorageUploadTask : FIRStorageObservableTask +/// Prepares a task and begins execution. +- (void)enqueue; +/// Pauses a task currently in progress. +- (void)pause; +/// Cancels a task. +- (void)cancel; +/// Resumes a paused task. +- (void)resume; +@end + +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef FIREBASESTORAGE_SWIFT_H +#define FIREBASESTORAGE_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -#else -#define OBJC_DESIGNATED_INITIALIZER -#endif +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif #endif #if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -#else -#define SWIFT_ENUM_ATTR(_extensibility) -#endif +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif #endif #if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) -#endif +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT +#endif +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} #endif #endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" @@ -211,132 +1066,125 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); @import ObjectiveC; #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol(language = "Swift", defined_in = "FirebaseStorage", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseStorage",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) @class NSString; @class FIRApp; @class FIRStorageReference; /// Firebase Storage is a service that supports uploading and downloading binary objects, -/// such as images, videos, and other files to Google Cloud Storage. Instances of -/// Storage are not thread-safe. If you call Storage.storage(), the -/// instance will initialize with the default FirebaseApp, +/// such as images, videos, and other files to Google Cloud Storage. Instances of Storage +/// are not thread-safe. +/// If you call Storage.storage(), the instance will initialize with the default FirebaseApp, /// FirebaseApp.app(), and the storage location will come from the provided /// GoogleService-Info.plist. /// If you provide a custom instance of FirebaseApp, -/// the storage location will be specified via the FirebaseOptions.storageBucket -/// property. +/// the storage location will be specified via the FirebaseOptions.storageBucket property. SWIFT_CLASS_NAMED("Storage") @interface FIRStorage : NSObject /// The default Storage instance. /// /// returns: /// An instance of Storage, configured with the default FirebaseApp. -+ (FIRStorage *_Nonnull)storage SWIFT_WARN_UNUSED_RESULT; -/// A method used to create Storage instances initialized with a custom storage bucket -/// URL. Any StorageReferences generated from this instance of Storage -/// will reference files and directories within the specified bucket. \param url The -/// gs:// URL to your Firebase Storage bucket. ++ (FIRStorage * _Nonnull)storage SWIFT_WARN_UNUSED_RESULT; +/// A method used to create Storage instances initialized with a custom storage bucket URL. +/// Any StorageReferences generated from this instance of Storage will reference files +/// and directories within the specified bucket. +/// \param url The gs:// URL to your Firebase Storage bucket. /// /// /// returns: /// A Storage instance, configured with the custom storage bucket. -+ (FIRStorage *_Nonnull)storageWithURL:(NSString *_Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates an instance of Storage, configured with a custom FirebaseApp. -/// StorageReferences generated from a resulting instance will reference files in the -/// Firebase project associated with custom FirebaseApp. \param app The custom -/// FirebaseApp used for initialization. ++ (FIRStorage * _Nonnull)storageWithURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom FirebaseApp. StorageReferences +/// generated from a resulting instance will reference files in the Firebase project +/// associated with custom FirebaseApp. +/// \param app The custom FirebaseApp used for initialization. /// /// /// returns: /// A Storage instance, configured with the custom FirebaseApp. -+ (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app SWIFT_WARN_UNUSED_RESULT; -/// Creates an instance of Storage, configured with a custom FirebaseApp -/// and a custom storage bucket URL. \param app The custom FirebaseApp used for -/// initialization. ++ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom FirebaseApp and a custom storage +/// bucket URL. +/// \param app The custom FirebaseApp used for initialization. /// /// \param url The gs:// url to your Firebase Storage bucket. /// /// /// returns: -/// the Storage instance, configured with the custom FirebaseApp and -/// storage bucket URL. -+ (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app - URL:(NSString *_Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// the Storage instance, configured with the custom FirebaseApp and storage bucket URL. ++ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app URL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; /// The FirebaseApp associated with this Storage instance. -@property(nonatomic, readonly, strong) FIRApp *_Nonnull app; +@property (nonatomic, readonly, strong) FIRApp * _Nonnull app; /// The maximum time in seconds to retry an upload if a failure occurs. /// Defaults to 10 minutes (600 seconds). -@property(nonatomic) NSTimeInterval maxUploadRetryTime; +@property (nonatomic) NSTimeInterval maxUploadRetryTime; /// The maximum time in seconds to retry a download if a failure occurs. /// Defaults to 10 minutes (600 seconds). -@property(nonatomic) NSTimeInterval maxDownloadRetryTime; -/// The maximum time in seconds to retry operations other than upload and download if a failure -/// occurs. Defaults to 2 minutes (120 seconds). -@property(nonatomic) NSTimeInterval maxOperationRetryTime; -/// Specify the maximum upload chunk size. Values less than 256K (262144) will be rounded up to -/// 256K. Values above 256K will be rounded down to the nearest 256K multiple. The default is no -/// maximum. -@property(nonatomic) int64_t uploadChunkSizeBytes; -/// A DispatchQueue that all developer callbacks are fired on. Defaults to the main -/// queue. -@property(nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue; +@property (nonatomic) NSTimeInterval maxDownloadRetryTime; +/// The maximum time in seconds to retry operations other than upload and download if a failure occurs. +/// Defaults to 2 minutes (120 seconds). +@property (nonatomic) NSTimeInterval maxOperationRetryTime; +/// Specify the maximum upload chunk size. Values less than 256K (262144) will be rounded up to 256K. Values +/// above 256K will be rounded down to the nearest 256K multiple. The default is no maximum. +@property (nonatomic) int64_t uploadChunkSizeBytes; +/// A DispatchQueue that all developer callbacks are fired on. Defaults to the main queue. +@property (nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue; /// Creates a StorageReference initialized at the root Firebase Storage location. /// /// returns: /// An instance of StorageReference referencing the root of the storage bucket. -- (FIRStorageReference *_Nonnull)reference SWIFT_WARN_UNUSED_RESULT; -/// Creates a StorageReference given a gs://, http://, or -/// https:// URL pointing to a Firebase Storage location. For example, you can pass in -/// an https:// download URL retrieved from +- (FIRStorageReference * _Nonnull)reference SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference given a gs://, http://, or https:// URL pointing to a +/// Firebase Storage location. For example, you can pass in an https:// download URL retrieved from /// StorageReference.downloadURL(completion:) or the gs:// URL from /// StorageReference.description. /// \param url A gs // or https:// URL to initialize the reference with. /// /// /// throws: -/// Throws a fatal error if url is not associated with the FirebaseApp -/// used to initialize this Storage instance. +/// Throws a fatal error if url is not associated with the FirebaseApp used to initialize +/// this Storage instance. /// /// returns: /// An instance of StorageReference at the given child path. -- (FIRStorageReference *_Nonnull)referenceForURL:(NSString *_Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates a StorageReference initialized at a location specified by the -/// path parameter. \param path A relative path from the root of the storage bucket, +- (FIRStorageReference * _Nonnull)referenceForURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference initialized at a location specified by the path parameter. +/// \param path A relative path from the root of the storage bucket, /// for instance @“path/to/object”. /// /// /// returns: /// An instance of StorageReference pointing to the given path. -- (FIRStorageReference *_Nonnull)referenceWithPath:(NSString *_Nonnull)path - SWIFT_WARN_UNUSED_RESULT; +- (FIRStorageReference * _Nonnull)referenceWithPath:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; /// Configures the Storage SDK to use an emulated backend instead of the default remote backend. -/// This method should be called before invoking any other methods on a new instance of -/// Storage. -- (void)useEmulatorWithHost:(NSString *_Nonnull)host port:(NSInteger)port; +/// This method should be called before invoking any other methods on a new instance of Storage. +- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property(nonatomic, readonly) NSUInteger hash; +@property (nonatomic, readonly) NSUInteger hash; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end + /// Defines task operations such as pause, resume, cancel, and enqueue for all tasks. /// All tasks are required to implement enqueue, which begins the task, and may optionally /// implement pause, resume, and cancel, which operate on the task to pause, resume, and cancel @@ -357,24 +1205,26 @@ SWIFT_PROTOCOL_NAMED("StorageTaskManagement") @class FIRStorageTaskSnapshot; /// A superclass to all Storage tasks, including StorageUploadTask -/// and StorageDownloadTask, to provide state transitions, event raising, and common -/// storage for metadata and errors. Callbacks are always fired on the developer-specified callback -/// queue. If no queue is specified, it defaults to the main queue. This class is not thread safe, -/// so only call methods on the main thread. +/// and StorageDownloadTask, to provide state transitions, event raising, and common storage +/// for metadata and errors. +/// Callbacks are always fired on the developer-specified callback queue. +/// If no queue is specified, it defaults to the main queue. +/// This class is not thread safe, so only call methods on the main thread. SWIFT_CLASS_NAMED("StorageTask") @interface FIRStorageTask : NSObject /// An immutable view of the task and associated metadata, progress, error, etc. -@property(nonatomic, readonly, strong) FIRStorageTaskSnapshot *_Nonnull snapshot; +@property (nonatomic, readonly, strong) FIRStorageTaskSnapshot * _Nonnull snapshot; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end enum FIRStorageTaskStatus : NSInteger; -/// An extended StorageTask providing observable semantics that can be used for -/// responding to changes in task state. Observers produce a StorageHandle, which is -/// used to keep track of and remove specific observers at a later date. This class is not thread -/// safe and can only be called on the main thread. +/// An extended StorageTask providing observable semantics that can be used for responding to changes +/// in task state. +/// Observers produce a StorageHandle, which is used to keep track of and remove specific +/// observers at a later date. +/// This class is not thread safe and can only be called on the main thread. SWIFT_CLASS_NAMED("StorageObservableTask") @interface FIRStorageObservableTask : FIRStorageTask /// Observes changes in the upload status: Resume, Pause, Progress, Success, and Failure. @@ -386,12 +1236,11 @@ SWIFT_CLASS_NAMED("StorageObservableTask") /// /// returns: /// A task handle that can be used to remove the observer at a later date. -- (NSString *_Nonnull)observeStatus:(enum FIRStorageTaskStatus)status - handler:(void (^_Nonnull)(FIRStorageTaskSnapshot *_Nonnull))handler; +- (NSString * _Nonnull)observeStatus:(enum FIRStorageTaskStatus)status handler:(void (^ _Nonnull)(FIRStorageTaskSnapshot * _Nonnull))handler; /// Removes the single observer with the provided handle. -/// \param handle The handle of the task to remove. +/// \param handle The handle of the task to remove. /// -- (void)removeObserverWithHandle:(NSString *_Nonnull)handle; +- (void)removeObserverWithHandle:(NSString * _Nonnull)handle; /// Removes all observers for a single status. /// \param status A StorageTaskStatus to remove all listeners for. /// @@ -400,14 +1249,15 @@ SWIFT_CLASS_NAMED("StorageObservableTask") - (void)removeAllObservers; @end -/// StorageDownloadTask implements resumable downloads from an object in Firebase -/// Storage. Downloads can be returned on completion with a completion handler, and can be monitored + +/// StorageDownloadTask implements resumable downloads from an object in Firebase Storage. +/// Downloads can be returned on completion with a completion handler, and can be monitored /// by attaching observers, or controlled by calling pause(), resume(), /// or cancel(). -/// Downloads can currently be returned as Data in memory, or as a URL to -/// a file on disk. Downloads are performed on a background queue, and callbacks are raised on the -/// developer specified callbackQueue in Storage, or the main queue if left -/// unspecified. Currently all downloads must be initiated and managed on the main queue. +/// Downloads can currently be returned as Data in memory, or as a URL to a file on disk. +/// Downloads are performed on a background queue, and callbacks are raised on the developer +/// specified callbackQueue in Storage, or the main queue if left unspecified. +/// Currently all downloads must be initiated and managed on the main queue. SWIFT_CLASS_NAMED("StorageDownloadTask") @interface FIRStorageDownloadTask : FIRStorageObservableTask /// Prepares a task and begins execution. @@ -424,21 +1274,22 @@ SWIFT_CLASS_NAMED("StorageDownloadTask") /// For more information on unwrapping GCS errors, see the GCS errors docs: /// https://cloud.google.com/storage/docs/json_api/v1/status-codes /// This is never publicly exposed to end developers (as they will simply see an NSError). -typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", open){ - FIRStorageErrorCodeUnknown = -13000, - FIRStorageErrorCodeObjectNotFound = -13010, - FIRStorageErrorCodeBucketNotFound = -13011, - FIRStorageErrorCodeProjectNotFound = -13012, - FIRStorageErrorCodeQuotaExceeded = -13013, - FIRStorageErrorCodeUnauthenticated = -13020, - FIRStorageErrorCodeUnauthorized = -13021, - FIRStorageErrorCodeRetryLimitExceeded = -13030, - FIRStorageErrorCodeNonMatchingChecksum = -13031, - FIRStorageErrorCodeDownloadSizeExceeded = -13032, - FIRStorageErrorCodeCancelled = -13040, - FIRStorageErrorCodeInvalidArgument = -13050, +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", open) { + FIRStorageErrorCodeUnknown = -13000, + FIRStorageErrorCodeObjectNotFound = -13010, + FIRStorageErrorCodeBucketNotFound = -13011, + FIRStorageErrorCodeProjectNotFound = -13012, + FIRStorageErrorCodeQuotaExceeded = -13013, + FIRStorageErrorCodeUnauthenticated = -13020, + FIRStorageErrorCodeUnauthorized = -13021, + FIRStorageErrorCodeRetryLimitExceeded = -13030, + FIRStorageErrorCodeNonMatchingChecksum = -13031, + FIRStorageErrorCodeDownloadSizeExceeded = -13032, + FIRStorageErrorCodeCancelled = -13040, + FIRStorageErrorCodeInvalidArgument = -13050, }; -static NSString *_Nonnull const FIRStorageErrorCodeDomain = @"FirebaseStorage.StorageErrorCode"; +static NSString * _Nonnull const FIRStorageErrorCodeDomain = @"FirebaseStorage.StorageErrorCode"; + /// Contains the prefixes and items returned by a StorageReference.list() call. SWIFT_CLASS_NAMED("StorageListResult") @@ -447,18 +1298,18 @@ SWIFT_CLASS_NAMED("StorageListResult") /// /// returns: /// A list of prefixes (folders). -@property(nonatomic, readonly, copy) NSArray *_Nonnull prefixes; +@property (nonatomic, readonly, copy) NSArray * _Nonnull prefixes; /// The objects (files) returned by a list() operation. /// /// returns: /// A page token if more results are available. -@property(nonatomic, readonly, copy) NSArray *_Nonnull items; -/// Returns a token that can be used to resume a previous list() operation. -/// nil indicates that there are no more results. +@property (nonatomic, readonly, copy) NSArray * _Nonnull items; +/// Returns a token that can be used to resume a previous list() operation. nil +/// indicates that there are no more results. /// /// returns: /// A page token if more results are available. -@property(nonatomic, readonly, copy) NSString *_Nullable pageToken; +@property (nonatomic, readonly, copy) NSString * _Nullable pageToken; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @@ -474,85 +1325,82 @@ SWIFT_CLASS_NAMED("StorageListResult") SWIFT_CLASS_NAMED("StorageMetadata") @interface FIRStorageMetadata : NSObject /// The name of the bucket containing this object. -@property(nonatomic, readonly, copy) NSString *_Nonnull bucket; +@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; /// Cache-Control directive for the object data. -@property(nonatomic, copy) NSString *_Nullable cacheControl; +@property (nonatomic, copy) NSString * _Nullable cacheControl; /// Content-Disposition of the object data. -@property(nonatomic, copy) NSString *_Nullable contentDisposition; +@property (nonatomic, copy) NSString * _Nullable contentDisposition; /// Content-Encoding of the object data. -@property(nonatomic, copy) NSString *_Nullable contentEncoding; +@property (nonatomic, copy) NSString * _Nullable contentEncoding; /// Content-Language of the object data. -@property(nonatomic, copy) NSString *_Nullable contentLanguage; +@property (nonatomic, copy) NSString * _Nullable contentLanguage; /// Content-Type of the object data. -@property(nonatomic, copy) NSString *_Nullable contentType; +@property (nonatomic, copy) NSString * _Nullable contentType; /// MD5 hash of the data; encoded using base64. -@property(nonatomic, readonly, copy) NSString *_Nullable md5Hash; +@property (nonatomic, readonly, copy) NSString * _Nullable md5Hash; /// The content generation of this object. Used for object versioning. -@property(nonatomic, readonly) int64_t generation; +@property (nonatomic, readonly) int64_t generation; /// User-provided metadata, in key/value pairs. -@property(nonatomic, copy) NSDictionary *_Nullable customMetadata; +@property (nonatomic, copy) NSDictionary * _Nullable customMetadata; /// The version of the metadata for this object at this generation. Used /// for preconditions and for detecting changes in metadata. A metageneration number is only /// meaningful in the context of a particular generation of a particular object. -@property(nonatomic, readonly) int64_t metageneration; +@property (nonatomic, readonly) int64_t metageneration; /// The name of this object, in gs://bucket/path/to/object.txt, this is object.txt. -@property(nonatomic, readonly, copy) NSString *_Nullable name; +@property (nonatomic, readonly, copy) NSString * _Nullable name; /// The full path of this object, in gs://bucket/path/to/object.txt, this is path/to/object.txt. -@property(nonatomic, readonly, copy) NSString *_Nullable path; +@property (nonatomic, readonly, copy) NSString * _Nullable path; /// Content-Length of the data in bytes. -@property(nonatomic, readonly) int64_t size; +@property (nonatomic, readonly) int64_t size; /// The creation time of the object in RFC 3339 format. -@property(nonatomic, readonly, copy) NSDate *_Nullable timeCreated; +@property (nonatomic, readonly, copy) NSDate * _Nullable timeCreated; /// The modification time of the object metadata in RFC 3339 format. -@property(nonatomic, readonly, copy) NSDate *_Nullable updated; +@property (nonatomic, readonly, copy) NSDate * _Nullable updated; /// Never used API -@property(nonatomic, readonly, strong) - FIRStorageReference *_Nullable storageReference SWIFT_DEPRECATED; +@property (nonatomic, readonly, strong) FIRStorageReference * _Nullable storageReference SWIFT_DEPRECATED; /// Creates a Dictionary from the contents of the metadata. /// @return A Dictionary that represents the contents of the metadata. -- (NSDictionary *_Nonnull)dictionaryRepresentation SWIFT_WARN_UNUSED_RESULT; +- (NSDictionary * _Nonnull)dictionaryRepresentation SWIFT_WARN_UNUSED_RESULT; /// Determines if the current metadata represents a “file”. -@property(nonatomic, readonly) BOOL isFile; +@property (nonatomic, readonly) BOOL isFile; /// Determines if the current metadata represents a “folder”. -@property(nonatomic, readonly) BOOL isFolder; +@property (nonatomic, readonly) BOOL isFolder; - (nonnull instancetype)init; /// Creates an instance of StorageMetadata from the contents of a dictionary. /// @return An instance of StorageMetadata that represents the contents of a dictionary. -- (nonnull instancetype)initWithDictionary: - (NSDictionary *_Nonnull)dictionary OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary OBJC_DESIGNATED_INITIALIZER; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property(nonatomic, readonly) NSUInteger hash; -@property(nonatomic, readonly, copy) NSString *_Nonnull description; +@property (nonatomic, readonly) NSUInteger hash; +@property (nonatomic, readonly, copy) NSString * _Nonnull description; @end + @class NSData; @class FIRStorageUploadTask; @class NSURL; -/// StorageReference represents a reference to a Google Cloud Storage object. -/// Developers can upload and download objects, as well as get/set object metadata, and delete an -/// object at the path. See the Cloud docs for more details: https://cloud.google.com/storage/ +/// StorageReference represents a reference to a Google Cloud Storage object. Developers can +/// upload and download objects, as well as get/set object metadata, and delete an object at the +/// path. See the Cloud docs for more details: https://cloud.google.com/storage/ SWIFT_CLASS_NAMED("StorageReference") @interface FIRStorageReference : NSObject /// The Storage service object which created this reference. -@property(nonatomic, readonly, strong) FIRStorage *_Nonnull storage; +@property (nonatomic, readonly, strong) FIRStorage * _Nonnull storage; /// The name of the Google Cloud Storage bucket associated with this reference. /// For example, in gs://bucket/path/to/object.txt, the bucket would be ‘bucket’. -@property(nonatomic, readonly, copy) NSString *_Nonnull bucket; +@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; /// The full path to this object, not including the Google Cloud Storage bucket. -/// In gs://bucket/path/to/object.txt, the full path would be: -/// path/to/object.txt -@property(nonatomic, readonly, copy) NSString *_Nonnull fullPath; +/// In gs://bucket/path/to/object.txt, the full path would be: path/to/object.txt +@property (nonatomic, readonly, copy) NSString * _Nonnull fullPath; /// The short name of the object associated with this reference. -/// In gs://bucket/path/to/object.txt, the name of the object would be -/// object.txt. -@property(nonatomic, readonly, copy) NSString *_Nonnull name; +/// In gs://bucket/path/to/object.txt, the name of the object would be object.txt. +@property (nonatomic, readonly, copy) NSString * _Nonnull name; /// Creates a new StorageReference pointing to the root object. /// /// returns: /// A new StorageReference pointing to the root object. -- (FIRStorageReference *_Nonnull)root SWIFT_WARN_UNUSED_RESULT; +- (FIRStorageReference * _Nonnull)root SWIFT_WARN_UNUSED_RESULT; /// Creates a new StorageReference pointing to the parent of the current reference /// or nil if this instance references the root location. /// For example: @@ -562,7 +1410,7 @@ SWIFT_CLASS_NAMED("StorageReference") /// /// returns: /// A new StorageReference pointing to the parent of the current reference. -- (FIRStorageReference *_Nullable)parent SWIFT_WARN_UNUSED_RESULT; +- (FIRStorageReference * _Nullable)parent SWIFT_WARN_UNUSED_RESULT; /// Creates a new StorageReference pointing to a child object of the current reference. /// path = foo child = bar newPath = foo/bar /// path = foo/bar child = baz ntask.impl.snapshotwPath = foo/bar/baz @@ -571,12 +1419,12 @@ SWIFT_CLASS_NAMED("StorageReference") /// child = /foo/bar newPath = foo/bar /// child = foo/bar/ newPath = foo/bar /// child = foo///bar newPath = foo/bar -/// \param path The path to append to the current path. +/// \param path The path to append to the current path. /// /// /// returns: /// A new StorageReference pointing to a child location of the current reference. -- (FIRStorageReference *_Nonnull)child:(NSString *_Nonnull)path SWIFT_WARN_UNUSED_RESULT; +- (FIRStorageReference * _Nonnull)child:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; /// Asynchronously uploads data to the currently specified StorageReference, /// without additional metadata. /// This is not recommended for large files, and one should instead upload a file from disk. @@ -587,19 +1435,16 @@ SWIFT_CLASS_NAMED("StorageReference") /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the -/// upload. -- (FIRStorageUploadTask *_Nonnull)putData:(NSData *_Nonnull)uploadData - metadata:(FIRStorageMetadata *_Nullable)metadata; +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata; /// Asynchronously uploads data to the currently specified StorageReference. /// This is not recommended for large files, and one should instead upload a file from disk. -/// \param uploadData The data to upload. +/// \param uploadData The data to upload. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the -/// upload. -- (FIRStorageUploadTask *_Nonnull)putData:(NSData *_Nonnull)uploadData; +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData; /// Asynchronously uploads data to the currently specified StorageReference. /// This is not recommended for large files, and one should instead upload a file from disk. /// \param uploadData The data to upload. @@ -612,12 +1457,8 @@ SWIFT_CLASS_NAMED("StorageReference") /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the -/// upload. -- (FIRStorageUploadTask *_Nonnull)putData:(NSData *_Nonnull)uploadData - metadata:(FIRStorageMetadata *_Nullable)metadata - completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, - NSError *_Nullable))completion; +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; /// Asynchronously uploads a file to the currently specified StorageReference. /// putData should be used instead of putFile in Extensions. /// \param fileURL A URL representing the system file path of the object to be uploaded. @@ -627,16 +1468,14 @@ SWIFT_CLASS_NAMED("StorageReference") /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the -/// upload. -- (FIRStorageUploadTask *_Nonnull)putFile:(NSURL *_Nonnull)fileURL - metadata:(FIRStorageMetadata *_Nullable)metadata; +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata; /// Asynchronously uploads a file to the currently specified StorageReference, /// without additional metadata. /// putData should be used instead of putFile in Extensions. /// @param fileURL A URL representing the system file path of the object to be uploaded. /// @return An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask *_Nonnull)putFile:(NSURL *_Nonnull)fileURL; +- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL; /// Asynchronously uploads a file to the currently specified StorageReference. /// putData should be used instead of putFile in Extensions. /// \param fileURL A URL representing the system file path of the object to be uploaded. @@ -649,18 +1488,13 @@ SWIFT_CLASS_NAMED("StorageReference") /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the -/// upload. -- (FIRStorageUploadTask *_Nonnull)putFile:(NSURL *_Nonnull)fileURL - metadata:(FIRStorageMetadata *_Nullable)metadata - completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, - NSError *_Nullable))completion; -/// Asynchronously downloads the object at the StorageReference to a Data -/// instance in memory. A Data buffer of the provided max size will be allocated, so -/// ensure that the device has enough free memory to complete the download. For downloading large -/// files, write(toFile:) may be a better option. \param maxSize The maximum size in -/// bytes to download. If the download exceeds this size, the task will be cancelled and an error -/// will be returned. +/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. +- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +/// Asynchronously downloads the object at the StorageReference to a Data instance in memory. +/// A Data buffer of the provided max size will be allocated, so ensure that the device has enough free +/// memory to complete the download. For downloading large files, write(toFile:) may be a better option. +/// \param maxSize The maximum size in bytes to download. If the download exceeds this size, +/// the task will be cancelled and an error will be returned. /// /// \param completion A completion block that either returns the object data on success, /// or an error on failure. @@ -668,27 +1502,23 @@ SWIFT_CLASS_NAMED("StorageReference") /// /// returns: /// An StorageDownloadTask that can be used to monitor or manage the download. -- (FIRStorageDownloadTask *_Nonnull) - dataWithMaxSize:(int64_t)maxSize - completion:(void (^_Nonnull)(NSData *_Nullable, NSError *_Nullable))completion; +- (FIRStorageDownloadTask * _Nonnull)dataWithMaxSize:(int64_t)maxSize completion:(void (^ _Nonnull)(NSData * _Nullable, NSError * _Nullable))completion; /// Asynchronously retrieves a long lived download URL with a revokable token. /// This can be used to share the file with others, but can be revoked by a developer /// in the Firebase Console. -/// \param completion A completion block that either returns the URL on success, +/// \param completion A completion block that either returns the URL on success, /// or an error on failure. /// -- (void)downloadURLWithCompletion:(void (^_Nonnull)(NSURL *_Nullable, - NSError *_Nullable))completion; +- (void)downloadURLWithCompletion:(void (^ _Nonnull)(NSURL * _Nullable, NSError * _Nullable))completion; /// Asynchronously downloads the object at the current path to a specified system filepath. ///
      ///
    • -/// Returns An StorageDownloadTask that can be used to monitor or manage the -/// download. +/// Returns An StorageDownloadTask that can be used to monitor or manage the download. ///
    • ///
    -/// \param fileURL A file system URL representing the path the object should be downloaded to. +/// \param fileURL A file system URL representing the path the object should be downloaded to. /// -- (FIRStorageDownloadTask *_Nonnull)writeToFile:(NSURL *_Nonnull)fileURL; +- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL; /// Asynchronously downloads the object at the current path to a specified system filepath. /// \param fileURL A file system URL representing the path the object should be downloaded to. /// @@ -699,76 +1529,72 @@ SWIFT_CLASS_NAMED("StorageReference") /// /// returns: /// A StorageDownloadTask that can be used to monitor or manage the download. -- (FIRStorageDownloadTask *_Nonnull)writeToFile:(NSURL *_Nonnull)fileURL - completion:(void (^_Nullable)(NSURL *_Nullable, - NSError *_Nullable))completion; +- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL completion:(void (^ _Nullable)(NSURL * _Nullable, NSError * _Nullable))completion; /// Lists all items (files) and prefixes (folders) under this StorageReference. -/// This is a helper method for calling list() repeatedly until there are no more -/// results. Consistency of the result is not guaranteed if objects are inserted or removed while -/// this operation is executing. All results are buffered in memory. +/// This is a helper method for calling list() repeatedly until there are no more results. +/// Consistency of the result is not guaranteed if objects are inserted or removed while this +/// operation is executing. All results are buffered in memory. /// listAll(completion:) is only available for projects using Firebase Rules Version 2. -/// \param completion A completion handler that will be invoked with all items and prefixes under +/// \param completion A completion handler that will be invoked with all items and prefixes under /// the current StorageReference. /// -- (void)listAllWithCompletion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, - NSError *_Nullable))completion; -/// List up to maxResults items (files) and prefixes (folders) under this -/// StorageReference. “/” is treated as a path delimiter. Firebase Storage does not support -/// unsupported object paths that end with “/” or contain two consecutive “/“s. All invalid objects -/// in GCS will be filtered. list(maxResults:completion:) is only available for -/// projects using Firebase Rules Version 2. \param maxResults The maximum number of results to -/// return in a single page. Must be greater than 0 and at most 1000. -/// -/// \param completion A completion handler that will be invoked with up to maxResults -/// items and prefixes under the current StorageReference. -/// -- (void)listWithMaxResults:(int64_t)maxResults - completion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, - NSError *_Nullable))completion; -/// Resumes a previous call to list(maxResults:completion:), starting after a -/// pagination token. Returns the next set of items (files) and prefixes (folders) under this -/// StorageReference. “/” is treated as a path delimiter. Storage does not support -/// unsupported object paths that end with “/” or contain two consecutive “/“s. All invalid objects -/// in GCS will be filtered. list(maxResults:pageToken:completion:)is only available -/// for projects using Firebase Rules Version 2. \param maxResults The maximum number of results to -/// return in a single page. Must be greater than 0 and at most 1000. +- (void)listAllWithCompletion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; +/// List up to maxResults items (files) and prefixes (folders) under this StorageReference. +/// “/” is treated as a path delimiter. Firebase Storage does not support unsupported object +/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be +/// filtered. +/// list(maxResults:completion:) is only available for projects using Firebase Rules Version 2. +/// \param maxResults The maximum number of results to return in a single page. Must be greater +/// than 0 and at most 1000. +/// +/// \param completion A completion handler that will be invoked with up to maxResults items and +/// prefixes under the current StorageReference. +/// +- (void)listWithMaxResults:(int64_t)maxResults completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; +/// Resumes a previous call to list(maxResults:completion:), starting after a pagination token. +/// Returns the next set of items (files) and prefixes (folders) under this StorageReference. +/// “/” is treated as a path delimiter. Storage does not support unsupported object +/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be +/// filtered. +/// list(maxResults:pageToken:completion:)is only available for projects using Firebase Rules +/// Version 2. +/// \param maxResults The maximum number of results to return in a single page. Must be greater +/// than 0 and at most 1000. /// /// \param pageToken A page token from a previous call to list. /// /// \param completion A completion handler that will be invoked with the next items and prefixes /// under the current StorageReference. /// -- (void)listWithMaxResults:(int64_t)maxResults - pageToken:(NSString *_Nonnull)pageToken - completion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, - NSError *_Nullable))completion; +- (void)listWithMaxResults:(int64_t)maxResults pageToken:(NSString * _Nonnull)pageToken completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; /// Retrieves metadata associated with an object at the current path. -/// \param completion A completion block which returns the object metadata on success, +/// \param completion A completion block which returns the object metadata on success, /// or an error on failure. /// -- (void)metadataWithCompletion:(void (^_Nonnull)(FIRStorageMetadata *_Nullable, - NSError *_Nullable))completion; +- (void)metadataWithCompletion:(void (^ _Nonnull)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; /// Updates the metadata associated with an object at the current path. /// \param metadata A StorageMetadata object with the metadata to update. /// /// \param completion A completion block which returns the StorageMetadata on success, /// or an error on failure. /// -- (void)updateMetadata:(FIRStorageMetadata *_Nonnull)metadata - completion: - (void (^_Nullable)(FIRStorageMetadata *_Nullable, NSError *_Nullable))completion; +- (void)updateMetadata:(FIRStorageMetadata * _Nonnull)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; /// Deletes the object at the current path. -/// \param completion A completion block which returns a nonnull error on failure. +/// \param completion A completion block which returns a nonnull error on failure. /// -- (void)deleteWithCompletion:(void (^_Nullable)(NSError *_Nullable))completion; +- (void)deleteWithCompletion:(void (^ _Nullable)(NSError * _Nullable))completion; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property(nonatomic, readonly) NSUInteger hash; -@property(nonatomic, readonly, copy) NSString *_Nonnull description; +@property (nonatomic, readonly) NSUInteger hash; +@property (nonatomic, readonly, copy) NSString * _Nonnull description; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end + + + + @class NSProgress; /// StorageTaskSnapshot represents an immutable view of a task. @@ -777,28 +1603,32 @@ SWIFT_CLASS_NAMED("StorageReference") SWIFT_CLASS_NAMED("StorageTaskSnapshot") @interface FIRStorageTaskSnapshot : NSObject /// The task this snapshot represents. -@property(nonatomic, readonly, strong) FIRStorageTask *_Nonnull task; +@property (nonatomic, readonly, strong) FIRStorageTask * _Nonnull task; /// Metadata returned by the task, or nil if no metadata returned. -@property(nonatomic, readonly, strong) FIRStorageMetadata *_Nullable metadata; +@property (nonatomic, readonly, strong) FIRStorageMetadata * _Nullable metadata; /// The StorageReference this task operates on. -@property(nonatomic, readonly, strong) FIRStorageReference *_Nonnull reference; +@property (nonatomic, readonly, strong) FIRStorageReference * _Nonnull reference; /// An object which tracks the progress of an upload or download. -@property(nonatomic, readonly, strong) NSProgress *_Nullable progress; +@property (nonatomic, readonly, strong) NSProgress * _Nullable progress; /// An error raised during task execution, or nil if no error occurred. -@property(nonatomic, readonly) NSError *_Nullable error; +@property (nonatomic, readonly) NSError * _Nullable error; /// The status of the task. -@property(nonatomic, readonly) enum FIRStorageTaskStatus status; -@property(nonatomic, readonly, copy) NSString *_Nonnull description; +@property (nonatomic, readonly) enum FIRStorageTaskStatus status; +@property (nonatomic, readonly, copy) NSString * _Nonnull description; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end -typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", open){ - FIRStorageTaskStatusUnknown = 0, FIRStorageTaskStatusResume = 1, - FIRStorageTaskStatusProgress = 2, FIRStorageTaskStatusPause = 3, - FIRStorageTaskStatusSuccess = 4, FIRStorageTaskStatusFailure = 5, +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", open) { + FIRStorageTaskStatusUnknown = 0, + FIRStorageTaskStatusResume = 1, + FIRStorageTaskStatusProgress = 2, + FIRStorageTaskStatusPause = 3, + FIRStorageTaskStatusSuccess = 4, + FIRStorageTaskStatusFailure = 5, }; + /// StorageUploadTask implements resumable uploads to a file in Firebase Storage. /// Uploads can be returned on completion with a completion callback, and can be monitored /// by attaching observers, or controlled by calling pause(), resume(), @@ -819,8 +1649,15 @@ SWIFT_CLASS_NAMED("StorageUploadTask") - (void)resume; @end +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/ios_pod/swift_headers/SwiftProtobuf-Swift.h b/ios_pod/swift_headers/SwiftProtobuf-Swift.h index a9edf66a0e..fb5b1f0f2c 100644 --- a/ios_pod/swift_headers/SwiftProtobuf-Swift.h +++ b/ios_pod/swift_headers/SwiftProtobuf-Swift.h @@ -1,246 +1,527 @@ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.12.0. +// Copied from Firebase iOS SDK 10.13.0. -// Generated by Apple Swift version 5.6 (swiftlang-5.6.0.323.62 -// clang-1316.0.20.8) +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) #ifndef SWIFTPROTOBUF_SWIFT_H #define SWIFTPROTOBUF_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -#define __has_include(x) 0 +# define __has_include(x) 0 #endif #if !defined(__has_attribute) -#define __has_attribute(x) 0 +# define __has_attribute(x) 0 #endif #if !defined(__has_feature) -#define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !defined(__has_warning) -#define __has_warning(x) 0 +# define __has_warning(x) 0 #endif #if __has_include() -#include +# include #endif +#pragma clang diagnostic ignored "-Wduplicate-method-match" #pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) #include -#include -#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else #include +#include +#include +#endif #if !defined(SWIFT_TYPEDEFS) -#define SWIFT_TYPEDEFS 1 -#if __has_include() -#include -#elif !defined(__cplusplus) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -#define SWIFT_PASTE_HELPER(x, y) x##y -#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -#define SWIFT_METATYPE(X) Class +# define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -#if __has_feature(objc_class_property) -#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -#else -#define SWIFT_CLASS_PROPERTY(...) -#endif +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif #endif #if __has_attribute(objc_runtime_name) -#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -#define SWIFT_RUNTIME_NAME(X) +# define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -#define SWIFT_COMPILE_NAME(X) +# define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -#define SWIFT_METHOD_FAMILY(X) +# define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -#define SWIFT_NOESCAPE __attribute__((noescape)) +# define SWIFT_NOESCAPE __attribute__((noescape)) #else -#define SWIFT_NOESCAPE +# define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -#define SWIFT_RELEASES_ARGUMENT +# define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -#define SWIFT_WARN_UNUSED_RESULT +# define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -#define SWIFT_NORETURN __attribute__((noreturn)) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_NORETURN +# define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -#define SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -#define SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -#define SWIFT_ENUM_EXTRA +# define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -#if __has_attribute(objc_subclassing_restricted) -#define SWIFT_CLASS(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ - SWIFT_CLASS_EXTRA -#else -#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -#endif +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -#if __has_attribute(objc_class_stub) -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ - SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ - __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -#else -#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -#endif +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif #endif #if !defined(SWIFT_PROTOCOL) -#define SWIFT_PROTOCOL(SWIFT_NAME) \ - SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ - SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -#if __has_attribute(objc_designated_initializer) -#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define OBJC_DESIGNATED_INITIALIZER +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if defined(__cplusplus) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept #endif -#if !defined(SWIFT_ENUM_ATTR) -#if defined(__has_attribute) && __has_attribute(enum_extensibility) -#define SWIFT_ENUM_ATTR(_extensibility) \ - __attribute__((enum_extensibility(_extensibility))) #else -#define SWIFT_ENUM_ATTR(_extensibility) +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif -#if !defined(SWIFT_ENUM) -#define SWIFT_ENUM(_type, _name, _extensibility) \ - enum _name : _type _name; \ - enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -#if __has_feature(generalized_swift_name) -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ - enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ - SWIFT_ENUM_EXTRA _name : _type +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftProtobuf",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +#ifndef SWIFTPROTOBUF_SWIFT_H +#define SWIFTPROTOBUF_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wduplicate-method-match" +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#else +#include +#include +#include +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) #else -#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ - SWIFT_ENUM(_type, _name, _extensibility) +# define SWIFT_NORETURN #endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif #endif #if !defined(SWIFT_UNAVAILABLE) -#define SWIFT_UNAVAILABLE __attribute__((unavailable)) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -#define SWIFT_AVAILABILITY(plat, ...) \ - __attribute__((availability(plat, __VA_ARGS__))) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -#define SWIFT_DEPRECATED __attribute__((deprecated)) +# define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -#define SWIFT_DEPRECATED_OBJC(Msg) \ - __attribute__((diagnose_if(1, Msg, "warning"))) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else -#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif +#if defined(__OBJC__) #if !defined(IBSegueAction) -#define IBSegueAction +# define IBSegueAction +#endif #endif #if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif #if defined(__cplusplus) -#define SWIFT_EXTERN extern "C" +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT noexcept +#endif #else -#define SWIFT_EXTERN extern +#if !defined(SWIFT_NOEXCEPT) +# define SWIFT_NOEXCEPT #endif #endif +#if defined(__cplusplus) +#if !defined(SWIFT_CXX_INT_DEFINED) +#define SWIFT_CXX_INT_DEFINED +namespace swift { +using Int = ptrdiff_t; +using UInt = size_t; +} +#endif +#endif +#if defined(__OBJC__) #if __has_feature(modules) #if __has_warning("-Watimport-in-framework-header") #pragma clang diagnostic ignored "-Watimport-in-framework-header" #endif #endif +#endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -#pragma clang diagnostic ignored "-Wpragma-clang-attribute" +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -#pragma push_macro("any") -#undef any -#pragma clang attribute push( \ - __attribute__((external_source_symbol( \ - language = "Swift", defined_in = "SwiftProtobuf", \ - generated_declaration))), \ - apply_to = any(function, enum, objc_interface, objc_category, \ - objc_protocol)) -#pragma pop_macro("any") +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftProtobuf",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") #endif +#if defined(__OBJC__) +#endif +#if defined(__cplusplus) +#endif #if __has_attribute(external_source_symbol) -#pragma clang attribute pop +# pragma clang attribute pop #endif #pragma clang diagnostic pop #endif + +#else +#error unsupported Swift architecture +#endif diff --git a/messaging/integration_test/Podfile b/messaging/integration_test/Podfile index 7ed460008d..6e4903f8b2 100644 --- a/messaging/integration_test/Podfile +++ b/messaging/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Messaging', '10.12.0' + pod 'Firebase/Messaging', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Messaging', '10.12.0' + pod 'Firebase/Messaging', '10.13.0' end post_install do |installer| diff --git a/messaging/messaging_java/build.gradle b/messaging/messaging_java/build.gradle index 1c510bb14b..5289dac1a8 100644 --- a/messaging/messaging_java/build.gradle +++ b/messaging/messaging_java/build.gradle @@ -55,7 +55,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-messaging' implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0' diff --git a/release_build_files/Android/firebase_dependencies.gradle b/release_build_files/Android/firebase_dependencies.gradle index 72c9ad0c9f..67d8d1120f 100644 --- a/release_build_files/Android/firebase_dependencies.gradle +++ b/release_build_files/Android/firebase_dependencies.gradle @@ -131,7 +131,7 @@ project.afterEvaluate { // Add the bill-of-materials project.dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') } for (String lib : firebaseCpp.dependencies.libSet) { // Messaging includes an aar, which to be depended on properly requires diff --git a/release_build_files/readme.md b/release_build_files/readme.md index e1ff9696b8..788ce32f29 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -86,7 +86,7 @@ distributed as part of the core Firebase Feature | Required Libraries and Gradle Packages -------------------------- | -------------------------------------- -All Firebase SDKs | platform(com.google.firebase:firebase-bom:32.2.0) +All Firebase SDKs | platform(com.google.firebase:firebase-bom:32.2.2) | | (Android Bill of Materials) Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a @@ -228,49 +228,49 @@ Feature | Required Frameworks and Cocoapods -------------------------- | --------------------------------------- Firebase Analytics | firebase_analytics.xcframework | | firebase.xcframework -| | Firebase/Analytics Cocoapod (10.12.0) +| | Firebase/Analytics Cocoapod (10.13.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.12.0) +| | Firebase/AppCheck Cocoapod (10.13.0) Firebase Authentication | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Auth Cocoapod (10.13.0) Firebase Dynamic Links | firebase_dynamic_links.xcframework | | firebase.xcframework -| | Firebase/DynamicLinks Cocoapod (10.12.0) +| | Firebase/DynamicLinks Cocoapod (10.13.0) Cloud Firestore | firebase_firestore.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Firestore Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Firestore Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Firebase Functions | firebase_functions.xcframework | | firebase_auth.xcframework (optional) | | firebase.xcframework -| | Firebase/Functions Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Functions Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Google Mobile Ads | firebase_gma.xcframework | | firebase.xcframework -| | Firebase/CoreOnly Cocoapod (10.12.0) -| | Google-Mobile-Ads-SDK Cocoapod (10.8.0) +| | Firebase/CoreOnly Cocoapod (10.13.0) +| | Google-Mobile-Ads-SDK Cocoapod (10.9.0) Firebase Installations | firebase_installations.xcframework | | firebase.xcframework -| | FirebaseInstallations Cocoapod (10.12.0) +| | FirebaseInstallations Cocoapod (10.13.0) Firebase Cloud Messaging | firebase_messaging.xcframework | | firebase.xcframework -| | Firebase/Messaging Cocoapod (10.12.0) +| | Firebase/Messaging Cocoapod (10.13.0) Firebase Realtime Database | firebase_database.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Database Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Database Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Firebase Remote Config | firebase_remote_config.xcframework | | firebase.xcframework -| | Firebase/RemoteConfig Cocoapod (10.12.0) +| | Firebase/RemoteConfig Cocoapod (10.13.0) Firebase Storage | firebase_storage.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Storage Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Storage Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Important: Each version of the Firebase C++ SDK supports a specific version of the Firebase iOS SDK. Please ensure that you reference the Cocoapod versions @@ -290,49 +290,49 @@ Feature | Required Libraries and Cocoapods -------------------------- | ----------------------------------------- Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a -| | Firebase/Analytics Cocoapod (10.12.0) +| | Firebase/Analytics Cocoapod (10.13.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.12.0) +| | Firebase/AppCheck Cocoapod (10.13.0) Firebase Authentication | libfirebase_auth.a | | libfirebase_app.a -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Auth Cocoapod (10.13.0) Firebase Dynamic Links | libfirebase_dynamic_links.a | | libfirebase_app.a -| | Firebase/DynamicLinks Cocoapod (10.12.0) +| | Firebase/DynamicLinks Cocoapod (10.13.0) Cloud Firestore | libfirebase_firestore.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Firestore Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Firestore Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Firebase Functions | libfirebase_functions.a | | libfirebase_app.a | | libfirebase_auth.a (optional) -| | Firebase/Functions Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Functions Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Google Mobile Ads | libfirebase_gma.a | | libfirebase_app.a -| | Firebase/CoreOnly Cocoapod (10.12.0) -| | Google-Mobile-Ads-SDK Cocoapod (10.8.0) +| | Firebase/CoreOnly Cocoapod (10.13.0) +| | Google-Mobile-Ads-SDK Cocoapod (10.9.0) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a -| | FirebaseInstallations Cocoapod (10.12.0) +| | FirebaseInstallations Cocoapod (10.13.0) Firebase Cloud Messaging | libfirebase_messaging.a | | libfirebase_app.a -| | Firebase/CloudMessaging Cocoapod (10.12.0) +| | Firebase/CloudMessaging Cocoapod (10.13.0) Firebase Realtime Database | libfirebase_database.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Database Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Database Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Firebase Remote Config | libfirebase_remote_config.a | | libfirebase_app.a -| | Firebase/RemoteConfig Cocoapod (10.12.0) +| | Firebase/RemoteConfig Cocoapod (10.13.0) Firebase Storage | libfirebase_storage.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Storage Cocoapod (10.12.0) -| | Firebase/Auth Cocoapod (10.12.0) +| | Firebase/Storage Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.13.0) Important: Each version of the Firebase C++ SDK supports a specific version of the Firebase iOS SDK. Please ensure that you reference the Cocoapod versions @@ -627,6 +627,16 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### 11.4.0 +- Changes + - General (Android): Update to Firebase Android BoM version 32.2.2. + - General (iOS): Update to Firebase Cocoapods version 10.13.0. + - General (iOS): 32-bit iOS builds (i386 and armv7) are no longer supported. + - General: Add FirebaseApp.GetApps(), to return the list of `firebase::App` instances. + - GMA (Android): Fixed a crash when initializing GMA without a Firebase App. + - Firestore: Add support for disjunctions in queries (OR queries) + ([#1335](https://github.com/firebase/firebase-cpp-sdk/pull/1335)). + ### 11.3.0 - Changes - General (Android): Update to Firebase Android BoM version 32.2.0. diff --git a/remote_config/integration_test/Podfile b/remote_config/integration_test/Podfile index 8270b8f5d7..0c0ee247d1 100644 --- a/remote_config/integration_test/Podfile +++ b/remote_config/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/RemoteConfig', '10.12.0' + pod 'Firebase/RemoteConfig', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/RemoteConfig', '10.12.0' + pod 'Firebase/RemoteConfig', '10.13.0' end post_install do |installer| diff --git a/remote_config/remote_config_resources/build.gradle b/remote_config/remote_config_resources/build.gradle index bf99ad1014..cf94b86b23 100644 --- a/remote_config/remote_config_resources/build.gradle +++ b/remote_config/remote_config_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-config' } diff --git a/scripts/gha/build_ios_tvos.py b/scripts/gha/build_ios_tvos.py index 8b4dfa2d75..d314024e58 100644 --- a/scripts/gha/build_ios_tvos.py +++ b/scripts/gha/build_ios_tvos.py @@ -55,11 +55,11 @@ 'firebase_installations', 'firebase_messaging', 'firebase_remote_config', 'firebase_storage'), 'device': { - 'architectures' : ('arm64', 'armv7'), + 'architectures' : ['arm64'], 'toolchain' : 'cmake/toolchains/ios.cmake', }, 'simulator': { - 'architectures' : ('arm64', 'x86_64', 'i386'), + 'architectures' : ['arm64', 'x86_64'], 'toolchain': 'cmake/toolchains/ios_simulator.cmake', } }, @@ -71,12 +71,12 @@ 'firebase_messaging', 'firebase_remote_config', 'firebase_storage'), 'device': { - 'architectures' : ('arm64',), + 'architectures' : ['arm64'], 'toolchain' : 'cmake/toolchains/apple.toolchain.cmake', 'toolchain_platform': 'TVOS', }, 'simulator': { - 'architectures' : ('x86_64',), + 'architectures' : ['x86_64'], 'toolchain' : 'cmake/toolchains/apple.toolchain.cmake', 'toolchain_platform': 'SIMULATOR_TVOS' } @@ -127,7 +127,7 @@ def arrange_frameworks(archive_output_path): def build_universal_framework(frameworks_path, targets): """Create universal frameworks if possible. - If all architectures (eg: arm64, armv7 etc) and platforms (device, simulator) + If all architectures (eg: arm64, etc) and platforms (device, simulator) were built, combine all of the libraries into a single universal framework. Args: frameworks_path (str): Root path containing subdirectories for each @@ -140,7 +140,7 @@ def build_universal_framework(frameworks_path, targets): - firebase.framework - firebase_analytics.framework ... - - simulator-i386 + - simulator-x86_64 ... - tvos - device-arm64 @@ -154,7 +154,7 @@ def build_universal_framework(frameworks_path, targets): - ios - device-arm64 ... - - simulator-i386 + - simulator-x86_64 ... ... - universal <-------------- Newly created @@ -178,7 +178,7 @@ def build_universal_framework(frameworks_path, targets): framework_os_path = os.path.join(frameworks_path, apple_os) # Extract list of all built platform-architecture combinations into a map. # Map looks like this, - # {'device': ['arm64', 'armv7'], 'simulator': ['x86_64']} + # {'device': ['arm64''], 'simulator': ['x86_64']} platform_variant_architecture_dirs = os.listdir(framework_os_path) platform_variant_arch_map = defaultdict(list) for variant_architecture in platform_variant_architecture_dirs: @@ -273,7 +273,7 @@ def build_xcframeworks(frameworks_path, xcframeworks_path, template_info_plist, """Build xcframeworks combining libraries for different operating systems. Combine frameworks for different operating systems (ios, tvos), architectures - (arm64, armv7, x86_64 etc) per platform variant (device, simulator). + (arm64, x86_64 etc) per platform variant (device, simulator). This makes it super convenient for developers to use a single deliverable in XCode and develop for multiple platforms/operating systems in one project. @@ -291,7 +291,7 @@ def build_xcframeworks(frameworks_path, xcframeworks_path, template_info_plist, - firebase.framework - firebase_analytics.framework ... - - simulator-i386 + - simulator-x86_64 ... - tvos - device-arm64 @@ -304,11 +304,11 @@ def build_xcframeworks(frameworks_path, xcframeworks_path, template_info_plist, Output: /xcframeworks <----------- - firebase.xcframework - Info.plist <----------- - - ios-arm64_armv7 <-- + - ios-arm64 <-- - firebase.framework - firebase <---- - Headers <---- - - ios-arm64_i386_x86_64-simulator <--- + - ios-arm64_x86_64-simulator <--- - firebase.framework - firebase - Headers @@ -320,10 +320,10 @@ def build_xcframeworks(frameworks_path, xcframeworks_path, template_info_plist, ... - firebase_auth.xcframework <-- - Info.plist - - ios-arm64_armv7 + - ios-arm64 - firebase_auth.framework - firebase_auth - - ios-arm64_i386_x86_64-simulator + - ios-arm64_x86_64-simulator - firebase_auth.framework - firebase_auth - tvos-arm64 @@ -340,7 +340,7 @@ def build_xcframeworks(frameworks_path, xcframeworks_path, template_info_plist, platform_variant_architecture_dirs = os.listdir(framework_os_path) # Extract list of all built platform-architecture combinations into a map. # Map looks like this, - # {'device': ['arm64', 'armv7'], 'simulator': ['x86_64']} + # {'device': ['arm64'], 'simulator': ['x86_64']} platform_variant_arch_map = defaultdict(list) for variant_architecture in platform_variant_architecture_dirs: # Skip directories not of the format platform-arch (eg: universal) @@ -385,7 +385,7 @@ def build_xcframeworks(frameworks_path, xcframeworks_path, template_info_plist, # device is treated as default platform variant and we do not add any # suffix at the end. For all other variants, add them as suffix. xcframework_key_parts.append(platform_variant) - # Eg: ios-arm64_armv7, tvos-x86_64-simulator + # Eg: ios-arm64, tvos-x86_64-simulator xcframework_key = '-'.join(xcframework_key_parts) # /xcframeworks/.xcframework/-/ @@ -584,7 +584,7 @@ def parse_cmdline_args(): default=('device', 'simulator'), help='List of platforms to build for.') parser.add_argument('-a', '--architecture', nargs='+', - default=('arm64', 'armv7', 'x86_64', 'i386'), + default=('arm64', 'x86_64'), help='List of architectures to build for.') parser.add_argument('-t', '--target', nargs='+', default=( 'firebase_analytics', 'firebase_app_check', diff --git a/scripts/gha/integration_testing/ftl_gha_validator.py b/scripts/gha/integration_testing/ftl_gha_validator.py index 58119d2315..dfa6118ebb 100644 --- a/scripts/gha/integration_testing/ftl_gha_validator.py +++ b/scripts/gha/integration_testing/ftl_gha_validator.py @@ -79,7 +79,18 @@ def _gcs_list_dir(gcs_path): """Recursively returns a list of contents for a directory on GCS.""" args = [GSUTIL, "ls", "-r", gcs_path] logging.info("Listing GCS contents: %s", " ".join(args)) - result = subprocess.run(args=args, capture_output=True, text=True, check=True) + try: + result = subprocess.run(args=args, capture_output=True, text=True, check=True) + except subprocess.CalledProcessError as e: + # It's possible to have a CalledProcessError but still have gotten a file list. + # Check the stdout to see if we got lines that look GCS file paths, and ignore + # the error if so. + output = e.output.splitlines() + if len(output) > 1 and gcs_path in output[0]: + return output + else: + print("Error: %s" % e.stderr) + raise e return result.stdout.splitlines() @@ -88,7 +99,11 @@ def _gcs_read_file(gcs_path): """Extracts the contents of a file on GCS.""" args = [GSUTIL, "cat", gcs_path] logging.info("Reading GCS file: %s", " ".join(args)) - result = subprocess.run(args=args, capture_output=True, text=True, check=True) + try: + result = subprocess.run(args=args, capture_output=True, text=True, check=True) + except subprocess.CalledProcessError as e: + print("Error: %s" % e.stderr) + raise e return result.stdout diff --git a/scripts/gha/integration_testing/gameloop_apple/gameloop/Info.plist b/scripts/gha/integration_testing/gameloop_apple/gameloop/Info.plist index 0b5df7a546..056f2004e6 100644 --- a/scripts/gha/integration_testing/gameloop_apple/gameloop/Info.plist +++ b/scripts/gha/integration_testing/gameloop_apple/gameloop/Info.plist @@ -28,7 +28,7 @@ Main UIRequiredDeviceCapabilities - armv7 + arm64 UISupportedInterfaceOrientations diff --git a/scripts/gha/print_matrix_configuration.py b/scripts/gha/print_matrix_configuration.py index 65f575aa5b..1f73fdf9d4 100644 --- a/scripts/gha/print_matrix_configuration.py +++ b/scripts/gha/print_matrix_configuration.py @@ -174,7 +174,7 @@ "emulator_32bit": {"type": "virtual", "image":"system-images;android-30;google_apis;x86"}, "ios_min": {"type": "ftl", "device": "model=iphone8,version=14.7"}, "ios_target": {"type": "ftl", "device": "model=iphone13pro,version=15.7"}, - "ios_latest": {"type": "ftl", "device": "model=iphone11pro,version=16.3"}, + "ios_latest": {"type": "ftl", "device": "model=iphone11pro,version=16.5"}, "simulator_min": {"type": "virtual", "name":"iPhone 8", "version":"15.2"}, "simulator_target": {"type": "virtual", "name":"iPhone 8", "version":"16.1"}, "simulator_latest": {"type": "virtual", "name":"iPhone 11", "version":"16.1"}, diff --git a/scripts/gha/ui_testing/uitest_apple/FirebaseCppUITestApp/Info.plist b/scripts/gha/ui_testing/uitest_apple/FirebaseCppUITestApp/Info.plist index 16be3b6811..b6caf756b8 100644 --- a/scripts/gha/ui_testing/uitest_apple/FirebaseCppUITestApp/Info.plist +++ b/scripts/gha/ui_testing/uitest_apple/FirebaseCppUITestApp/Info.plist @@ -26,7 +26,7 @@ Main UIRequiredDeviceCapabilities - armv7 + arm64 UISupportedInterfaceOrientations diff --git a/storage/integration_test/Podfile b/storage/integration_test/Podfile index deb9c56c6f..1c27de3760 100644 --- a/storage/integration_test/Podfile +++ b/storage/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Storage', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Storage', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Storage', '10.12.0' - pod 'Firebase/Auth', '10.12.0' + pod 'Firebase/Storage', '10.13.0' + pod 'Firebase/Auth', '10.13.0' end post_install do |installer| diff --git a/storage/storage_resources/build.gradle b/storage/storage_resources/build.gradle index 3f286e93fb..7e5ca796e2 100644 --- a/storage/storage_resources/build.gradle +++ b/storage/storage_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.0') + implementation platform('com.google.firebase:firebase-bom:32.2.2') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-storage' } From 2c253aaa1e6a667f9ddd9fde53e4e19591e1380b Mon Sep 17 00:00:00 2001 From: "firebase-workflow-trigger[bot]" <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:06:38 -0700 Subject: [PATCH 04/13] Automatic merge of main into feature_branch/ump-sdk - Aug 14, 2023 (#1425) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae98f767c45f0a402fc9492bf6cc2ce55885. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d48d28c52352f5e40640831934ff6921e4e. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Jon Simantov Co-authored-by: almostmatt@google.com * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang * Update merge-to-main script (#1420) * Before creating the merge-main PR, branch it off main, so merge conflicts can be addressed in the branch rather than by committing to main. * Format. * Update release version number for M135, 11.4.0 (#1421) * feat(auth): enable emulator support on desktop (#1423) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change --------- Co-authored-by: Cynthia Jiang * Internal Updates. (#1422) * Add logic to trim webp parameter from native image urls --------- Co-authored-by: Jon Simantov Co-authored-by: Tom Andersen Co-authored-by: Matthew Hyndman Co-authored-by: a-maurice Co-authored-by: Saleem Abdulrasool Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Cynthia J Co-authored-by: Cynthia Jiang Co-authored-by: nakirekommula <126601200+nakirekommula@users.noreply.github.com> --- .github/workflows/update-feature-branches.yml | 12 ++++- app/rest/request_json.h | 1 + app/rest/tests/request_json_test.cc | 4 +- auth/src/android/auth_android.cc | 4 +- auth/src/desktop/rpcs/auth_request.cc | 7 +-- auth/src/ios/auth_ios.mm | 3 +- .../desktop/rpcs/create_auth_uri_test.cc | 4 +- .../tests/desktop/rpcs/delete_account_test.cc | 2 +- .../desktop/rpcs/get_account_info_test.cc | 2 +- .../rpcs/get_oob_confirmation_code_test.cc | 8 ++-- .../tests/desktop/rpcs/reset_password_test.cc | 4 +- auth/tests/desktop/rpcs/secure_token_test.cc | 4 +- .../desktop/rpcs/set_account_info_test.cc | 46 +++++++++---------- .../desktop/rpcs/sign_up_new_user_test.cc | 10 ++-- .../desktop/rpcs/verify_custom_token_test.cc | 4 +- .../desktop/rpcs/verify_password_test.cc | 6 +-- cpp_sdk_version.json | 6 +-- gma/src/android/native_ad_image_android.cc | 9 ++++ release_build_files/readme.md | 6 +++ 19 files changed, 86 insertions(+), 56 deletions(-) diff --git a/.github/workflows/update-feature-branches.yml b/.github/workflows/update-feature-branches.yml index 5e180d2611..b9ea97f4ee 100644 --- a/.github/workflows/update-feature-branches.yml +++ b/.github/workflows/update-feature-branches.yml @@ -17,6 +17,8 @@ env: defaultBranchPattern: "feature_branch/*" defaultMainBranch: "main" triggerTestsLabel: "tests-requested: quick" + branchPrefix: "workflow/auto-merge-feature-branch-" + jobs: list_feature_branches: @@ -85,6 +87,11 @@ jobs: python scripts/gha/install_prereqs_desktop.py python -m pip install requests + - name: Name new branch + run: | + date_str=$(date "+%Y%m%d-%H%M%S") + echo "NEW_BRANCH=${{env.branchPrefix}}${{github.run_number}}-${date_str}" >> $GITHUB_ENV + - name: Create merge PR id: create-pr run: | @@ -115,7 +122,10 @@ jobs: > Created on ${date_str} by [${{github.workflow}} workflow]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID). " - pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${main_branch}" --title "${pr_title}" --body "${pr_body}") + git checkout main + git checkout -b "${NEW_BRANCH}" + git push --set-upstream origin "${NEW_BRANCH}" + pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${NEW_BRANCH}" --title "${pr_title}" --body "${pr_body}") echo "created_pr_number=${pr_number}" >> $GITHUB_OUTPUT - name: Set test trigger label. diff --git a/app/rest/request_json.h b/app/rest/request_json.h index 9f37830b27..964ffbd529 100644 --- a/app/rest/request_json.h +++ b/app/rest/request_json.h @@ -41,6 +41,7 @@ class RequestJson : public Request { explicit RequestJson(const char* schema) : application_data_(new FbsTypeT()) { flatbuffers::IDLOptions fbs_options; fbs_options.skip_unexpected_fields_in_json = true; + fbs_options.strict_json = true; parser_.reset(new flatbuffers::Parser(fbs_options)); bool parse_status = parser_->Parse(schema); diff --git a/app/rest/tests/request_json_test.cc b/app/rest/tests/request_json_test.cc index 052549c493..058c925c6d 100644 --- a/app/rest/tests/request_json_test.cc +++ b/app/rest/tests/request_json_test.cc @@ -64,8 +64,8 @@ TEST(RequestJsonTest, UpdatePostFields) { request.set_token("abc"); EXPECT_EQ( "{\n" - " token: \"abc\",\n" - " number: 123\n" + " \"token\": \"abc\",\n" + " \"number\": 123\n" "}\n", request.options().post_fields); } diff --git a/auth/src/android/auth_android.cc b/auth/src/android/auth_android.cc index 2f8ccda645..965db474a4 100644 --- a/auth/src/android/auth_android.cc +++ b/auth/src/android/auth_android.cc @@ -195,10 +195,12 @@ void CheckEmulator(AuthData* auth_data) { // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { - LogDebug("Using Auth Prod for testing."); + LogInfo("Using Auth Prod for testing."); return; } + LogInfo("Using Auth Emulator for testing."); + // Use AUTH_EMULATOR_PORT if it is set to non empty string, // otherwise use the default port. uint32_t port = std::stoi(kEmulatorPort); diff --git a/auth/src/desktop/rpcs/auth_request.cc b/auth/src/desktop/rpcs/auth_request.cc index c9af69f789..77fb7ea07c 100644 --- a/auth/src/desktop/rpcs/auth_request.cc +++ b/auth/src/desktop/rpcs/auth_request.cc @@ -88,6 +88,7 @@ std::string AuthRequest::GetUrl() { } else { std::string url(kHttp); url += emulator_url; + url += "/"; url += kServerURL; return url; } @@ -95,15 +96,15 @@ std::string AuthRequest::GetUrl() { void AuthRequest::CheckEmulator() { if (!emulator_url.empty()) { - LogDebug("Emulator Url already set: %s", emulator_url.c_str()); + LogInfo("Emulator Url already set: %s", emulator_url.c_str()); return; } // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { - LogDebug("Using Auth Prod for testing."); + LogInfo("Using Auth Prod for testing."); return; } - + LogInfo("Using Auth Emulator."); emulator_url.append(kEmulatorLocalHost); emulator_url.append(":"); // Use AUTH_EMULATOR_PORT if it is set to non empty string, diff --git a/auth/src/ios/auth_ios.mm b/auth/src/ios/auth_ios.mm index e66af55dd6..59a4e3fe3d 100644 --- a/auth/src/ios/auth_ios.mm +++ b/auth/src/ios/auth_ios.mm @@ -160,9 +160,10 @@ void UpdateCurrentUser(AuthData *auth_data) { void CheckEmulator(AuthData *auth_data) { // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { - LogDebug("Using Auth Prod for testing."); + LogInfo("Using Auth Prod for testing."); return; } + LogInfo("Using Auth Emulator."); // Use AUTH_EMULATOR_PORT if it is set to non empty string, // otherwise use the default port. diff --git a/auth/tests/desktop/rpcs/create_auth_uri_test.cc b/auth/tests/desktop/rpcs/create_auth_uri_test.cc index e46b5bb49a..91a393f441 100644 --- a/auth/tests/desktop/rpcs/create_auth_uri_test.cc +++ b/auth/tests/desktop/rpcs/create_auth_uri_test.cc @@ -36,8 +36,8 @@ TEST(CreateAuthUriTest, TestCreateAuthUriRequest) { request.options().url); EXPECT_EQ( "{\n" - " identifier: \"email\",\n" - " continueUri: \"http://localhost\"\n" + " \"identifier\": \"email\",\n" + " \"continueUri\": \"http://localhost\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/delete_account_test.cc b/auth/tests/desktop/rpcs/delete_account_test.cc index d24c72be6b..e6d8a98bcf 100644 --- a/auth/tests/desktop/rpcs/delete_account_test.cc +++ b/auth/tests/desktop/rpcs/delete_account_test.cc @@ -37,7 +37,7 @@ TEST(DeleteAccountTest, TestDeleteAccountRequest) { request.options().url); EXPECT_EQ( "{\n" - " idToken: \"token\"\n" + " \"idToken\": \"token\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/get_account_info_test.cc b/auth/tests/desktop/rpcs/get_account_info_test.cc index 4822bd2e9c..368b079b93 100644 --- a/auth/tests/desktop/rpcs/get_account_info_test.cc +++ b/auth/tests/desktop/rpcs/get_account_info_test.cc @@ -36,7 +36,7 @@ TEST(GetAccountInfoTest, TestGetAccountInfoRequest) { request.options().url); EXPECT_EQ( "{\n" - " idToken: \"token\"\n" + " \"idToken\": \"token\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc b/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc index c6a20fd7e1..cf9717853d 100644 --- a/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc +++ b/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc @@ -40,8 +40,8 @@ TEST(GetOobConfirmationCodeTest, SendVerifyEmailRequest) { request->options().url); EXPECT_EQ( "{\n" - " idToken: \"token\",\n" - " requestType: \"VERIFY_EMAIL\"\n" + " \"idToken\": \"token\",\n" + " \"requestType\": \"VERIFY_EMAIL\"\n" "}\n", request->options().post_fields); } @@ -56,8 +56,8 @@ TEST(GetOobConfirmationCodeTest, SendPasswordResetEmailRequest) { request->options().url); EXPECT_EQ( "{\n" - " email: \"email\",\n" - " requestType: \"PASSWORD_RESET\"\n" + " \"email\": \"email\",\n" + " \"requestType\": \"PASSWORD_RESET\"\n" "}\n", request->options().post_fields); } diff --git a/auth/tests/desktop/rpcs/reset_password_test.cc b/auth/tests/desktop/rpcs/reset_password_test.cc index 480168b9d3..2901ca596e 100644 --- a/auth/tests/desktop/rpcs/reset_password_test.cc +++ b/auth/tests/desktop/rpcs/reset_password_test.cc @@ -35,8 +35,8 @@ TEST(ResetPasswordTest, TestResetPasswordRequest) { request.options().url); EXPECT_EQ( "{\n" - " oobCode: \"oob\",\n" - " newPassword: \"password\"\n" + " \"oobCode\": \"oob\",\n" + " \"newPassword\": \"password\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/secure_token_test.cc b/auth/tests/desktop/rpcs/secure_token_test.cc index 217b148d8a..ff6fd589c4 100644 --- a/auth/tests/desktop/rpcs/secure_token_test.cc +++ b/auth/tests/desktop/rpcs/secure_token_test.cc @@ -34,8 +34,8 @@ TEST(SecureTokenTest, TestSetRefreshRequest) { request.options().url); EXPECT_EQ( "{\n" - " grantType: \"refresh_token\",\n" - " refreshToken: \"token123\"\n" + " \"grantType\": \"refresh_token\",\n" + " \"refreshToken\": \"token123\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/set_account_info_test.cc b/auth/tests/desktop/rpcs/set_account_info_test.cc index 0a591ea44f..ce38726238 100644 --- a/auth/tests/desktop/rpcs/set_account_info_test.cc +++ b/auth/tests/desktop/rpcs/set_account_info_test.cc @@ -41,9 +41,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateEmail) { request->options().url); EXPECT_EQ( "{\n" - " email: \"fakeemail\",\n" - " returnSecureToken: true,\n" - " idToken: \"token\"\n" + " \"email\": \"fakeemail\",\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\"\n" "}\n", request->options().post_fields); } @@ -60,9 +60,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdatePassword) { request->options().url); EXPECT_EQ( "{\n" - " password: \"fakepassword\",\n" - " returnSecureToken: true,\n" - " idToken: \"token\"\n" + " \"password\": \"fakepassword\",\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\"\n" "}\n", request->options().post_fields); } @@ -79,10 +79,10 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_Full) { request->options().url); EXPECT_EQ( "{\n" - " displayName: \"New Name\",\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " photoUrl: \"new_url\"\n" + " \"displayName\": \"New Name\",\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"photoUrl\": \"new_url\"\n" "}\n", request->options().post_fields); } @@ -99,9 +99,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_Partial) { request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " photoUrl: \"new_url\"\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"photoUrl\": \"new_url\"\n" "}\n", request->options().post_fields); } @@ -117,9 +117,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_DeleteFields) { request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " deleteAttribute: [\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"deleteAttribute\": [\n" " \"DISPLAY_NAME\",\n" " \"PHOTO_URL\"\n" " ]\n" @@ -140,10 +140,10 @@ TEST(SetAccountInfoTest, request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " photoUrl: \"new_url\",\n" - " deleteAttribute: [\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"photoUrl\": \"new_url\",\n" + " \"deleteAttribute\": [\n" " \"DISPLAY_NAME\"\n" " ]\n" "}\n", @@ -162,9 +162,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_Unlink) { request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " deleteProvider: [\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"deleteProvider\": [\n" " \"fakeprovider\"\n" " ]\n" "}\n", diff --git a/auth/tests/desktop/rpcs/sign_up_new_user_test.cc b/auth/tests/desktop/rpcs/sign_up_new_user_test.cc index 870deb0fd5..a7b3374bce 100644 --- a/auth/tests/desktop/rpcs/sign_up_new_user_test.cc +++ b/auth/tests/desktop/rpcs/sign_up_new_user_test.cc @@ -35,7 +35,7 @@ TEST(SignUpNewUserTest, TestAnonymousSignInRequest) { request.options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true\n" + " \"returnSecureToken\": true\n" "}\n", request.options().post_fields); } @@ -50,10 +50,10 @@ TEST(SignUpNewUserTest, TestEmailPasswordSignInRequest) { request.options().url); EXPECT_EQ( "{\n" - " email: \"e@mail\",\n" - " password: \"pwd\",\n" - " displayName: \"rabbit\",\n" - " returnSecureToken: true\n" + " \"email\": \"e@mail\",\n" + " \"password\": \"pwd\",\n" + " \"displayName\": \"rabbit\",\n" + " \"returnSecureToken\": true\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/verify_custom_token_test.cc b/auth/tests/desktop/rpcs/verify_custom_token_test.cc index 49241c9ef0..7d4341d37b 100644 --- a/auth/tests/desktop/rpcs/verify_custom_token_test.cc +++ b/auth/tests/desktop/rpcs/verify_custom_token_test.cc @@ -36,8 +36,8 @@ TEST(VerifyCustomTokenTest, TestVerifyCustomTokenRequest) { request.options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " token: \"token123\"\n" + " \"returnSecureToken\": true,\n" + " \"token\": \"token123\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/verify_password_test.cc b/auth/tests/desktop/rpcs/verify_password_test.cc index 8fe1b1ee25..0383245467 100644 --- a/auth/tests/desktop/rpcs/verify_password_test.cc +++ b/auth/tests/desktop/rpcs/verify_password_test.cc @@ -35,9 +35,9 @@ TEST(VerifyPasswordTest, TestVerifyPasswordRequest) { request.options().url); EXPECT_EQ( "{\n" - " email: \"abc@email\",\n" - " password: \"pwd\",\n" - " returnSecureToken: true\n" + " \"email\": \"abc@email\",\n" + " \"password\": \"pwd\",\n" + " \"returnSecureToken\": true\n" "}\n", request.options().post_fields); } diff --git a/cpp_sdk_version.json b/cpp_sdk_version.json index 0b4e474adf..0eb24cc9c4 100644 --- a/cpp_sdk_version.json +++ b/cpp_sdk_version.json @@ -1,5 +1,5 @@ { - "released": "11.3.0", - "stable": "11.3.0", - "head": "11.3.0" + "released": "11.4.0", + "stable": "11.4.0", + "head": "11.4.0" } diff --git a/gma/src/android/native_ad_image_android.cc b/gma/src/android/native_ad_image_android.cc index 8c63c9b244..23af8c4fb2 100644 --- a/gma/src/android/native_ad_image_android.cc +++ b/gma/src/android/native_ad_image_android.cc @@ -71,6 +71,15 @@ NativeAdImage::NativeAdImage( FIREBASE_ASSERT(j_uri); internal_->uri = util::JniUriToString(env, j_uri); + // Images requested with an android user agent may return webp images. Trim + // webp parameter from image url to get the original JPG/PNG image. + std::size_t eq_pos = internal_->uri.rfind("="); + std::size_t webp_pos = internal_->uri.rfind("-rw"); + if (webp_pos != std::string::npos && eq_pos != std::string::npos && + webp_pos > eq_pos) { + internal_->uri.replace(webp_pos, 3, ""); + } + // NativeAdImage scale. jdouble j_scale = env->CallDoubleMethod(internal_->native_ad_image, diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 788ce32f29..9b03e10cdb 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -627,6 +627,12 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### Next Release +- Changes + - Auth: Add Firebase Auth Emulator support. Set the environment variable + USE_AUTH_EMULATOR=yes (and optionally AUTH_EMULATOR_PORT, default 9099) + to connect to the local Firebase Auth Emulator. + ### 11.4.0 - Changes - General (Android): Update to Firebase Android BoM version 32.2.2. From 890e8296ed5cbf91c9ea90abf718a2bed663d838 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Fri, 18 Aug 2023 11:06:26 -0700 Subject: [PATCH 05/13] Add User Messaging Platform iOS support (#1412) * Add iOS files, copies of stubs for now. * Format code. * Update cocoapod versions and add UMP pod. * Add iOS basics, also rename two enums. * Fixes. * Format code. * Fix compiler errors. * Add test flag for skipping on hardware. * Fix iOS implementation and tests to match actual results. Add a test skip macro for skipping on physical hardware. * Format code and add general GMA tests back in. * Enable App Transparency for iOS app. * Add debug device ID to test framework on iOS. * Change tests that use debug IDs to work differently. * Add debug ID to certain tests. * Format code. * Format code. * Add a mutex to prevent race condition. * Update test to check race condition. * Add include for lint * Update test name. * Remove user interaction flag from debug test. * Format code. * Remove UMP-only test mode. * Remove unnecessary test stuff. Return existing instance rather than creating new instance of internal class. * Fix assert. * Fix stub to match iOS flow. --- gma/CMakeLists.txt | 4 +- gma/integration_test/Info.plist | 2 + gma/integration_test/Podfile | 1 + .../project.pbxproj | 4 + gma/integration_test/src/integration_test.cc | 137 ++++++-- gma/src/common/ump/consent_info_internal.cc | 6 +- gma/src/common/ump/consent_info_internal.h | 4 +- gma/src/include/firebase/gma/ump/types.h | 4 +- gma/src/ios/ump/consent_info_internal_ios.h | 68 ++++ gma/src/ios/ump/consent_info_internal_ios.mm | 295 ++++++++++++++++++ .../stub/ump/consent_info_internal_stub.cc | 9 +- gma/src/stub/ump/consent_info_internal_stub.h | 4 +- ios_pod/Podfile | 1 + .../android_firebase_test_framework.cc | 5 + .../desktop_firebase_test_framework.cc | 2 + .../src/firebase_test_framework.h | 20 ++ .../src/ios/ios_firebase_test_framework.mm | 4 + 17 files changed, 530 insertions(+), 40 deletions(-) create mode 100644 gma/src/ios/ump/consent_info_internal_ios.h create mode 100644 gma/src/ios/ump/consent_info_internal_ios.mm diff --git a/gma/CMakeLists.txt b/gma/CMakeLists.txt index 440d0db7f0..887139f1db 100644 --- a/gma/CMakeLists.txt +++ b/gma/CMakeLists.txt @@ -54,7 +54,7 @@ set(android_SRCS # Source files used by the iOS implementation. set(ios_SRCS - src/stub/ump/consent_info_internal_stub.cc + src/ios/ump/consent_info_internal_ios.mm src/ios/FADAdSize.mm src/ios/FADAdView.mm src/ios/FADInterstitialDelegate.mm @@ -133,11 +133,13 @@ elseif(IOS) firebase_gma POD_NAMES Google-Mobile-Ads-SDK + GoogleUserMessagingPlatform ) # GMA expects the header files to be in a subfolder, so set up a symlink to # accomplish that. symlink_pod_headers(firebase_gma Google-Mobile-Ads-SDK GoogleMobileAds) + symlink_pod_headers(firebase_gma GoogleUserMessagingPlatform UserMessagingPlatform) if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks") set_target_properties(firebase_gma PROPERTIES diff --git a/gma/integration_test/Info.plist b/gma/integration_test/Info.plist index d2403b9c2c..953571e326 100644 --- a/gma/integration_test/Info.plist +++ b/gma/integration_test/Info.plist @@ -24,6 +24,8 @@ UILaunchStoryboardName LaunchScreen + NSUserTrackingUsageDescription + This identifier will be used to deliver personalized ads to you. CFBundleURLTypes diff --git a/gma/integration_test/Podfile b/gma/integration_test/Podfile index 8f9a305cdf..b347ca3b39 100644 --- a/gma/integration_test/Podfile +++ b/gma/integration_test/Podfile @@ -6,6 +6,7 @@ use_frameworks! :linkage => :static target 'integration_test' do pod 'Firebase/CoreOnly', '10.13.0' pod 'Google-Mobile-Ads-SDK', '10.9.0' + pod 'GoogleUserMessagingPlatform', '2.1.0' end post_install do |installer| diff --git a/gma/integration_test/integration_test.xcodeproj/project.pbxproj b/gma/integration_test/integration_test.xcodeproj/project.pbxproj index 54ac389b36..35b4a36051 100644 --- a/gma/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/gma/integration_test/integration_test.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ D640F3172819C85800AC956E /* empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = D640F3162819C85800AC956E /* empty.swift */; }; D66B16871CE46E8900E5638A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D66B16861CE46E8900E5638A /* LaunchScreen.storyboard */; }; D67D355822BABD2200292C1D /* gtest-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = D67D355622BABD2100292C1D /* gtest-all.cc */; }; + D686A3292A8B16F20034845A /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D686A3282A8B16F20034845A /* AppTrackingTransparency.framework */; }; D6C179E922CB322900C2651A /* ios_app_framework.mm in Sources */ = {isa = PBXBuildFile; fileRef = D6C179E722CB322900C2651A /* ios_app_framework.mm */; }; D6C179EA22CB322900C2651A /* ios_firebase_test_framework.mm in Sources */ = {isa = PBXBuildFile; fileRef = D6C179E822CB322900C2651A /* ios_firebase_test_framework.mm */; }; D6C179EE22CB323300C2651A /* firebase_test_framework.cc in Sources */ = {isa = PBXBuildFile; fileRef = D6C179EC22CB323300C2651A /* firebase_test_framework.cc */; }; @@ -39,6 +40,7 @@ D66B16861CE46E8900E5638A /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; D67D355622BABD2100292C1D /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "external/googletest/src/googletest/src/gtest-all.cc"; sourceTree = ""; }; D67D355722BABD2100292C1D /* gtest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gtest.h; path = external/googletest/src/googletest/include/gtest/gtest.h; sourceTree = ""; }; + D686A3282A8B16F20034845A /* AppTrackingTransparency.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppTrackingTransparency.framework; path = System/Library/Frameworks/AppTrackingTransparency.framework; sourceTree = SDKROOT; }; D6C179E722CB322900C2651A /* ios_app_framework.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ios_app_framework.mm; path = src/ios/ios_app_framework.mm; sourceTree = ""; }; D6C179E822CB322900C2651A /* ios_firebase_test_framework.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ios_firebase_test_framework.mm; path = src/ios/ios_firebase_test_framework.mm; sourceTree = ""; }; D6C179EB22CB323300C2651A /* firebase_test_framework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = firebase_test_framework.h; path = src/firebase_test_framework.h; sourceTree = ""; }; @@ -53,6 +55,7 @@ buildActionMask = 2147483647; files = ( 529226D81C85F68000C89379 /* CoreGraphics.framework in Frameworks */, + D686A3292A8B16F20034845A /* AppTrackingTransparency.framework in Frameworks */, 529226DA1C85F68000C89379 /* UIKit.framework in Frameworks */, 529226D61C85F68000C89379 /* Foundation.framework in Frameworks */, ); @@ -85,6 +88,7 @@ 529226D41C85F68000C89379 /* Frameworks */ = { isa = PBXGroup; children = ( + D686A3282A8B16F20034845A /* AppTrackingTransparency.framework */, 529226D51C85F68000C89379 /* Foundation.framework */, 529226D71C85F68000C89379 /* CoreGraphics.framework */, 529226D91C85F68000C89379 /* UIKit.framework */, diff --git a/gma/integration_test/src/integration_test.cc b/gma/integration_test/src/integration_test.cc index 7143237873..da158fa0ea 100644 --- a/gma/integration_test/src/integration_test.cc +++ b/gma/integration_test/src/integration_test.cc @@ -98,6 +98,8 @@ const char* kErrorDomain = "com.google.admob"; #endif // Sample test device IDs to use in making the request. +// You can replace these with actual device IDs for certain tests (e.g. UMP) +// to work on hardware devices. const std::vector kTestDeviceIDs = { "2077ef9a63d2b398840261c8221a0c9b", "098fe087d987c9a878965454a65654d7"}; @@ -136,6 +138,7 @@ static const std::vector kNeighboringContentURLs = { "test_url1", "test_url2", "test_url3"}; using app_framework::LogDebug; +using app_framework::LogInfo; using app_framework::LogWarning; using app_framework::ProcessEvents; @@ -2498,6 +2501,7 @@ void FirebaseGmaUmpTest::InitializeUmp(ResetOption reset) { void FirebaseGmaUmpTest::TerminateUmp() { if (consent_info_) { + consent_info_->Reset(); delete consent_info_; consent_info_ = nullptr; } @@ -2591,6 +2595,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugEEA) { params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); firebase::Future future = consent_info_->RequestConsentInfoUpdate(params); @@ -2610,6 +2616,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugNonEEA) { params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); firebase::Future future = consent_info_->RequestConsentInfoUpdate(params); @@ -2630,6 +2638,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadForm) { params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), "RequestConsentInfoUpdate"); @@ -2663,6 +2673,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpShowForm) { params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), "RequestConsentInfoUpdate"); @@ -2678,7 +2690,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpShowForm) { EXPECT_EQ(consent_info_->GetConsentFormStatus(), firebase::gma::ump::kConsentFormStatusAvailable); - firebase::Future future = consent_info_->ShowConsentForm(nullptr); + firebase::Future future = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); EXPECT_TRUE(future == consent_info_->ShowConsentFormLastResult()); @@ -2688,9 +2701,7 @@ TEST_F(FirebaseGmaUmpTest, TestUmpShowForm) { firebase::gma::ump::kConsentStatusObtained); } -TEST_F(FirebaseGmaUmpTest, TestUmpLoadFormUnavailableDueUnderAgeOfConsent) { - TEST_REQUIRES_USER_INTERACTION; - +TEST_F(FirebaseGmaUmpTest, TestUmpLoadFormUnavailableDueToUnderAgeOfConsent) { using firebase::gma::ump::ConsentDebugSettings; using firebase::gma::ump::ConsentFormStatus; using firebase::gma::ump::ConsentRequestParameters; @@ -2700,24 +2711,65 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadFormUnavailableDueUnderAgeOfConsent) { params.tag_for_under_age_of_consent = true; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), "RequestConsentInfoUpdate"); - EXPECT_EQ(consent_info_->GetConsentStatus(), - firebase::gma::ump::kConsentStatusRequired); + WaitForCompletion(consent_info_->LoadConsentForm(), "LoadConsentForm", + firebase::gma::ump::kConsentFormErrorUnavailable); +} - EXPECT_EQ(consent_info_->GetConsentFormStatus(), - firebase::gma::ump::kConsentFormStatusUnavailable); +TEST_F(FirebaseGmaUmpTest, TestUmpLoadFormUnavailableDebugNonEEA) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); WaitForCompletion(consent_info_->LoadConsentForm(), "LoadConsentForm", firebase::gma::ump::kConsentFormErrorUnavailable); +} - EXPECT_EQ(consent_info_->GetConsentFormStatus(), - firebase::gma::ump::kConsentFormStatusUnavailable); +TEST_F(FirebaseGmaUmpTest, TestUmpLoadAndShowIfRequiredDebugNonEEA) { + using firebase::gma::ump::ConsentDebugSettings; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); + + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + EXPECT_EQ(consent_info_->GetConsentStatus(), + firebase::gma::ump::kConsentStatusNotRequired); + + firebase::Future future = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + + EXPECT_TRUE(future == + consent_info_->LoadAndShowConsentFormIfRequiredLastResult()); + + WaitForCompletion(future, "LoadAndShowConsentFormIfRequired"); } -TEST_F(FirebaseGmaUmpTest, TestUmpLoadAndShowIfRequired) { +TEST_F(FirebaseGmaUmpTest, TestUmpLoadAndShowIfRequiredDebugEEA) { using firebase::gma::ump::ConsentDebugSettings; using firebase::gma::ump::ConsentRequestParameters; using firebase::gma::ump::ConsentStatus; @@ -2728,6 +2780,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadAndShowIfRequired) { params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), "RequestConsentInfoUpdate"); @@ -2736,7 +2790,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadAndShowIfRequired) { firebase::gma::ump::kConsentStatusRequired); firebase::Future future = - consent_info_->LoadAndShowConsentFormIfRequired(nullptr); + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); EXPECT_TRUE(future == consent_info_->LoadAndShowConsentFormIfRequiredLastResult()); @@ -2759,6 +2814,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpPrivacyOptions) { params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), "RequestConsentInfoUpdate"); @@ -2768,28 +2825,30 @@ TEST_F(FirebaseGmaUmpTest, TestUmpPrivacyOptions) { EXPECT_FALSE(consent_info_->CanRequestAds()); - WaitForCompletion(consent_info_->LoadAndShowConsentFormIfRequired(nullptr), + WaitForCompletion(consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()), "LoadAndShowConsentFormIfRequired"); EXPECT_EQ(consent_info_->GetConsentStatus(), firebase::gma::ump::kConsentStatusObtained); - EXPECT_TRUE(consent_info_->CanRequestAds()); + EXPECT_TRUE(consent_info_->CanRequestAds()) << "After consent obtained"; + + LogInfo( + "******** On the Privacy Options screen that is about to appear, please " + "select DO NOT CONSENT."); + + ProcessEvents(5000); EXPECT_EQ(consent_info_->GetPrivacyOptionsRequirementStatus(), firebase::gma::ump::kPrivacyOptionsRequirementStatusRequired); - firebase::Future future = - consent_info_->ShowPrivacyOptionsForm(nullptr); + firebase::Future future = consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); EXPECT_TRUE(future == consent_info_->ShowPrivacyOptionsFormLastResult()); WaitForCompletion(future, "ShowPrivacyOptionsForm"); - - EXPECT_EQ(consent_info_->GetConsentStatus(), - firebase::gma::ump::kConsentStatusRequired); - - EXPECT_FALSE(consent_info_->CanRequestAds()); } TEST_F(FirebaseGmaUmpTest, TestCanRequestAdsNonEEA) { @@ -2797,12 +2856,12 @@ TEST_F(FirebaseGmaUmpTest, TestCanRequestAdsNonEEA) { using firebase::gma::ump::ConsentRequestParameters; using firebase::gma::ump::ConsentStatus; - TEST_REQUIRES_USER_INTERACTION; - ConsentRequestParameters params; params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), "RequestConsentInfoUpdate"); @@ -2818,12 +2877,12 @@ TEST_F(FirebaseGmaUmpTest, TestCanRequestAdsEEA) { using firebase::gma::ump::ConsentRequestParameters; using firebase::gma::ump::ConsentStatus; - TEST_REQUIRES_USER_INTERACTION; - ConsentRequestParameters params; params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), "RequestConsentInfoUpdate"); @@ -2834,7 +2893,30 @@ TEST_F(FirebaseGmaUmpTest, TestCanRequestAdsEEA) { EXPECT_FALSE(consent_info_->CanRequestAds()); } -TEST_F(FirebaseGmaUmpTest, TestUmpCleanup) { +TEST_F(FirebaseGmaUmpTest, TestUmpCleanupWithDelay) { + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + firebase::Future future_request = + consent_info_->RequestConsentInfoUpdate(params); + firebase::Future future_load = consent_info_->LoadConsentForm(); + firebase::Future future_show = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); + + ProcessEvents(5000); + + delete consent_info_; + consent_info_ = nullptr; + + EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpCleanupRaceCondition) { using firebase::gma::ump::ConsentFormStatus; using firebase::gma::ump::ConsentRequestParameters; using firebase::gma::ump::ConsentStatus; @@ -2844,7 +2926,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpCleanup) { firebase::Future future_request = consent_info_->RequestConsentInfoUpdate(params); firebase::Future future_load = consent_info_->LoadConsentForm(); - firebase::Future future_show = consent_info_->ShowConsentForm(nullptr); + firebase::Future future_show = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); delete consent_info_; consent_info_ = nullptr; diff --git a/gma/src/common/ump/consent_info_internal.cc b/gma/src/common/ump/consent_info_internal.cc index ef58873575..3a3e9cd4b8 100644 --- a/gma/src/common/ump/consent_info_internal.cc +++ b/gma/src/common/ump/consent_info_internal.cc @@ -45,7 +45,7 @@ const char* ConsentInfoInternal::GetConsentRequestErrorMessage( return "Network error"; case kConsentRequestErrorInternal: return "Internal error"; - case kConsentRequestErrorCodeMisconfiguration: + case kConsentRequestErrorMisconfiguration: return "A misconfiguration exists in the UI"; case kConsentRequestErrorUnknown: return "Unknown error"; @@ -72,8 +72,8 @@ const char* ConsentInfoInternal::GetConsentFormErrorMessage( return "Internal error"; case kConsentFormErrorUnknown: return "Unknown error"; - case kConsentFormErrorCodeAlreadyUsed: - return "Code already used"; + case kConsentFormErrorAlreadyUsed: + return "The form was already used"; case kConsentFormErrorInvalidOperation: return "Invalid operation"; case kConsentFormErrorOperationInProgress: diff --git a/gma/src/common/ump/consent_info_internal.h b/gma/src/common/ump/consent_info_internal.h index 3438526ef0..88160a341c 100644 --- a/gma/src/common/ump/consent_info_internal.h +++ b/gma/src/common/ump/consent_info_internal.h @@ -46,8 +46,8 @@ class ConsentInfoInternal { // platform-specific subclass. static ConsentInfoInternal* CreateInstance(); - virtual ConsentStatus GetConsentStatus() const = 0; - virtual ConsentFormStatus GetConsentFormStatus() const = 0; + virtual ConsentStatus GetConsentStatus() = 0; + virtual ConsentFormStatus GetConsentFormStatus() = 0; virtual Future RequestConsentInfoUpdate( const ConsentRequestParameters& params) = 0; diff --git a/gma/src/include/firebase/gma/ump/types.h b/gma/src/include/firebase/gma/ump/types.h index bf380d16be..af29182d16 100644 --- a/gma/src/include/firebase/gma/ump/types.h +++ b/gma/src/include/firebase/gma/ump/types.h @@ -114,7 +114,7 @@ enum ConsentRequestError { /// An internal error occurred. kConsentRequestErrorInternal, /// A misconfiguration exists in the UI. - kConsentRequestErrorCodeMisconfiguration, + kConsentRequestErrorMisconfiguration, /// An unknown error occurred. kConsentRequestErrorUnknown, /// An invalid operation occurred. Try again. @@ -151,7 +151,7 @@ enum ConsentFormError { /// The form is unavailable. kConsentFormErrorUnavailable, /// This form was already used. - kConsentFormErrorCodeAlreadyUsed, + kConsentFormErrorAlreadyUsed, /// An invalid operation occurred. Try again. kConsentFormErrorInvalidOperation, /// The operation is already in progress. Call diff --git a/gma/src/ios/ump/consent_info_internal_ios.h b/gma/src/ios/ump/consent_info_internal_ios.h new file mode 100644 index 0000000000..5472c91d4a --- /dev/null +++ b/gma/src/ios/ump/consent_info_internal_ios.h @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_GMA_SRC_IOS_UMP_CONSENT_INFO_INTERNAL_IOS_H_ +#define FIREBASE_GMA_SRC_IOS_UMP_CONSENT_INFO_INTERNAL_IOS_H_ + +#include + +#include "firebase/internal/mutex.h" +#include "gma/src/common/ump/consent_info_internal.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +class ConsentInfoInternalIos : public ConsentInfoInternal { + public: + ConsentInfoInternalIos(); + ~ConsentInfoInternalIos() override; + + ConsentStatus GetConsentStatus() override; + Future RequestConsentInfoUpdate( + const ConsentRequestParameters& params) override; + + ConsentFormStatus GetConsentFormStatus() override; + Future LoadConsentForm() override; + Future ShowConsentForm(FormParent parent) override; + + Future LoadAndShowConsentFormIfRequired(FormParent parent) override; + + PrivacyOptionsRequirementStatus GetPrivacyOptionsRequirementStatus() override; + Future ShowPrivacyOptionsForm(FormParent parent) override; + + bool CanRequestAds() override; + + void Reset() override; + + private: + static ConsentInfoInternalIos* s_instance; + static firebase::Mutex s_instance_mutex; + + void SetLoadedForm(UMPConsentForm *form) { + loaded_form_ = form; + } + + UMPConsentForm *loaded_form_; +}; + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase + +#endif // FIREBASE_GMA_SRC_IOS_UMP_CONSENT_INFO_INTERNAL_IOS_H_ diff --git a/gma/src/ios/ump/consent_info_internal_ios.mm b/gma/src/ios/ump/consent_info_internal_ios.mm new file mode 100644 index 0000000000..08d2a0d004 --- /dev/null +++ b/gma/src/ios/ump/consent_info_internal_ios.mm @@ -0,0 +1,295 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gma/src/ios/ump/consent_info_internal_ios.h" + +#include "app/src/assert.h" +#include "app/src/thread.h" +#include "app/src/util_ios.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +ConsentInfoInternalIos* ConsentInfoInternalIos::s_instance = nullptr; +firebase::Mutex ConsentInfoInternalIos::s_instance_mutex; + + +// This explicitly implements the constructor for the outer class, +// ConsentInfoInternal. +ConsentInfoInternal* ConsentInfoInternal::CreateInstance() { + return new ConsentInfoInternalIos(); +} + +ConsentInfoInternalIos::ConsentInfoInternalIos() + : loaded_form_(nil) { + MutexLock lock(s_instance_mutex); + FIREBASE_ASSERT(s_instance == nullptr); + s_instance = this; +} + +ConsentInfoInternalIos::~ConsentInfoInternalIos() { + MutexLock lock(s_instance_mutex); + s_instance = nullptr; +} + +static ConsentRequestError CppRequestErrorFromIosRequestError(NSInteger code) { + switch(code) { + case UMPRequestErrorCodeInternal: + return kConsentRequestErrorInternal; + case UMPRequestErrorCodeInvalidAppID: + return kConsentRequestErrorInvalidAppId; + case UMPRequestErrorCodeMisconfiguration: + return kConsentRequestErrorMisconfiguration; + case UMPRequestErrorCodeNetwork: + return kConsentRequestErrorNetwork; + default: + LogWarning("GMA: Unknown UMPRequestErrorCode returned by UMP iOS SDK: %d", + (int)code); + return kConsentRequestErrorUnknown; + } +} + +static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { + switch(code) { + case UMPFormErrorCodeInternal: + return kConsentFormErrorInternal; + case UMPFormErrorCodeAlreadyUsed: + return kConsentFormErrorAlreadyUsed; + case UMPFormErrorCodeUnavailable: + return kConsentFormErrorUnavailable; + case UMPFormErrorCodeTimeout: + return kConsentFormErrorTimeout; + case UMPFormErrorCodeInvalidViewController: + return kConsentFormErrorInvalidOperation; + default: + LogWarning("GMA: Unknown UMPFormErrorCode returned by UMP iOS SDK: %d", + (int)code); + return kConsentFormErrorUnknown; + } +} + +Future ConsentInfoInternalIos::RequestConsentInfoUpdate( + const ConsentRequestParameters& params) { + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnRequestConsentInfoUpdate); + + UMPRequestParameters *ios_parameters = [[UMPRequestParameters alloc] init]; + ios_parameters.tagForUnderAgeOfConsent = params.tag_for_under_age_of_consent ? YES : NO; + UMPDebugSettings *ios_debug_settings = [[UMPDebugSettings alloc] init]; + + switch(params.debug_settings.debug_geography) { + case kConsentDebugGeographyEEA: + ios_debug_settings.geography = UMPDebugGeographyEEA; + break; + case kConsentDebugGeographyNonEEA: + ios_debug_settings.geography = UMPDebugGeographyNotEEA; + break; + case kConsentDebugGeographyDisabled: + ios_debug_settings.geography = UMPDebugGeographyDisabled; + break; + } + if (params.debug_settings.debug_device_ids.size() > 0) { + ios_debug_settings.testDeviceIdentifiers = + firebase::util::StringVectorToNSMutableArray(params.debug_settings.debug_device_ids); + } + ios_parameters.debugSettings = ios_debug_settings; + + util::DispatchAsyncSafeMainQueue(^{ + [UMPConsentInformation.sharedInstance + requestConsentInfoUpdateWithParameters:ios_parameters + completionHandler:^(NSError *_Nullable error){ + if (!error) { + CompleteFuture(handle, kConsentRequestSuccess); + } else { + CompleteFuture(handle, CppRequestErrorFromIosRequestError(error.code), error.localizedDescription.UTF8String); + } + }]; + }); + + return MakeFuture(futures(), handle); +} + +ConsentStatus ConsentInfoInternalIos::GetConsentStatus() { + UMPConsentStatus ios_status = + UMPConsentInformation.sharedInstance.consentStatus; + switch(ios_status) { + case UMPConsentStatusNotRequired: + return kConsentStatusNotRequired; + case UMPConsentStatusRequired: + return kConsentStatusRequired; + case UMPConsentStatusObtained: + return kConsentStatusObtained; + case UMPConsentStatusUnknown: + return kConsentStatusUnknown; + default: + LogWarning("GMA: Unknown UMPConsentStatus returned by UMP iOS SDK: %d", + (int)ios_status); + return kConsentStatusUnknown; + } +} + + +ConsentFormStatus ConsentInfoInternalIos::GetConsentFormStatus() { + UMPFormStatus ios_status = + UMPConsentInformation.sharedInstance.formStatus; + switch(ios_status) { + case UMPFormStatusAvailable: + return kConsentFormStatusAvailable; + case UMPFormStatusUnavailable: + return kConsentFormStatusUnavailable; + case UMPFormStatusUnknown: + return kConsentFormStatusUnknown; + default: + LogWarning("GMA: Unknown UMPFormConsentStatus returned by UMP iOS SDK: %d", + (int)ios_status); + return kConsentFormStatusUnknown; + } +} + +Future ConsentInfoInternalIos::LoadConsentForm() { + SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadConsentForm); + loaded_form_ = nil; + + util::DispatchAsyncSafeMainQueue(^{ + [UMPConsentForm + loadWithCompletionHandler:^(UMPConsentForm *_Nullable form, NSError *_Nullable error){ + if (form) { + MutexLock lock(s_instance_mutex); + if (s_instance) { + SetLoadedForm(form); + CompleteFuture(handle, kConsentFormSuccess, "Success"); + } + } else if (error) { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); + } + } else { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, kConsentFormErrorUnknown, "An unknown error occurred."); + } + } + }]; + }); + return MakeFuture(futures(), handle); +} + +Future ConsentInfoInternalIos::ShowConsentForm(FormParent parent) { + SafeFutureHandle handle = CreateFuture(kConsentInfoFnShowConsentForm); + + if (!loaded_form_) { + CompleteFuture(handle, kConsentFormErrorInvalidOperation, + "You must call LoadConsentForm() prior to calling ShowConsentForm()."); + } else { + util::DispatchAsyncSafeMainQueue(^{ + [loaded_form_ presentFromViewController:parent + completionHandler:^(NSError *_Nullable error){ + if (!error) { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, kConsentRequestSuccess); + } + } else { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); + } + } + }]; + }); + } + return MakeFuture(futures(), handle); +} + +Future ConsentInfoInternalIos::LoadAndShowConsentFormIfRequired( + FormParent parent) { + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnLoadAndShowConsentFormIfRequired); + + util::DispatchAsyncSafeMainQueue(^{ + [UMPConsentForm loadAndPresentIfRequiredFromViewController:parent + completionHandler:^(NSError *_Nullable error){ + if (!error) { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, kConsentRequestSuccess); + } + } else { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); + } + } + }]; + }); + return MakeFuture(futures(), handle); +} + +PrivacyOptionsRequirementStatus +ConsentInfoInternalIos::GetPrivacyOptionsRequirementStatus() { + UMPPrivacyOptionsRequirementStatus ios_status = + UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus; + switch(ios_status) { + case UMPPrivacyOptionsRequirementStatusRequired: + return kPrivacyOptionsRequirementStatusRequired; + case UMPPrivacyOptionsRequirementStatusNotRequired: + return kPrivacyOptionsRequirementStatusNotRequired; + case UMPPrivacyOptionsRequirementStatusUnknown: + return kPrivacyOptionsRequirementStatusUnknown; + default: + LogWarning("GMA: Unknown UMPPrivacyOptionsRequirementStatus returned by UMP iOS SDK: %d", + (int)ios_status); + return kPrivacyOptionsRequirementStatusUnknown; + } +} + +Future ConsentInfoInternalIos::ShowPrivacyOptionsForm(FormParent parent) { + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnShowPrivacyOptionsForm); + util::DispatchAsyncSafeMainQueue(^{ + [UMPConsentForm presentPrivacyOptionsFormFromViewController:parent + completionHandler:^(NSError *_Nullable error){ + if (!error) { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, kConsentRequestSuccess); + } + } else { + MutexLock lock(s_instance_mutex); + if (s_instance) { + CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); + } + } + }]; + }); + return MakeFuture(futures(), handle); +} + +bool ConsentInfoInternalIos::CanRequestAds() { + return (UMPConsentInformation.sharedInstance.canRequestAds == YES ? true : false); +} + +void ConsentInfoInternalIos::Reset() { + [UMPConsentInformation.sharedInstance reset]; +} + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase diff --git a/gma/src/stub/ump/consent_info_internal_stub.cc b/gma/src/stub/ump/consent_info_internal_stub.cc index 8f4d033896..6bc92ec08c 100644 --- a/gma/src/stub/ump/consent_info_internal_stub.cc +++ b/gma/src/stub/ump/consent_info_internal_stub.cc @@ -58,8 +58,10 @@ Future ConsentInfoInternalStub::RequestConsentInfoUpdate( consent_status_ = new_consent_status; under_age_of_consent_ = params.tag_for_under_age_of_consent; - consent_form_status_ = under_age_of_consent_ ? kConsentFormStatusUnavailable - : kConsentFormStatusAvailable; + consent_form_status_ = + (under_age_of_consent_ || consent_status_ != kConsentStatusRequired) + ? kConsentFormStatusUnavailable + : kConsentFormStatusAvailable; debug_geo_ = params.debug_settings.debug_geography; privacy_options_requirement_status_ = kPrivacyOptionsRequirementStatusNotRequired; @@ -104,7 +106,8 @@ Future ConsentInfoInternalStub::LoadAndShowConsentFormIfRequired( SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadAndShowConsentFormIfRequired); - if (consent_form_status_ != kConsentFormStatusAvailable) { + if (consent_status_ == kConsentStatusRequired && + consent_form_status_ != kConsentFormStatusAvailable) { CompleteFuture(handle, kConsentFormErrorUnavailable); return MakeFuture(futures(), handle); } diff --git a/gma/src/stub/ump/consent_info_internal_stub.h b/gma/src/stub/ump/consent_info_internal_stub.h index 23d44dfbaa..83368de284 100644 --- a/gma/src/stub/ump/consent_info_internal_stub.h +++ b/gma/src/stub/ump/consent_info_internal_stub.h @@ -51,8 +51,8 @@ class ConsentInfoInternalStub : public ConsentInfoInternal { ConsentInfoInternalStub(); ~ConsentInfoInternalStub() override; - ConsentStatus GetConsentStatus() const override { return consent_status_; } - ConsentFormStatus GetConsentFormStatus() const override { + ConsentStatus GetConsentStatus() override { return consent_status_; } + ConsentFormStatus GetConsentFormStatus() override { return consent_form_status_; } diff --git a/ios_pod/Podfile b/ios_pod/Podfile index 85d0daf610..fc5a040227 100644 --- a/ios_pod/Podfile +++ b/ios_pod/Podfile @@ -6,6 +6,7 @@ target 'GetPods' do pod 'Firebase/Core', '10.13.0' pod 'Google-Mobile-Ads-SDK', '10.9.0' + pod 'GoogleUserMessagingPlatform', '2.1.0' pod 'Firebase/Analytics', '10.13.0' pod 'Firebase/AppCheck', '10.13.0' pod 'Firebase/Auth', '10.13.0' diff --git a/testing/test_framework/src/android/android_firebase_test_framework.cc b/testing/test_framework/src/android/android_firebase_test_framework.cc index d1289d0750..03513c0924 100644 --- a/testing/test_framework/src/android/android_firebase_test_framework.cc +++ b/testing/test_framework/src/android/android_firebase_test_framework.cc @@ -267,4 +267,9 @@ int FirebaseTest::GetGooglePlayServicesVersion() { return static_cast(result); } +std::string FirebaseTest::GetDebugDeviceId() { + // TODO(jsimantov): Add this for Android. + return "placeholder-device-id"; +} + } // namespace firebase_test_framework diff --git a/testing/test_framework/src/desktop/desktop_firebase_test_framework.cc b/testing/test_framework/src/desktop/desktop_firebase_test_framework.cc index 31fc42184d..01e4a4e7c9 100644 --- a/testing/test_framework/src/desktop/desktop_firebase_test_framework.cc +++ b/testing/test_framework/src/desktop/desktop_firebase_test_framework.cc @@ -59,4 +59,6 @@ int FirebaseTest::GetGooglePlayServicesVersion() { return 0; } +std::string FirebaseTest::GetDebugDeviceId() { return "placeholder-device-id"; } + } // namespace firebase_test_framework diff --git a/testing/test_framework/src/firebase_test_framework.h b/testing/test_framework/src/firebase_test_framework.h index cff9ef5aec..4d03fe317f 100644 --- a/testing/test_framework/src/firebase_test_framework.h +++ b/testing/test_framework/src/firebase_test_framework.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "app_framework.h" // NOLINT @@ -192,6 +193,23 @@ namespace firebase_test_framework { #define SKIP_TEST_ON_ANDROID ((void)0) #endif // defined(ANDROID) +// Skip on physical mobile device. +#if !defined(ANDROID) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) +// Allow desktop. +#define SKIP_TEST_ON_MOBILE_HARDWARE ((void)0) +#else +// Android needs to determine emulator at runtime, so we can't just use #ifdef. +#define SKIP_TEST_ON_MOBILE_HARDWARE \ + { \ + if (!IsRunningOnEmulator()) { \ + app_framework::LogInfo("Skipping %s on mobile hardware.", \ + test_info_->name()); \ + GTEST_SKIP(); \ + return; \ + } \ + } +#endif // !defined(ANDROID) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) + // Android needs to determine emulator at runtime, so we can't just use #ifdef. #define SKIP_TEST_ON_SIMULATOR \ { \ @@ -538,6 +556,8 @@ class FirebaseTest : public testing::Test { // false if it failed. static bool Base64Decode(const std::string& input, std::string* output); + static std::string GetDebugDeviceId(); + firebase::App* app_; static int argc_; static char** argv_; diff --git a/testing/test_framework/src/ios/ios_firebase_test_framework.mm b/testing/test_framework/src/ios/ios_firebase_test_framework.mm index 36295d0b76..0a14eb4f46 100644 --- a/testing/test_framework/src/ios/ios_firebase_test_framework.mm +++ b/testing/test_framework/src/ios/ios_firebase_test_framework.mm @@ -205,4 +205,8 @@ static bool SendHttpRequest(const char* method, const char* url, return 0; } +std::string FirebaseTest::GetDebugDeviceId() { + return UIDevice.currentDevice.identifierForVendor.UUIDString.UTF8String; +} + } // namespace firebase_test_framework From b9ba2cc06046c62a6ab4d64c20f22054fa20ee06 Mon Sep 17 00:00:00 2001 From: "firebase-workflow-trigger[bot]" <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:32:13 +0000 Subject: [PATCH 06/13] Automatic merge of main into feature_branch/ump-sdk - Sep 04, 2023 (#1438) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae98f767c45f0a402fc9492bf6cc2ce55885. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d48d28c52352f5e40640831934ff6921e4e. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Jon Simantov Co-authored-by: almostmatt@google.com * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang * Update merge-to-main script (#1420) * Before creating the merge-main PR, branch it off main, so merge conflicts can be addressed in the branch rather than by committing to main. * Format. * Update release version number for M135, 11.4.0 (#1421) * feat(auth): enable emulator support on desktop (#1423) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change --------- Co-authored-by: Cynthia Jiang * Internal Updates. (#1422) * Add logic to trim webp parameter from native image urls * Add Analytics function for on-device conversion (#1429) * Add Analytics function for phone number conversion * Formatting * Update analytics.h * Update analytics_test.cc * Update mobile dependencies - Tue Aug 29 2023 (#1436) * Update mobile dependencies - Tue Aug 29 2023 ### Android - com.google.android.gms.play_services_ads → 22.3.0 - com.google.firebase.firebase_bom → 32.2.3 ### iOS - Firebase/Analytics → 10.14.0 - Firebase/AppCheck → 10.14.0 - Firebase/Auth → 10.14.0 - Firebase/Core → 10.14.0 - Firebase/CoreOnly → 10.14.0 - Firebase/Crashlytics → 10.14.0 - Firebase/Database → 10.14.0 - Firebase/DynamicLinks → 10.14.0 - Firebase/Firestore → 10.14.0 - Firebase/Functions → 10.14.0 - Firebase/Installations → 10.14.0 - Firebase/Messaging → 10.14.0 - Firebase/RemoteConfig → 10.14.0 - Firebase/Storage → 10.14.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6016988287). * Update query_main to use normalized_order_bys * Update query_main.cc --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: a-maurice * add UseEmulator api to auth (#1437) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change * remove platform logging v1 code * add useEmulator api * test with emulator * clean up for review * tweak for review * update with comments * put back necessary heartbeat blocks --------- Co-authored-by: Cynthia Jiang --------- Co-authored-by: Jon Simantov Co-authored-by: Tom Andersen Co-authored-by: Matthew Hyndman Co-authored-by: a-maurice Co-authored-by: Saleem Abdulrasool Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Cynthia J Co-authored-by: Cynthia Jiang Co-authored-by: nakirekommula <126601200+nakirekommula@users.noreply.github.com> --- Android/firebase_dependencies.gradle | 4 +- analytics/integration_test/Podfile | 4 +- .../integration_test/src/integration_test.cc | 2 + analytics/ios_headers/FIREventNames.h | 2 +- analytics/ios_headers/FIRParameterNames.h | 2 +- analytics/ios_headers/FIRUserPropertyNames.h | 2 +- analytics/src/analytics_android.cc | 10 + analytics/src/analytics_ios.mm | 8 + analytics/src/analytics_stub.cc | 9 + analytics/src/include/firebase/analytics.h | 11 + analytics/src_ios/fake/FIRAnalytics.h | 2 + analytics/src_ios/fake/FIRAnalytics.mm | 5 + analytics/tests/analytics_test.cc | 10 + app/app_resources/build.gradle | 2 +- app/google_api_resources/build.gradle | 2 +- app/integration_test/Podfile | 2 +- app/invites_resources/build.gradle | 2 +- app_check/app_check_resources/build.gradle | 2 +- app_check/integration_test/Podfile | 20 +- auth/auth_resources/build.gradle | 2 +- auth/integration_test/Podfile | 4 +- auth/src/android/auth_android.cc | 23 +- auth/src/desktop/auth_desktop.cc | 8 + auth/src/desktop/auth_desktop.h | 2 + auth/src/desktop/rpcs/auth_request.cc | 66 +- auth/src/desktop/rpcs/auth_request.h | 5 +- auth/src/include/firebase/auth.h | 10 + auth/src/ios/auth_ios.mm | 13 +- cmake/external/firestore.cmake | 2 +- database/database_resources/build.gradle | 2 +- database/integration_test/Podfile | 8 +- dynamic_links/integration_test/Podfile | 2 +- firestore/firestore_resources/build.gradle | 2 +- firestore/integration_test/Podfile | 8 +- firestore/integration_test_internal/Podfile | 8 +- firestore/src/main/query_main.cc | 7 +- functions/integration_test/Podfile | 8 +- gma/gma_resources/build.gradle | 4 +- gma/integration_test/Podfile | 2 +- installations/integration_test/Podfile | 4 +- ios_pod/Podfile | 27 +- .../FirebaseAnalyticsSwift-Swift.h | 493 +++-- .../FirebaseCoreInternal-Swift.h | 551 ++--- .../FirebaseDatabaseSwift-Swift.h | 497 +++-- .../FirebaseFirestoreSwift-Swift.h | 521 ++--- .../swift_headers/FirebaseFunctions-Swift.h | 1083 +++++---- .../FirebaseInAppMessagingSwift-Swift.h | 495 +++-- .../FirebaseMLModelDownloader-Swift.h | 495 +++-- .../FirebaseRemoteConfigSwift-Swift.h | 497 +++-- .../swift_headers/FirebaseSharedSwift-Swift.h | 493 +++-- ios_pod/swift_headers/FirebaseStorage-Swift.h | 1929 +++++++++-------- ios_pod/swift_headers/SwiftProtobuf-Swift.h | 493 +++-- messaging/integration_test/Podfile | 4 +- messaging/messaging_java/build.gradle | 2 +- .../Android/firebase_dependencies.gradle | 4 +- release_build_files/readme.md | 71 +- remote_config/integration_test/Podfile | 4 +- .../remote_config_resources/build.gradle | 2 +- storage/integration_test/Podfile | 8 +- storage/storage_resources/build.gradle | 2 +- 60 files changed, 4419 insertions(+), 3543 deletions(-) diff --git a/Android/firebase_dependencies.gradle b/Android/firebase_dependencies.gradle index 2481bd4c38..232026a2b1 100644 --- a/Android/firebase_dependencies.gradle +++ b/Android/firebase_dependencies.gradle @@ -27,7 +27,7 @@ def firebaseDependenciesMap = [ 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'], 'firestore' : ['com.google.firebase:firebase-firestore'], 'functions' : ['com.google.firebase:firebase-functions'], - 'gma' : ['com.google.android.gms:play-services-ads:22.2.0'], + 'gma' : ['com.google.android.gms:play-services-ads:22.3.0'], 'installations' : ['com.google.firebase:firebase-installations'], 'invites' : ['com.google.firebase:firebase-invites'], // Messaging has an additional local dependency to include. @@ -158,7 +158,7 @@ project.afterEvaluate { // Add the bill-of-materials project.dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') } for (String lib : firebaseCpp.dependencies.libSet) { // Generate and include the proguard file diff --git a/analytics/integration_test/Podfile b/analytics/integration_test/Podfile index 2bd2ef9ca3..1f559b860b 100644 --- a/analytics/integration_test/Podfile +++ b/analytics/integration_test/Podfile @@ -5,12 +5,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Analytics', '10.13.0' + pod 'Firebase/Analytics', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Analytics', '10.13.0' + pod 'Firebase/Analytics', '10.14.0' end post_install do |installer| diff --git a/analytics/integration_test/src/integration_test.cc b/analytics/integration_test/src/integration_test.cc index 8fca99b3e6..a98c58988d 100644 --- a/analytics/integration_test/src/integration_test.cc +++ b/analytics/integration_test/src/integration_test.cc @@ -190,6 +190,8 @@ TEST_F(FirebaseAnalyticsTest, TestSetProperties) { // Initiate on-device conversion measurement. firebase::analytics::InitiateOnDeviceConversionMeasurementWithEmailAddress( "my_email@site.com"); + firebase::analytics::InitiateOnDeviceConversionMeasurementWithPhoneNumber( + "+15551234567"); } TEST_F(FirebaseAnalyticsTest, TestLogEvents) { diff --git a/analytics/ios_headers/FIREventNames.h b/analytics/ios_headers/FIREventNames.h index 317bfab42d..539cec6c64 100644 --- a/analytics/ios_headers/FIREventNames.h +++ b/analytics/ios_headers/FIREventNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.13.0. +// Copied from Firebase Analytics iOS SDK 10.14.0. /// @file FIREventNames.h /// diff --git a/analytics/ios_headers/FIRParameterNames.h b/analytics/ios_headers/FIRParameterNames.h index c6664d14f7..9906ae0924 100644 --- a/analytics/ios_headers/FIRParameterNames.h +++ b/analytics/ios_headers/FIRParameterNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.13.0. +// Copied from Firebase Analytics iOS SDK 10.14.0. /// @file FIRParameterNames.h /// diff --git a/analytics/ios_headers/FIRUserPropertyNames.h b/analytics/ios_headers/FIRUserPropertyNames.h index 00851e1395..a836839559 100644 --- a/analytics/ios_headers/FIRUserPropertyNames.h +++ b/analytics/ios_headers/FIRUserPropertyNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.13.0. +// Copied from Firebase Analytics iOS SDK 10.14.0. /// @file FIRUserPropertyNames.h /// diff --git a/analytics/src/analytics_android.cc b/analytics/src/analytics_android.cc index 649cae9561..43e76f7f9a 100644 --- a/analytics/src/analytics_android.cc +++ b/analytics/src/analytics_android.cc @@ -411,6 +411,16 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress( // No-op on Android } +/// Initiates on-device conversion measurement given a phone number on iOS +/// (no-op on Android). On iOS, requires dependency +/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a +/// no-op. +void InitiateOnDeviceConversionMeasurementWithPhoneNumber( + const char* phone_number) { + FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized()); + // No-op on Android +} + // Set a user property to the given value. void SetUserProperty(const char* name, const char* value) { FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized()); diff --git a/analytics/src/analytics_ios.mm b/analytics/src/analytics_ios.mm index ecb6480788..5e860df3a8 100644 --- a/analytics/src/analytics_ios.mm +++ b/analytics/src/analytics_ios.mm @@ -266,6 +266,14 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(const char* email_add [FIRAnalytics initiateOnDeviceConversionMeasurementWithEmailAddress:@(email_address)]; } +/// Initiates on-device conversion measurement given a phone number on iOS (no-op on +/// Android). On iOS, requires dependency GoogleAppMeasurementOnDeviceConversion to be linked +/// in, otherwise it is a no-op. +void InitiateOnDeviceConversionMeasurementWithPhoneNumber(const char* phone_number) { + FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized()); + [FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:@(phone_number)]; +} + // Set a user property to the given value. void SetUserProperty(const char* name, const char* value) { FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized()); diff --git a/analytics/src/analytics_stub.cc b/analytics/src/analytics_stub.cc index e87c54774d..b207a76080 100644 --- a/analytics/src/analytics_stub.cc +++ b/analytics/src/analytics_stub.cc @@ -106,6 +106,15 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress( FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized()); } +/// Initiates on-device conversion measurement given a phone number on iOS +/// (no-op on Android). On iOS, requires dependency +/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a +/// no-op. +void InitiateOnDeviceConversionMeasurementWithPhoneNumber( + const char* phone_number) { + FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized()); +} + // Set a user property to the given value. void SetUserProperty(const char* /*name*/, const char* /*value*/) { FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized()); diff --git a/analytics/src/include/firebase/analytics.h b/analytics/src/include/firebase/analytics.h index 973890b20f..c1caa4aecb 100644 --- a/analytics/src/include/firebase/analytics.h +++ b/analytics/src/include/firebase/analytics.h @@ -487,6 +487,17 @@ void LogEvent(const char* name, const Parameter* parameters, void InitiateOnDeviceConversionMeasurementWithEmailAddress( const char* email_address); +/// Initiates on-device conversion measurement given a phone number in E.164 +/// format on iOS (no-op on Android). On iOS, requires dependency +/// GoogleAppMeasurementOnDeviceConversion to be linked in, otherwise it is a +/// no-op. +/// @param phone_number User phone number. Must be in E.164 format, which means +/// it must be +/// limited to a maximum of 15 digits and must include a plus sign (+) prefix +/// and country code with no dashes, parentheses, or spaces. +void InitiateOnDeviceConversionMeasurementWithPhoneNumber( + const char* phone_number); + /// @brief Set a user property to the given value. /// /// Properties associated with a user allow a developer to segment users diff --git a/analytics/src_ios/fake/FIRAnalytics.h b/analytics/src_ios/fake/FIRAnalytics.h index dc2d79de38..50b1b7ca36 100644 --- a/analytics/src_ios/fake/FIRAnalytics.h +++ b/analytics/src_ios/fake/FIRAnalytics.h @@ -23,6 +23,8 @@ + (void)initiateOnDeviceConversionMeasurementWithEmailAddress:(nonnull NSString *)emailAddress; ++ (void)InitiateOnDeviceConversionMeasurementWithPhoneNumber:(nonnull NSString *)phoneNumber; + + (void)setUserPropertyString:(nullable NSString *)value forName:(nonnull NSString *)name; + (void)setUserID:(nullable NSString *)userID; diff --git a/analytics/src_ios/fake/FIRAnalytics.mm b/analytics/src_ios/fake/FIRAnalytics.mm index 61c160d9fb..11048e3dd0 100644 --- a/analytics/src_ios/fake/FIRAnalytics.mm +++ b/analytics/src_ios/fake/FIRAnalytics.mm @@ -60,6 +60,11 @@ + (void)initiateOnDeviceConversionMeasurementWithEmailAddress:(nonnull NSString { [emailAddress UTF8String] }); } ++ (void)initiateOnDeviceConversionMeasurementWithPhoneNumber:(nonnull NSString *)phoneNumber { + FakeReporter->AddReport("+[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:]", + { [phoneNumber UTF8String] }); +} + + (void)setUserPropertyString:(nullable NSString *)value forName:(nonnull NSString *)name { FakeReporter->AddReport("+[FIRAnalytics setUserPropertyString:forName:]", { [name UTF8String], value ? [value UTF8String] : "nil" }); diff --git a/analytics/tests/analytics_test.cc b/analytics/tests/analytics_test.cc index ed0112f7c1..8235c69e25 100644 --- a/analytics/tests/analytics_test.cc +++ b/analytics/tests/analytics_test.cc @@ -232,6 +232,16 @@ TEST_F(AnalyticsTest, InitiateOnDeviceConversionMeasurementWithEmailAddress("my_email"); } +TEST_F(AnalyticsTest, + TestInitiateOnDeviceConversionMeasurementWithPhoneNumber) { + // InitiateOnDeviceConversionMeasurementWithPhoneNumber is no-op on Android + AddExpectationApple( + "+[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:]", + {"+15551234567"}); + + InitiateOnDeviceConversionMeasurementWithPhoneNumber("+15551234567"); +} + TEST_F(AnalyticsTest, TestSetUserProperty) { AddExpectationAndroid("FirebaseAnalytics.setUserProperty", {"my_property", "my_value"}); diff --git a/app/app_resources/build.gradle b/app/app_resources/build.gradle index 6fecf213be..0e2e67eb90 100644 --- a/app/app_resources/build.gradle +++ b/app/app_resources/build.gradle @@ -50,7 +50,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' } diff --git a/app/google_api_resources/build.gradle b/app/google_api_resources/build.gradle index f299d7ac6a..7179f73249 100644 --- a/app/google_api_resources/build.gradle +++ b/app/google_api_resources/build.gradle @@ -53,7 +53,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-base:18.2.0' implementation project(':app:app_resources') diff --git a/app/integration_test/Podfile b/app/integration_test/Podfile index d0c27722ff..004068168c 100644 --- a/app/integration_test/Podfile +++ b/app/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/Analytics', '10.13.0' + pod 'Firebase/Analytics', '10.14.0' end post_install do |installer| diff --git a/app/invites_resources/build.gradle b/app/invites_resources/build.gradle index 90e7eaa71e..bb867b88c0 100644 --- a/app/invites_resources/build.gradle +++ b/app/invites_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-dynamic-links' implementation project(':app:app_resources') diff --git a/app_check/app_check_resources/build.gradle b/app_check/app_check_resources/build.gradle index 56fd0ab30a..5826312c0a 100644 --- a/app_check/app_check_resources/build.gradle +++ b/app_check/app_check_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-appcheck' } diff --git a/app_check/integration_test/Podfile b/app_check/integration_test/Podfile index a809bb6f62..8d33fe3857 100644 --- a/app_check/integration_test/Podfile +++ b/app_check/integration_test/Podfile @@ -4,20 +4,20 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/AppCheck', '10.13.0' - pod 'Firebase/Database', '10.13.0' - pod 'Firebase/Auth', '10.13.0' - pod 'Firebase/Storage', '10.13.0' - pod 'Firebase/Functions', '10.13.0' + pod 'Firebase/AppCheck', '10.14.0' + pod 'Firebase/Database', '10.14.0' + pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Storage', '10.14.0' + pod 'Firebase/Functions', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/AppCheck', '10.13.0' - pod 'Firebase/Database', '10.13.0' - pod 'Firebase/Auth', '10.13.0' - pod 'Firebase/Storage', '10.13.0' - pod 'Firebase/Functions', '10.13.0' + pod 'Firebase/AppCheck', '10.14.0' + pod 'Firebase/Database', '10.14.0' + pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Storage', '10.14.0' + pod 'Firebase/Functions', '10.14.0' end post_install do |installer| diff --git a/auth/auth_resources/build.gradle b/auth/auth_resources/build.gradle index 1f5801963e..6fce36e3c4 100644 --- a/auth/auth_resources/build.gradle +++ b/auth/auth_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-auth' implementation project(':app:app_resources') diff --git a/auth/integration_test/Podfile b/auth/integration_test/Podfile index 0a7cf70936..9e0f830af9 100644 --- a/auth/integration_test/Podfile +++ b/auth/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Auth', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Auth', '10.14.0' end post_install do |installer| diff --git a/auth/src/android/auth_android.cc b/auth/src/android/auth_android.cc index 965db474a4..afbe82af75 100644 --- a/auth/src/android/auth_android.cc +++ b/auth/src/android/auth_android.cc @@ -188,11 +188,19 @@ void UpdateCurrentUser(AuthData* auth_data) { } } +void SetEmulatorJni(AuthData* auth_data, const char* host, uint32_t port) { + JNIEnv* env = Env(auth_data); + + jstring j_host = env->NewStringUTF(host); + env->CallVoidMethod(AuthImpl(auth_data), + auth::GetMethodId(auth::kUseEmulator), j_host, port); + env->DeleteLocalRef(j_host); + firebase::util::CheckAndClearJniExceptions(env); +} + const char* const kEmulatorLocalHost = "10.0.2.2"; const char* const kEmulatorPort = "9099"; void CheckEmulator(AuthData* auth_data) { - JNIEnv* env = Env(auth_data); - // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { LogInfo("Using Auth Prod for testing."); @@ -207,12 +215,7 @@ void CheckEmulator(AuthData* auth_data) { if (std::getenv("AUTH_EMULATOR_PORT") != nullptr) { port = std::stoi(std::getenv("AUTH_EMULATOR_PORT")); } - - jstring j_host = env->NewStringUTF(kEmulatorLocalHost); - env->CallVoidMethod(AuthImpl(auth_data), - auth::GetMethodId(auth::kUseEmulator), j_host, port); - env->DeleteLocalRef(j_host); - firebase::util::CheckAndClearJniExceptions(env); + SetEmulatorJni(auth_data, kEmulatorLocalHost, port); } // Release cached Java classes. @@ -828,6 +831,10 @@ Future Auth::SendPasswordResetEmail(const char* email) { return MakeFuture(&futures, handle); } +void Auth::UseEmulator(std::string host, uint32_t port) { + SetEmulatorJni(auth_data_, host.c_str(), port); +} + // Not implemented for Android. void EnableTokenAutoRefresh(AuthData* auth_data) {} void DisableTokenAutoRefresh(AuthData* auth_data) {} diff --git a/auth/src/desktop/auth_desktop.cc b/auth/src/desktop/auth_desktop.cc index b0d5bcbd19..7d3a388baf 100644 --- a/auth/src/desktop/auth_desktop.cc +++ b/auth/src/desktop/auth_desktop.cc @@ -715,6 +715,14 @@ void Auth::UseAppLanguage() { auth_impl->language_code.assign(empty_string); } +void Auth::UseEmulator(std::string host, uint32_t port) { + auto auth_impl = static_cast(auth_data_->auth_impl); + auth_impl->assigned_emulator_url = ""; + auth_impl->assigned_emulator_url.append(host); + auth_impl->assigned_emulator_url.append(":"); + auth_impl->assigned_emulator_url.append(std::to_string(port)); +} + void InitializeTokenRefresher(AuthData* auth_data) { auto auth_impl = static_cast(auth_data->auth_impl); auth_impl->token_refresh_thread.Initialize(auth_data); diff --git a/auth/src/desktop/auth_desktop.h b/auth/src/desktop/auth_desktop.h index 2d407cab16..ac3c010942 100644 --- a/auth/src/desktop/auth_desktop.h +++ b/auth/src/desktop/auth_desktop.h @@ -188,6 +188,8 @@ struct AuthImpl { // The current user language code. This can be set to the app’s current // language by calling SetLanguageCode. std::string language_code; + + std::string assigned_emulator_url; }; // Constant, describing how often we automatically fetch a new auth token. diff --git a/auth/src/desktop/rpcs/auth_request.cc b/auth/src/desktop/rpcs/auth_request.cc index 77fb7ea07c..a4f4b9dd3b 100644 --- a/auth/src/desktop/rpcs/auth_request.cc +++ b/auth/src/desktop/rpcs/auth_request.cc @@ -23,6 +23,8 @@ #include "app/src/heartbeat/heartbeat_controller_desktop.h" #include "app/src/include/firebase/app.h" #include "app/src/include/firebase/internal/mutex.h" +#include "auth/src/desktop/auth_desktop.h" +#include "auth/src/include/firebase/auth.h" #include "firebase/log.h" namespace firebase { @@ -33,39 +35,9 @@ const char* kHeaderFirebaseLocale = "X-Firebase-Locale"; AuthRequest::AuthRequest(::firebase::App& app, const char* schema, bool deliver_heartbeat) - : RequestJson(schema) { - // The user agent strings are cached in static variables here to avoid - // dependencies upon other parts of this library. This complication is due to - // the way the tests are currently configured where each library has minimal - // dependencies. + : RequestJson(schema), app(app) { + CheckEnvEmulator(); - CheckEmulator(); - static std::string auth_user_agent; // NOLINT - static std::string extended_auth_user_agent; // NOLINT - static Mutex* user_agent_mutex = new Mutex(); - MutexLock lock(*user_agent_mutex); - if (auth_user_agent.empty()) { - std::string sdk; - std::string version; - app_common::GetOuterMostSdkAndVersion(&sdk, &version); - // Set the user agent similar to the iOS SDK. Format: - // FirebaseAuth./ - assert(!(sdk.empty() || version.empty())); - std::string sdk_type(sdk.substr(sizeof(FIREBASE_USER_AGENT_PREFIX) - 1)); - auth_user_agent = std::string("FirebaseAuth.") + sdk_type + "/" + version; - // Generage the extended header to set the format specified by b/28531026 - // and b/64693042 to include the platform and framework. - // /// - // where is '(FirebaseCore|FirebaseUI)'. - extended_auth_user_agent = std::string(app_common::kOperatingSystem) + "/" + - sdk + "/" + version + "/" + "FirebaseCore-" + - sdk_type; - } - // TODO(b/244643516): Remove the User-Agent and X-Client-Version headers. - if (!auth_user_agent.empty()) { - add_header("User-Agent", auth_user_agent.c_str()); - add_header("X-Client-Version", extended_auth_user_agent.c_str()); - } if (deliver_heartbeat) { std::shared_ptr heartbeat_controller = app.GetHeartbeatController(); @@ -81,6 +53,17 @@ AuthRequest::AuthRequest(::firebase::App& app, const char* schema, } std::string AuthRequest::GetUrl() { + std::string emulator_url; + Auth* auth_ptr = Auth::GetAuth(&app); + std::string assigned_emulator_url = + static_cast(auth_ptr->auth_data_->auth_impl) + ->assigned_emulator_url; + if (assigned_emulator_url.empty()) { + emulator_url = env_emulator_url; + } else { + emulator_url = assigned_emulator_url; + } + if (emulator_url.empty()) { std::string url(kHttps); url += kServerURL; @@ -94,25 +77,26 @@ std::string AuthRequest::GetUrl() { } } -void AuthRequest::CheckEmulator() { - if (!emulator_url.empty()) { - LogInfo("Emulator Url already set: %s", emulator_url.c_str()); +void AuthRequest::CheckEnvEmulator() { + if (!env_emulator_url.empty()) { + LogInfo("Environment Emulator Url already set: %s", + env_emulator_url.c_str()); return; } + // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { - LogInfo("Using Auth Prod for testing."); + LogInfo("USE_AUTH_EMULATOR not set."); return; } - LogInfo("Using Auth Emulator."); - emulator_url.append(kEmulatorLocalHost); - emulator_url.append(":"); + env_emulator_url.append(kEmulatorLocalHost); + env_emulator_url.append(":"); // Use AUTH_EMULATOR_PORT if it is set to non empty string, // otherwise use the default port. if (std::getenv("AUTH_EMULATOR_PORT") == nullptr) { - emulator_url.append(kEmulatorPort); + env_emulator_url.append(kEmulatorPort); } else { - emulator_url.append(std::getenv("AUTH_EMULATOR_PORT")); + env_emulator_url.append(std::getenv("AUTH_EMULATOR_PORT")); } } diff --git a/auth/src/desktop/rpcs/auth_request.h b/auth/src/desktop/rpcs/auth_request.h index 88835e946c..889e04aea7 100644 --- a/auth/src/desktop/rpcs/auth_request.h +++ b/auth/src/desktop/rpcs/auth_request.h @@ -55,8 +55,9 @@ class AuthRequest std::string GetUrl(); private: - void CheckEmulator(); - std::string emulator_url; + void CheckEnvEmulator(); + std::string env_emulator_url; + ::firebase::App& app; }; } // namespace auth diff --git a/auth/src/include/firebase/auth.h b/auth/src/include/firebase/auth.h index f9c8bfbf36..9fdab7810b 100644 --- a/auth/src/include/firebase/auth.h +++ b/auth/src/include/firebase/auth.h @@ -45,6 +45,7 @@ struct AuthData; class AuthStateListener; class IdTokenListener; class PhoneAuthProvider; +class AuthRequest; struct AuthCompletionHandle; struct AuthResultCompletionHandle; class FederatedAuthProvider; @@ -631,6 +632,14 @@ class Auth { void RemoveIdTokenListener(IdTokenListener* listener); #endif // not SWIG +#if !defined(DOXYGEN) && !defined(SWIG) + /// + /// Modify this Auth instance to communicate with the Firebase Authentication + /// emulator. + /// + void UseEmulator(std::string host, uint32_t port); +#endif //! defined(DOXYGEN), to hide the api from public documentation. + /// Gets the App this auth object is connected to. App& app(); @@ -653,6 +662,7 @@ class Auth { /// @cond FIREBASE_APP_INTERNAL friend class ::firebase::App; friend class ::firebase::auth::PhoneAuthProvider; + friend class ::firebase::auth::AuthRequest; friend class IdTokenRefreshListener; friend class IdTokenRefreshThread; friend class UserDataPersist; diff --git a/auth/src/ios/auth_ios.mm b/auth/src/ios/auth_ios.mm index 59a4e3fe3d..4b77c1ae9b 100644 --- a/auth/src/ios/auth_ios.mm +++ b/auth/src/ios/auth_ios.mm @@ -157,6 +157,11 @@ void UpdateCurrentUser(AuthData *auth_data) { SetUserImpl(auth_data, user); } +void SetEmulatorJni(AuthData *auth_data, const char *host, uint32_t port) { + NSUInteger ns_port = port; + [AuthImpl(auth_data) useEmulatorWithHost:@(host) port:ns_port]; +} + void CheckEmulator(AuthData *auth_data) { // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { @@ -164,7 +169,6 @@ void CheckEmulator(AuthData *auth_data) { return; } LogInfo("Using Auth Emulator."); - // Use AUTH_EMULATOR_PORT if it is set to non empty string, // otherwise use the default port. uint32_t port = std::stoi(kEmulatorPort); @@ -172,8 +176,7 @@ void CheckEmulator(AuthData *auth_data) { port = std::stoi(std::getenv("AUTH_EMULATOR_PORT")); } - NSUInteger ns_port = port; - [AuthImpl(auth_data) useEmulatorWithHost:@(kEmulatorLocalHost) port:ns_port]; + SetEmulatorJni(auth_data, kEmulatorLocalHost, port); } // Platform-specific method to initialize AuthData. @@ -700,6 +703,10 @@ void SignInResultCallback(FIRAuthDataResult *_Nullable auth_result, NSError *_Nu return MakeFuture(&futures, handle); } +void Auth::UseEmulator(std::string host, uint32_t port) { + SetEmulatorJni(auth_data_, host.c_str(), port); +} + // Remap iOS SDK errors reported by the UIDelegate. While these errors seem like // user interaction errors, they are actually caused by bad provider ids. NSError *RemapBadProviderIDErrors(NSError *_Nonnull error) { diff --git a/cmake/external/firestore.cmake b/cmake/external/firestore.cmake index 5715648693..825dab88f4 100644 --- a/cmake/external/firestore.cmake +++ b/cmake/external/firestore.cmake @@ -20,7 +20,7 @@ endif() # If the format of the line below changes, then be sure to update # https://github.com/firebase/firebase-cpp-sdk/blob/fd054fa016/.github/workflows/update-dependencies.yml#L81 -set(version CocoaPods-10.13.0) +set(version CocoaPods-10.14.0) function(GetReleasedDep) message("Getting released firebase-ios-sdk @ ${version}") diff --git a/database/database_resources/build.gradle b/database/database_resources/build.gradle index 02b23cb111..6e4e81f191 100644 --- a/database/database_resources/build.gradle +++ b/database/database_resources/build.gradle @@ -45,7 +45,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-database' //implementation project(':app:app_resources') diff --git a/database/integration_test/Podfile b/database/integration_test/Podfile index beea7f84d9..29649fd9a7 100644 --- a/database/integration_test/Podfile +++ b/database/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Database', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Database', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Database', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Database', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end post_install do |installer| diff --git a/dynamic_links/integration_test/Podfile b/dynamic_links/integration_test/Podfile index 9dff3be5be..2fa773d205 100644 --- a/dynamic_links/integration_test/Podfile +++ b/dynamic_links/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/DynamicLinks', '10.13.0' + pod 'Firebase/DynamicLinks', '10.14.0' end post_install do |installer| diff --git a/firestore/firestore_resources/build.gradle b/firestore/firestore_resources/build.gradle index 9f4bfd98ab..cbd73238e0 100644 --- a/firestore/firestore_resources/build.gradle +++ b/firestore/firestore_resources/build.gradle @@ -53,7 +53,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-firestore' } diff --git a/firestore/integration_test/Podfile b/firestore/integration_test/Podfile index 89a8007786..174654f54d 100644 --- a/firestore/integration_test/Podfile +++ b/firestore/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Firestore', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Firestore', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Firestore', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end post_install do |installer| diff --git a/firestore/integration_test_internal/Podfile b/firestore/integration_test_internal/Podfile index 3cbb9cce62..374efd97c7 100644 --- a/firestore/integration_test_internal/Podfile +++ b/firestore/integration_test_internal/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Firestore', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Firestore', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Firestore', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end post_install do |installer| diff --git a/firestore/src/main/query_main.cc b/firestore/src/main/query_main.cc index ffed058c9e..ee73ff29ea 100644 --- a/firestore/src/main/query_main.cc +++ b/firestore/src/main/query_main.cc @@ -176,7 +176,8 @@ core::Bound QueryInternal::ToBound( const core::Query& internal_query = query_.query(); SharedMessage components{{}}; - components->values_count = CheckedSize(internal_query.order_bys().size()); + components->values_count = + CheckedSize(internal_query.normalized_order_bys().size()); components->values = MakeArray(components->values_count); @@ -187,8 +188,8 @@ core::Bound QueryInternal::ToBound( // the provided document. Without the key (by using the explicit sort orders), // multiple documents could match the position, yielding duplicate results. - for (size_t i = 0; i < internal_query.order_bys().size(); ++i) { - const core::OrderBy& order_by = internal_query.order_bys()[i]; + for (size_t i = 0; i < internal_query.normalized_order_bys().size(); ++i) { + const core::OrderBy& order_by = internal_query.normalized_order_bys()[i]; const model::FieldPath& field_path = order_by.field(); if (field_path.IsKeyFieldPath()) { diff --git a/functions/integration_test/Podfile b/functions/integration_test/Podfile index 22ef139816..04bd164eec 100644 --- a/functions/integration_test/Podfile +++ b/functions/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Functions', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Functions', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Functions', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Functions', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end post_install do |installer| diff --git a/gma/gma_resources/build.gradle b/gma/gma_resources/build.gradle index 79dc1bb0a8..735d2291cc 100644 --- a/gma/gma_resources/build.gradle +++ b/gma/gma_resources/build.gradle @@ -45,9 +45,9 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' - implementation 'com.google.android.gms:play-services-ads:22.2.0' + implementation 'com.google.android.gms:play-services-ads:22.3.0' } afterEvaluate { diff --git a/gma/integration_test/Podfile b/gma/integration_test/Podfile index b347ca3b39..d01f3826b1 100644 --- a/gma/integration_test/Podfile +++ b/gma/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/CoreOnly', '10.13.0' + pod 'Firebase/CoreOnly', '10.14.0' pod 'Google-Mobile-Ads-SDK', '10.9.0' pod 'GoogleUserMessagingPlatform', '2.1.0' end diff --git a/installations/integration_test/Podfile b/installations/integration_test/Podfile index 5c001d5b3a..3a330ec187 100644 --- a/installations/integration_test/Podfile +++ b/installations/integration_test/Podfile @@ -4,8 +4,8 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/Analytics', '10.13.0' - pod 'Firebase/Installations', '10.13.0' + pod 'Firebase/Analytics', '10.14.0' + pod 'Firebase/Installations', '10.14.0' end post_install do |installer| diff --git a/ios_pod/Podfile b/ios_pod/Podfile index fc5a040227..b637910139 100644 --- a/ios_pod/Podfile +++ b/ios_pod/Podfile @@ -3,21 +3,20 @@ platform :ios, '11.0' use_frameworks! target 'GetPods' do - pod 'Firebase/Core', '10.13.0' + pod 'Firebase/Core', '10.14.0' pod 'Google-Mobile-Ads-SDK', '10.9.0' pod 'GoogleUserMessagingPlatform', '2.1.0' - pod 'Firebase/Analytics', '10.13.0' - pod 'Firebase/AppCheck', '10.13.0' - pod 'Firebase/Auth', '10.13.0' - pod 'Firebase/Crashlytics', '10.13.0' - pod 'Firebase/Database', '10.13.0' - pod 'Firebase/DynamicLinks', '10.13.0' - pod 'Firebase/Firestore', '10.13.0' - pod 'Firebase/Functions', '10.13.0' - pod 'Firebase/Installations', '10.13.0' - pod 'Firebase/Messaging', '10.13.0' - pod 'Firebase/RemoteConfig', '10.13.0' - pod 'Firebase/Storage', '10.13.0' - + pod 'Firebase/Analytics', '10.14.0' + pod 'Firebase/AppCheck', '10.14.0' + pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Crashlytics', '10.14.0' + pod 'Firebase/Database', '10.14.0' + pod 'Firebase/DynamicLinks', '10.14.0' + pod 'Firebase/Firestore', '10.14.0' + pod 'Firebase/Functions', '10.14.0' + pod 'Firebase/Installations', '10.14.0' + pod 'Firebase/Messaging', '10.14.0' + pod 'Firebase/RemoteConfig', '10.14.0' + pod 'Firebase/Storage', '10.14.0' end diff --git a/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h b/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h index 75a6cfd445..df3530cbde 100644 --- a/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEANALYTICSSWIFT_SWIFT_H #define FIREBASEANALYTICSSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,17 +258,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseAnalyticsSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseAnalyticsSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -257,33 +281,37 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEANALYTICSSWIFT_SWIFT_H #define FIREBASEANALYTICSSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -292,191 +320,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -485,7 +531,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -499,17 +545,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseAnalyticsSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseAnalyticsSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -517,7 +568,7 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h b/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h index 900a26353e..65e8219511 100644 --- a/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h +++ b/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASECOREINTERNAL_SWIFT_H #define FIREBASECOREINTERNAL_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -240,17 +259,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseCoreInternal",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseCoreInternal", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -258,27 +282,30 @@ using UInt = size_t; @class NSString; @class FIRHeartbeatsPayload; -/// An object that provides API to log and flush heartbeats from a synchronized storage container. +/// An object that provides API to log and flush heartbeats from a synchronized +/// storage container. SWIFT_CLASS_NAMED("_ObjC_HeartbeatController") @interface FIRHeartbeatController : NSObject /// Public initializer. -/// \param id The id to associate this controller’s heartbeat storage with. +/// \param id The id to associate this controller’s heartbeat +/// storage with. /// -- (nonnull instancetype)initWithId:(NSString * _Nonnull)id OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithId:(NSString* _Nonnull)id + OBJC_DESIGNATED_INITIALIZER; /// Asynchronously logs a new heartbeat, if needed. /// note: /// This API is thread-safe. -/// \param agent The string agent (i.e. Firebase User Agent) to associate the logged -/// heartbeat with. +/// \param agent The string agent (i.e. Firebase User Agent) to associate the +/// logged heartbeat with. /// -- (void)log:(NSString * _Nonnull)agent; +- (void)log:(NSString* _Nonnull)agent; /// Synchronously flushes heartbeats from storage into a heartbeats payload. /// note: /// This API is thread-safe. /// /// returns: /// A heartbeats payload for the flushed heartbeat(s). -- (FIRHeartbeatsPayload * _Nonnull)flush SWIFT_WARN_UNUSED_RESULT; +- (FIRHeartbeatsPayload* _Nonnull)flush SWIFT_WARN_UNUSED_RESULT; /// Synchronously flushes the heartbeat for today. /// If no heartbeat was logged today, the returned payload is empty. /// note: @@ -286,23 +313,23 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatController") /// /// returns: /// A heartbeats payload for the flushed heartbeat. -- (FIRHeartbeatsPayload * _Nonnull)flushHeartbeatFromToday SWIFT_WARN_UNUSED_RESULT; +- (FIRHeartbeatsPayload* _Nonnull) + flushHeartbeatFromToday SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - -/// A model object representing a payload of heartbeat data intended for sending in network -/// requests. +/// A model object representing a payload of heartbeat data intended for sending +/// in network requests. SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") @interface FIRHeartbeatsPayload : NSObject /// Returns a processed payload string intended for use in a HTTP header. /// /// returns: /// A string value from the heartbeats payload. -- (NSString * _Nonnull)headerValue SWIFT_WARN_UNUSED_RESULT; +- (NSString* _Nonnull)headerValue SWIFT_WARN_UNUSED_RESULT; /// A Boolean value indicating whether the payload is empty. -@property (nonatomic, readonly) BOOL isEmpty; +@property(nonatomic, readonly) BOOL isEmpty; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end @@ -311,33 +338,37 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASECOREINTERNAL_SWIFT_H #define FIREBASECOREINTERNAL_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -346,191 +377,209 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -539,7 +588,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -554,17 +603,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseCoreInternal",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseCoreInternal", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -572,27 +626,30 @@ using UInt = size_t; @class NSString; @class FIRHeartbeatsPayload; -/// An object that provides API to log and flush heartbeats from a synchronized storage container. +/// An object that provides API to log and flush heartbeats from a synchronized +/// storage container. SWIFT_CLASS_NAMED("_ObjC_HeartbeatController") @interface FIRHeartbeatController : NSObject /// Public initializer. -/// \param id The id to associate this controller’s heartbeat storage with. +/// \param id The id to associate this controller’s heartbeat +/// storage with. /// -- (nonnull instancetype)initWithId:(NSString * _Nonnull)id OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithId:(NSString* _Nonnull)id + OBJC_DESIGNATED_INITIALIZER; /// Asynchronously logs a new heartbeat, if needed. /// note: /// This API is thread-safe. -/// \param agent The string agent (i.e. Firebase User Agent) to associate the logged -/// heartbeat with. +/// \param agent The string agent (i.e. Firebase User Agent) to associate the +/// logged heartbeat with. /// -- (void)log:(NSString * _Nonnull)agent; +- (void)log:(NSString* _Nonnull)agent; /// Synchronously flushes heartbeats from storage into a heartbeats payload. /// note: /// This API is thread-safe. /// /// returns: /// A heartbeats payload for the flushed heartbeat(s). -- (FIRHeartbeatsPayload * _Nonnull)flush SWIFT_WARN_UNUSED_RESULT; +- (FIRHeartbeatsPayload* _Nonnull)flush SWIFT_WARN_UNUSED_RESULT; /// Synchronously flushes the heartbeat for today. /// If no heartbeat was logged today, the returned payload is empty. /// note: @@ -600,23 +657,23 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatController") /// /// returns: /// A heartbeats payload for the flushed heartbeat. -- (FIRHeartbeatsPayload * _Nonnull)flushHeartbeatFromToday SWIFT_WARN_UNUSED_RESULT; +- (FIRHeartbeatsPayload* _Nonnull) + flushHeartbeatFromToday SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - -/// A model object representing a payload of heartbeat data intended for sending in network -/// requests. +/// A model object representing a payload of heartbeat data intended for sending +/// in network requests. SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") @interface FIRHeartbeatsPayload : NSObject /// Returns a processed payload string intended for use in a HTTP header. /// /// returns: /// A string value from the heartbeats payload. -- (NSString * _Nonnull)headerValue SWIFT_WARN_UNUSED_RESULT; +- (NSString* _Nonnull)headerValue SWIFT_WARN_UNUSED_RESULT; /// A Boolean value indicating whether the payload is empty. -@property (nonatomic, readonly) BOOL isEmpty; +@property(nonatomic, readonly) BOOL isEmpty; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end @@ -625,7 +682,7 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h b/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h index 6858831af3..bc4894cb40 100644 --- a/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEDATABASESWIFT_SWIFT_H #define FIREBASEDATABASESWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,54 +258,61 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseDatabaseSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseDatabaseSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEDATABASESWIFT_SWIFT_H #define FIREBASEDATABASESWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -295,191 +321,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -488,7 +532,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -502,28 +546,31 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseDatabaseSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseDatabaseSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h b/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h index 4a0c82b7e6..2ef87db1c4 100644 --- a/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEFIRESTORESWIFT_SWIFT_H #define FIREBASEFIRESTORESWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,66 +258,61 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFirestoreSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseFirestoreSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - - - - - - - - - - - - - - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEFIRESTORESWIFT_SWIFT_H #define FIREBASEFIRESTORESWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -307,191 +321,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -500,7 +532,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -514,40 +546,31 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFirestoreSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseFirestoreSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - - - - - - - - - - - - - - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseFunctions-Swift.h b/ios_pod/swift_headers/FirebaseFunctions-Swift.h index 30701d8af1..3cf7c4903e 100644 --- a/ios_pod/swift_headers/FirebaseFunctions-Swift.h +++ b/ios_pod/swift_headers/FirebaseFunctions-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEFUNCTIONS_SWIFT_H #define FIREBASEFUNCTIONS_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -241,17 +260,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFunctions",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseFunctions", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -261,158 +285,197 @@ using UInt = size_t; @class FIRHTTPSCallableOptions; @class NSURL; -/// Functions is the client for Cloud Functions for a Firebase project. +/// Functions is the client for Cloud Functions for a Firebase +/// project. SWIFT_CLASS_NAMED("Functions") @interface FIRFunctions : NSObject -/// Creates a Cloud Functions client using the default or returns a pre-existing instance if it already exists. +/// Creates a Cloud Functions client using the default or returns a pre-existing +/// instance if it already exists. /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp. -+ (FIRFunctions * _Nonnull)functions SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app, or returns a pre-existing -/// instance if one already exists. -/// \param app The app for the Firebase project. +/// A shared Functions instance initialized with the default +/// FirebaseApp. ++ (FIRFunctions* _Nonnull)functions SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app, or returns a +/// pre-existing instance if one already exists. \param app The app for the +/// Firebase project. /// /// /// returns: -/// A shared Functions instance initialized with the specified FirebaseApp. -+ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; +/// A shared Functions instance initialized with the specified +/// FirebaseApp. ++ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app + SWIFT_WARN_UNUSED_RESULT; /// Creates a Cloud Functions client with the default app and given region. -/// \param region The region for the HTTP trigger, such as us-central1. +/// \param region The region for the HTTP trigger, such as +/// us-central1. /// /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp and a custom region. -+ (FIRFunctions * _Nonnull)functionsForRegion:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing -/// instance if one already exists. -/// \param customDomain A custom domain for the HTTP trigger, such as “https //mydomain.com”. +/// A shared Functions instance initialized with the default +/// FirebaseApp and a custom region. ++ (FIRFunctions* _Nonnull)functionsForRegion:(NSString* _Nonnull)region + SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a +/// pre-existing instance if one already exists. \param customDomain A custom +/// domain for the HTTP trigger, such as “https //mydomain.com”. /// /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp and a custom HTTP trigger domain. -+ (FIRFunctions * _Nonnull)functionsForCustomDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing -/// instance if one already exists. -/// \param app The app for the Firebase project. +/// A shared Functions instance initialized with the default +/// FirebaseApp and a custom HTTP trigger domain. ++ (FIRFunctions* _Nonnull)functionsForCustomDomain: + (NSString* _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a +/// pre-existing instance if one already exists. \param app The app for the +/// Firebase project. /// -/// \param region The region for the HTTP trigger, such as us-central1. +/// \param region The region for the HTTP trigger, such as +/// us-central1. /// /// /// returns: /// An instance of Functions with a custom app and region. -+ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app region:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing -/// instance if one already exists. -/// \param app The app for the Firebase project. ++ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app + region:(NSString* _Nonnull)region + SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a +/// pre-existing instance if one already exists. \param app The app for the +/// Firebase project. /// -/// \param customDomain A custom domain for the HTTP trigger, such as https://mydomain.com. +/// \param customDomain A custom domain for the HTTP trigger, such as +/// https://mydomain.com. /// /// /// returns: -/// An instance of Functions with a custom app and HTTP trigger domain. -+ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app customDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; +/// An instance of Functions with a custom app and HTTP trigger +/// domain. ++ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app + customDomain:(NSString* _Nonnull)customDomain + SWIFT_WARN_UNUSED_RESULT; /// Creates a reference to the Callable HTTPS trigger with the given name. /// \param name The name of the Callable HTTPS trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name SWIFT_WARN_UNUSED_RESULT; -/// Creates a reference to the Callable HTTPS trigger with the given name and configuration -/// options. -/// \param name The name of the Callable HTTPS trigger. +- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithName:(NSString* _Nonnull)name + SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and +/// configuration options. \param name The name of the Callable HTTPS trigger. /// -/// \param options The options with which to customize the Callable HTTPS trigger. +/// \param options The options with which to customize the Callable HTTPS +/// trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; +- (FIRHTTPSCallable* _Nonnull) + HTTPSCallableWithName:(NSString* _Nonnull)name + options:(FIRHTTPSCallableOptions* _Nonnull)options + SWIFT_WARN_UNUSED_RESULT; /// Creates a reference to the Callable HTTPS trigger with the given name. /// \param url The URL of the Callable HTTPS trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates a reference to the Callable HTTPS trigger with the given name and configuration -/// options. -/// \param url The URL of the Callable HTTPS trigger. +- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithURL:(NSURL* _Nonnull)url + SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and +/// configuration options. \param url The URL of the Callable HTTPS trigger. /// -/// \param options The options with which to customize the Callable HTTPS trigger. +/// \param options The options with which to customize the Callable HTTPS +/// trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; -/// Changes this instance to point to a Cloud Functions emulator running locally. -/// See https://firebase.google.com/docs/functions/local-emulator +- (FIRHTTPSCallable* _Nonnull) + HTTPSCallableWithURL:(NSURL* _Nonnull)url + options:(FIRHTTPSCallableOptions* _Nonnull)options + SWIFT_WARN_UNUSED_RESULT; +/// Changes this instance to point to a Cloud Functions emulator running +/// locally. See https://firebase.google.com/docs/functions/local-emulator /// \param host The host of the local emulator, such as “localhost”. /// /// \param port The port of the local emulator, for example 5005. /// -- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; +- (void)useEmulatorWithHost:(NSString* _Nonnull)host port:(NSInteger)port; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end -/// The set of error status codes that can be returned from a Callable HTTPS tigger. These are the -/// canonical error codes for Google APIs, as documented here: +/// The set of error status codes that can be returned from a Callable HTTPS +/// tigger. These are the canonical error codes for Google APIs, as documented +/// here: /// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto#L26 -typedef SWIFT_ENUM_NAMED(NSInteger, FIRFunctionsErrorCode, "FunctionsErrorCode", open) { -/// The operation completed successfully. - FIRFunctionsErrorCodeOK = 0, -/// The operation was cancelled (typically by the caller). - FIRFunctionsErrorCodeCancelled = 1, -/// Unknown error or an error from a different error domain. - FIRFunctionsErrorCodeUnknown = 2, -/// Client specified an invalid argument. Note that this differs from FailedPrecondition. -/// InvalidArgument indicates arguments that are problematic regardless of the state of the -/// system (e.g., an invalid field name). - FIRFunctionsErrorCodeInvalidArgument = 3, -/// Deadline expired before operation could complete. For operations that change the state of the -/// system, this error may be returned even if the operation has completed successfully. For -/// example, a successful response from a server could have been delayed long enough for the -/// deadline to expire. - FIRFunctionsErrorCodeDeadlineExceeded = 4, -/// Some requested document was not found. - FIRFunctionsErrorCodeNotFound = 5, -/// Some document that we attempted to create already exists. - FIRFunctionsErrorCodeAlreadyExists = 6, -/// The caller does not have permission to execute the specified operation. - FIRFunctionsErrorCodePermissionDenied = 7, -/// Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system -/// is out of space. - FIRFunctionsErrorCodeResourceExhausted = 8, -/// Operation was rejected because the system is not in a state required for the operation’s -/// execution. - FIRFunctionsErrorCodeFailedPrecondition = 9, -/// The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - FIRFunctionsErrorCodeAborted = 10, -/// Operation was attempted past the valid range. - FIRFunctionsErrorCodeOutOfRange = 11, -/// Operation is not implemented or not supported/enabled. - FIRFunctionsErrorCodeUnimplemented = 12, -/// Internal errors. Means some invariant expected by underlying system has been broken. If you -/// see one of these errors, something is very broken. - FIRFunctionsErrorCodeInternal = 13, -/// The service is currently unavailable. This is a most likely a transient condition and may be -/// corrected by retrying with a backoff. - FIRFunctionsErrorCodeUnavailable = 14, -/// Unrecoverable data loss or corruption. - FIRFunctionsErrorCodeDataLoss = 15, -/// The request does not have valid authentication credentials for the operation. - FIRFunctionsErrorCodeUnauthenticated = 16, +typedef SWIFT_ENUM_NAMED(NSInteger, FIRFunctionsErrorCode, "FunctionsErrorCode", + open){ + /// The operation completed successfully. + FIRFunctionsErrorCodeOK = 0, + /// The operation was cancelled (typically by the caller). + FIRFunctionsErrorCodeCancelled = 1, + /// Unknown error or an error from a different error domain. + FIRFunctionsErrorCodeUnknown = 2, + /// Client specified an invalid argument. Note that this differs from + /// FailedPrecondition. + /// InvalidArgument indicates arguments that are problematic + /// regardless of the state of the + /// system (e.g., an invalid field name). + FIRFunctionsErrorCodeInvalidArgument = 3, + /// Deadline expired before operation could complete. For operations that + /// change the state of the + /// system, this error may be returned even if the operation has completed + /// successfully. For + /// example, a successful response from a server could have been delayed + /// long enough for the + /// deadline to expire. + FIRFunctionsErrorCodeDeadlineExceeded = 4, + /// Some requested document was not found. + FIRFunctionsErrorCodeNotFound = 5, + /// Some document that we attempted to create already exists. + FIRFunctionsErrorCodeAlreadyExists = 6, + /// The caller does not have permission to execute the specified operation. + FIRFunctionsErrorCodePermissionDenied = 7, + /// Some resource has been exhausted, perhaps a per-user quota, or perhaps + /// the entire file system + /// is out of space. + FIRFunctionsErrorCodeResourceExhausted = 8, + /// Operation was rejected because the system is not in a state required for + /// the operation’s + /// execution. + FIRFunctionsErrorCodeFailedPrecondition = 9, + /// The operation was aborted, typically due to a concurrency issue like + /// transaction aborts, etc. + FIRFunctionsErrorCodeAborted = 10, + /// Operation was attempted past the valid range. + FIRFunctionsErrorCodeOutOfRange = 11, + /// Operation is not implemented or not supported/enabled. + FIRFunctionsErrorCodeUnimplemented = 12, + /// Internal errors. Means some invariant expected by underlying system has + /// been broken. If you + /// see one of these errors, something is very broken. + FIRFunctionsErrorCodeInternal = 13, + /// The service is currently unavailable. This is a most likely a transient + /// condition and may be + /// corrected by retrying with a backoff. + FIRFunctionsErrorCodeUnavailable = 14, + /// Unrecoverable data loss or corruption. + FIRFunctionsErrorCodeDataLoss = 15, + /// The request does not have valid authentication credentials for the + /// operation. + FIRFunctionsErrorCodeUnauthenticated = 16, }; @class FIRHTTPSCallableResult; -/// A HTTPSCallable is a reference to a particular Callable HTTPS trigger in Cloud Functions. +/// A HTTPSCallable is a reference to a particular Callable HTTPS +/// trigger in Cloud Functions. SWIFT_CLASS_NAMED("HTTPSCallable") @interface FIRHTTPSCallable : NSObject /// The timeout to use when calling the function. Defaults to 70 seconds. -@property (nonatomic) NSTimeInterval timeoutInterval; +@property(nonatomic) NSTimeInterval timeoutInterval; /// Executes this Callable HTTPS trigger asynchronously. /// The data passed into the trigger can be any of the following types: ///
      @@ -423,64 +486,74 @@ SWIFT_CLASS_NAMED("HTTPSCallable") /// String /// ///
    • -/// NSNumber, or any Swift numeric type bridgeable to NSNumber +/// NSNumber, or any Swift numeric type bridgeable to +/// NSNumber ///
    • ///
    • -/// [Any], where the contained objects are also one of these types. +/// [Any], where the contained objects are also one of these +/// types. ///
    • ///
    • /// [String: Any] where the values are also one of these types. ///
    • ///
    -/// The request to the Cloud Functions backend made by this method automatically includes a -/// Firebase Installations ID token to identify the app instance. If a user is logged in with -/// Firebase Auth, an auth ID token for the user is also automatically included. -/// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information -/// regarding the app instance. To stop this, see Messaging.deleteData(). It -/// resumes with a new FCM Token the next time you call this method. -/// \param data Parameters to pass to the trigger. +/// The request to the Cloud Functions backend made by this method automatically +/// includes a Firebase Installations ID token to identify the app instance. If +/// a user is logged in with Firebase Auth, an auth ID token for the user is +/// also automatically included. Firebase Cloud Messaging sends data to the +/// Firebase backend periodically to collect information regarding the app +/// instance. To stop this, see Messaging.deleteData(). It resumes +/// with a new FCM Token the next time you call this method. \param data +/// Parameters to pass to the trigger. /// /// \param completion The block to call when the HTTPS request has completed. /// -- (void)callWithObject:(id _Nullable)data completion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; -/// Executes this Callable HTTPS trigger asynchronously. This API should only be used from Objective-C. -/// The request to the Cloud Functions backend made by this method automatically includes a -/// Firebase Installations ID token to identify the app instance. If a user is logged in with -/// Firebase Auth, an auth ID token for the user is also automatically included. -/// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information -/// regarding the app instance. To stop this, see Messaging.deleteData(). It -/// resumes with a new FCM Token the next time you call this method. -/// \param completion The block to call when the HTTPS request has completed. -/// -- (void)callWithCompletion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; +- (void)callWithObject:(id _Nullable)data + completion:(void (^_Nonnull)(FIRHTTPSCallableResult* _Nullable, + NSError* _Nullable))completion; +/// Executes this Callable HTTPS trigger asynchronously. This API should only be +/// used from Objective-C. The request to the Cloud Functions backend made by +/// this method automatically includes a Firebase Installations ID token to +/// identify the app instance. If a user is logged in with Firebase Auth, an +/// auth ID token for the user is also automatically included. Firebase Cloud +/// Messaging sends data to the Firebase backend periodically to collect +/// information regarding the app instance. To stop this, see +/// Messaging.deleteData(). It resumes with a new FCM Token the +/// next time you call this method. \param completion The block to call when the +/// HTTPS request has completed. +/// +- (void)callWithCompletion:(void (^_Nonnull)(FIRHTTPSCallableResult* _Nullable, + NSError* _Nullable))completion; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - /// Configuration options for a HTTPSCallable instance. SWIFT_CLASS_NAMED("HTTPSCallableOptions") @interface FIRHTTPSCallableOptions : NSObject -/// Whether or not to protect the callable function with a limited-use App Check token. -@property (nonatomic, readonly) BOOL requireLimitedUseAppCheckTokens; +/// Whether or not to protect the callable function with a limited-use App Check +/// token. +@property(nonatomic, readonly) BOOL requireLimitedUseAppCheckTokens; /// Designated initializer. -/// \param requireLimitedUseAppCheckTokens A boolean used to decide whether or not to -/// protect the callable function with a limited use App Check token. +/// \param requireLimitedUseAppCheckTokens A boolean used to decide whether or +/// not to protect the callable function with a limited use App Check token. /// -- (nonnull instancetype)initWithRequireLimitedUseAppCheckTokens:(BOOL)requireLimitedUseAppCheckTokens OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithRequireLimitedUseAppCheckTokens: + (BOOL)requireLimitedUseAppCheckTokens OBJC_DESIGNATED_INITIALIZER; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - -/// A HTTPSCallableResult contains the result of calling a HTTPSCallable. +/// A HTTPSCallableResult contains the result of calling a +/// HTTPSCallable. SWIFT_CLASS_NAMED("HTTPSCallableResult") @interface FIRHTTPSCallableResult : NSObject /// The data that was returned from the Callable HTTPS trigger. -/// The data is in the form of native objects. For example, if your trigger returned an -/// array, this object would be an Array. If your trigger returned a JavaScript object with -/// keys and values, this object would be an instance of [String: Any]. -@property (nonatomic, readonly) id _Nonnull data; +/// The data is in the form of native objects. For example, if your trigger +/// returned an array, this object would be an Array. If your +/// trigger returned a JavaScript object with keys and values, this object would +/// be an instance of [String: Any]. +@property(nonatomic, readonly) id _Nonnull data; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end @@ -489,33 +562,37 @@ SWIFT_CLASS_NAMED("HTTPSCallableResult") #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEFUNCTIONS_SWIFT_H #define FIREBASEFUNCTIONS_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -524,191 +601,209 @@ SWIFT_CLASS_NAMED("HTTPSCallableResult") #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -717,7 +812,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -733,17 +828,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseFunctions",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseFunctions", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -753,158 +853,197 @@ using UInt = size_t; @class FIRHTTPSCallableOptions; @class NSURL; -/// Functions is the client for Cloud Functions for a Firebase project. +/// Functions is the client for Cloud Functions for a Firebase +/// project. SWIFT_CLASS_NAMED("Functions") @interface FIRFunctions : NSObject -/// Creates a Cloud Functions client using the default or returns a pre-existing instance if it already exists. +/// Creates a Cloud Functions client using the default or returns a pre-existing +/// instance if it already exists. /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp. -+ (FIRFunctions * _Nonnull)functions SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app, or returns a pre-existing -/// instance if one already exists. -/// \param app The app for the Firebase project. +/// A shared Functions instance initialized with the default +/// FirebaseApp. ++ (FIRFunctions* _Nonnull)functions SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app, or returns a +/// pre-existing instance if one already exists. \param app The app for the +/// Firebase project. /// /// /// returns: -/// A shared Functions instance initialized with the specified FirebaseApp. -+ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; +/// A shared Functions instance initialized with the specified +/// FirebaseApp. ++ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app + SWIFT_WARN_UNUSED_RESULT; /// Creates a Cloud Functions client with the default app and given region. -/// \param region The region for the HTTP trigger, such as us-central1. +/// \param region The region for the HTTP trigger, such as +/// us-central1. /// /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp and a custom region. -+ (FIRFunctions * _Nonnull)functionsForRegion:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing -/// instance if one already exists. -/// \param customDomain A custom domain for the HTTP trigger, such as “https //mydomain.com”. +/// A shared Functions instance initialized with the default +/// FirebaseApp and a custom region. ++ (FIRFunctions* _Nonnull)functionsForRegion:(NSString* _Nonnull)region + SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a +/// pre-existing instance if one already exists. \param customDomain A custom +/// domain for the HTTP trigger, such as “https //mydomain.com”. /// /// /// returns: -/// A shared Functions instance initialized with the default FirebaseApp and a custom HTTP trigger domain. -+ (FIRFunctions * _Nonnull)functionsForCustomDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing -/// instance if one already exists. -/// \param app The app for the Firebase project. +/// A shared Functions instance initialized with the default +/// FirebaseApp and a custom HTTP trigger domain. ++ (FIRFunctions* _Nonnull)functionsForCustomDomain: + (NSString* _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a +/// pre-existing instance if one already exists. \param app The app for the +/// Firebase project. /// -/// \param region The region for the HTTP trigger, such as us-central1. +/// \param region The region for the HTTP trigger, such as +/// us-central1. /// /// /// returns: /// An instance of Functions with a custom app and region. -+ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app region:(NSString * _Nonnull)region SWIFT_WARN_UNUSED_RESULT; -/// Creates a Cloud Functions client with the given app and region, or returns a pre-existing -/// instance if one already exists. -/// \param app The app for the Firebase project. ++ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app + region:(NSString* _Nonnull)region + SWIFT_WARN_UNUSED_RESULT; +/// Creates a Cloud Functions client with the given app and region, or returns a +/// pre-existing instance if one already exists. \param app The app for the +/// Firebase project. /// -/// \param customDomain A custom domain for the HTTP trigger, such as https://mydomain.com. +/// \param customDomain A custom domain for the HTTP trigger, such as +/// https://mydomain.com. /// /// /// returns: -/// An instance of Functions with a custom app and HTTP trigger domain. -+ (FIRFunctions * _Nonnull)functionsForApp:(FIRApp * _Nonnull)app customDomain:(NSString * _Nonnull)customDomain SWIFT_WARN_UNUSED_RESULT; +/// An instance of Functions with a custom app and HTTP trigger +/// domain. ++ (FIRFunctions* _Nonnull)functionsForApp:(FIRApp* _Nonnull)app + customDomain:(NSString* _Nonnull)customDomain + SWIFT_WARN_UNUSED_RESULT; /// Creates a reference to the Callable HTTPS trigger with the given name. /// \param name The name of the Callable HTTPS trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name SWIFT_WARN_UNUSED_RESULT; -/// Creates a reference to the Callable HTTPS trigger with the given name and configuration -/// options. -/// \param name The name of the Callable HTTPS trigger. +- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithName:(NSString* _Nonnull)name + SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and +/// configuration options. \param name The name of the Callable HTTPS trigger. /// -/// \param options The options with which to customize the Callable HTTPS trigger. +/// \param options The options with which to customize the Callable HTTPS +/// trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithName:(NSString * _Nonnull)name options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; +- (FIRHTTPSCallable* _Nonnull) + HTTPSCallableWithName:(NSString* _Nonnull)name + options:(FIRHTTPSCallableOptions* _Nonnull)options + SWIFT_WARN_UNUSED_RESULT; /// Creates a reference to the Callable HTTPS trigger with the given name. /// \param url The URL of the Callable HTTPS trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates a reference to the Callable HTTPS trigger with the given name and configuration -/// options. -/// \param url The URL of the Callable HTTPS trigger. +- (FIRHTTPSCallable* _Nonnull)HTTPSCallableWithURL:(NSURL* _Nonnull)url + SWIFT_WARN_UNUSED_RESULT; +/// Creates a reference to the Callable HTTPS trigger with the given name and +/// configuration options. \param url The URL of the Callable HTTPS trigger. /// -/// \param options The options with which to customize the Callable HTTPS trigger. +/// \param options The options with which to customize the Callable HTTPS +/// trigger. /// /// /// returns: /// A reference to a Callable HTTPS trigger. -- (FIRHTTPSCallable * _Nonnull)HTTPSCallableWithURL:(NSURL * _Nonnull)url options:(FIRHTTPSCallableOptions * _Nonnull)options SWIFT_WARN_UNUSED_RESULT; -/// Changes this instance to point to a Cloud Functions emulator running locally. -/// See https://firebase.google.com/docs/functions/local-emulator +- (FIRHTTPSCallable* _Nonnull) + HTTPSCallableWithURL:(NSURL* _Nonnull)url + options:(FIRHTTPSCallableOptions* _Nonnull)options + SWIFT_WARN_UNUSED_RESULT; +/// Changes this instance to point to a Cloud Functions emulator running +/// locally. See https://firebase.google.com/docs/functions/local-emulator /// \param host The host of the local emulator, such as “localhost”. /// /// \param port The port of the local emulator, for example 5005. /// -- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; +- (void)useEmulatorWithHost:(NSString* _Nonnull)host port:(NSInteger)port; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end -/// The set of error status codes that can be returned from a Callable HTTPS tigger. These are the -/// canonical error codes for Google APIs, as documented here: +/// The set of error status codes that can be returned from a Callable HTTPS +/// tigger. These are the canonical error codes for Google APIs, as documented +/// here: /// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto#L26 -typedef SWIFT_ENUM_NAMED(NSInteger, FIRFunctionsErrorCode, "FunctionsErrorCode", open) { -/// The operation completed successfully. - FIRFunctionsErrorCodeOK = 0, -/// The operation was cancelled (typically by the caller). - FIRFunctionsErrorCodeCancelled = 1, -/// Unknown error or an error from a different error domain. - FIRFunctionsErrorCodeUnknown = 2, -/// Client specified an invalid argument. Note that this differs from FailedPrecondition. -/// InvalidArgument indicates arguments that are problematic regardless of the state of the -/// system (e.g., an invalid field name). - FIRFunctionsErrorCodeInvalidArgument = 3, -/// Deadline expired before operation could complete. For operations that change the state of the -/// system, this error may be returned even if the operation has completed successfully. For -/// example, a successful response from a server could have been delayed long enough for the -/// deadline to expire. - FIRFunctionsErrorCodeDeadlineExceeded = 4, -/// Some requested document was not found. - FIRFunctionsErrorCodeNotFound = 5, -/// Some document that we attempted to create already exists. - FIRFunctionsErrorCodeAlreadyExists = 6, -/// The caller does not have permission to execute the specified operation. - FIRFunctionsErrorCodePermissionDenied = 7, -/// Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system -/// is out of space. - FIRFunctionsErrorCodeResourceExhausted = 8, -/// Operation was rejected because the system is not in a state required for the operation’s -/// execution. - FIRFunctionsErrorCodeFailedPrecondition = 9, -/// The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - FIRFunctionsErrorCodeAborted = 10, -/// Operation was attempted past the valid range. - FIRFunctionsErrorCodeOutOfRange = 11, -/// Operation is not implemented or not supported/enabled. - FIRFunctionsErrorCodeUnimplemented = 12, -/// Internal errors. Means some invariant expected by underlying system has been broken. If you -/// see one of these errors, something is very broken. - FIRFunctionsErrorCodeInternal = 13, -/// The service is currently unavailable. This is a most likely a transient condition and may be -/// corrected by retrying with a backoff. - FIRFunctionsErrorCodeUnavailable = 14, -/// Unrecoverable data loss or corruption. - FIRFunctionsErrorCodeDataLoss = 15, -/// The request does not have valid authentication credentials for the operation. - FIRFunctionsErrorCodeUnauthenticated = 16, +typedef SWIFT_ENUM_NAMED(NSInteger, FIRFunctionsErrorCode, "FunctionsErrorCode", + open){ + /// The operation completed successfully. + FIRFunctionsErrorCodeOK = 0, + /// The operation was cancelled (typically by the caller). + FIRFunctionsErrorCodeCancelled = 1, + /// Unknown error or an error from a different error domain. + FIRFunctionsErrorCodeUnknown = 2, + /// Client specified an invalid argument. Note that this differs from + /// FailedPrecondition. + /// InvalidArgument indicates arguments that are problematic + /// regardless of the state of the + /// system (e.g., an invalid field name). + FIRFunctionsErrorCodeInvalidArgument = 3, + /// Deadline expired before operation could complete. For operations that + /// change the state of the + /// system, this error may be returned even if the operation has completed + /// successfully. For + /// example, a successful response from a server could have been delayed + /// long enough for the + /// deadline to expire. + FIRFunctionsErrorCodeDeadlineExceeded = 4, + /// Some requested document was not found. + FIRFunctionsErrorCodeNotFound = 5, + /// Some document that we attempted to create already exists. + FIRFunctionsErrorCodeAlreadyExists = 6, + /// The caller does not have permission to execute the specified operation. + FIRFunctionsErrorCodePermissionDenied = 7, + /// Some resource has been exhausted, perhaps a per-user quota, or perhaps + /// the entire file system + /// is out of space. + FIRFunctionsErrorCodeResourceExhausted = 8, + /// Operation was rejected because the system is not in a state required for + /// the operation’s + /// execution. + FIRFunctionsErrorCodeFailedPrecondition = 9, + /// The operation was aborted, typically due to a concurrency issue like + /// transaction aborts, etc. + FIRFunctionsErrorCodeAborted = 10, + /// Operation was attempted past the valid range. + FIRFunctionsErrorCodeOutOfRange = 11, + /// Operation is not implemented or not supported/enabled. + FIRFunctionsErrorCodeUnimplemented = 12, + /// Internal errors. Means some invariant expected by underlying system has + /// been broken. If you + /// see one of these errors, something is very broken. + FIRFunctionsErrorCodeInternal = 13, + /// The service is currently unavailable. This is a most likely a transient + /// condition and may be + /// corrected by retrying with a backoff. + FIRFunctionsErrorCodeUnavailable = 14, + /// Unrecoverable data loss or corruption. + FIRFunctionsErrorCodeDataLoss = 15, + /// The request does not have valid authentication credentials for the + /// operation. + FIRFunctionsErrorCodeUnauthenticated = 16, }; @class FIRHTTPSCallableResult; -/// A HTTPSCallable is a reference to a particular Callable HTTPS trigger in Cloud Functions. +/// A HTTPSCallable is a reference to a particular Callable HTTPS +/// trigger in Cloud Functions. SWIFT_CLASS_NAMED("HTTPSCallable") @interface FIRHTTPSCallable : NSObject /// The timeout to use when calling the function. Defaults to 70 seconds. -@property (nonatomic) NSTimeInterval timeoutInterval; +@property(nonatomic) NSTimeInterval timeoutInterval; /// Executes this Callable HTTPS trigger asynchronously. /// The data passed into the trigger can be any of the following types: ///
      @@ -915,64 +1054,74 @@ SWIFT_CLASS_NAMED("HTTPSCallable") /// String /// ///
    • -/// NSNumber, or any Swift numeric type bridgeable to NSNumber +/// NSNumber, or any Swift numeric type bridgeable to +/// NSNumber ///
    • ///
    • -/// [Any], where the contained objects are also one of these types. +/// [Any], where the contained objects are also one of these +/// types. ///
    • ///
    • /// [String: Any] where the values are also one of these types. ///
    • ///
    -/// The request to the Cloud Functions backend made by this method automatically includes a -/// Firebase Installations ID token to identify the app instance. If a user is logged in with -/// Firebase Auth, an auth ID token for the user is also automatically included. -/// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information -/// regarding the app instance. To stop this, see Messaging.deleteData(). It -/// resumes with a new FCM Token the next time you call this method. -/// \param data Parameters to pass to the trigger. +/// The request to the Cloud Functions backend made by this method automatically +/// includes a Firebase Installations ID token to identify the app instance. If +/// a user is logged in with Firebase Auth, an auth ID token for the user is +/// also automatically included. Firebase Cloud Messaging sends data to the +/// Firebase backend periodically to collect information regarding the app +/// instance. To stop this, see Messaging.deleteData(). It resumes +/// with a new FCM Token the next time you call this method. \param data +/// Parameters to pass to the trigger. /// /// \param completion The block to call when the HTTPS request has completed. /// -- (void)callWithObject:(id _Nullable)data completion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; -/// Executes this Callable HTTPS trigger asynchronously. This API should only be used from Objective-C. -/// The request to the Cloud Functions backend made by this method automatically includes a -/// Firebase Installations ID token to identify the app instance. If a user is logged in with -/// Firebase Auth, an auth ID token for the user is also automatically included. -/// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information -/// regarding the app instance. To stop this, see Messaging.deleteData(). It -/// resumes with a new FCM Token the next time you call this method. -/// \param completion The block to call when the HTTPS request has completed. -/// -- (void)callWithCompletion:(void (^ _Nonnull)(FIRHTTPSCallableResult * _Nullable, NSError * _Nullable))completion; +- (void)callWithObject:(id _Nullable)data + completion:(void (^_Nonnull)(FIRHTTPSCallableResult* _Nullable, + NSError* _Nullable))completion; +/// Executes this Callable HTTPS trigger asynchronously. This API should only be +/// used from Objective-C. The request to the Cloud Functions backend made by +/// this method automatically includes a Firebase Installations ID token to +/// identify the app instance. If a user is logged in with Firebase Auth, an +/// auth ID token for the user is also automatically included. Firebase Cloud +/// Messaging sends data to the Firebase backend periodically to collect +/// information regarding the app instance. To stop this, see +/// Messaging.deleteData(). It resumes with a new FCM Token the +/// next time you call this method. \param completion The block to call when the +/// HTTPS request has completed. +/// +- (void)callWithCompletion:(void (^_Nonnull)(FIRHTTPSCallableResult* _Nullable, + NSError* _Nullable))completion; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - /// Configuration options for a HTTPSCallable instance. SWIFT_CLASS_NAMED("HTTPSCallableOptions") @interface FIRHTTPSCallableOptions : NSObject -/// Whether or not to protect the callable function with a limited-use App Check token. -@property (nonatomic, readonly) BOOL requireLimitedUseAppCheckTokens; +/// Whether or not to protect the callable function with a limited-use App Check +/// token. +@property(nonatomic, readonly) BOOL requireLimitedUseAppCheckTokens; /// Designated initializer. -/// \param requireLimitedUseAppCheckTokens A boolean used to decide whether or not to -/// protect the callable function with a limited use App Check token. +/// \param requireLimitedUseAppCheckTokens A boolean used to decide whether or +/// not to protect the callable function with a limited use App Check token. /// -- (nonnull instancetype)initWithRequireLimitedUseAppCheckTokens:(BOOL)requireLimitedUseAppCheckTokens OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithRequireLimitedUseAppCheckTokens: + (BOOL)requireLimitedUseAppCheckTokens OBJC_DESIGNATED_INITIALIZER; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - -/// A HTTPSCallableResult contains the result of calling a HTTPSCallable. +/// A HTTPSCallableResult contains the result of calling a +/// HTTPSCallable. SWIFT_CLASS_NAMED("HTTPSCallableResult") @interface FIRHTTPSCallableResult : NSObject /// The data that was returned from the Callable HTTPS trigger. -/// The data is in the form of native objects. For example, if your trigger returned an -/// array, this object would be an Array. If your trigger returned a JavaScript object with -/// keys and values, this object would be an instance of [String: Any]. -@property (nonatomic, readonly) id _Nonnull data; +/// The data is in the form of native objects. For example, if your trigger +/// returned an array, this object would be an Array. If your +/// trigger returned a JavaScript object with keys and values, this object would +/// be an instance of [String: Any]. +@property(nonatomic, readonly) id _Nonnull data; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end @@ -981,7 +1130,7 @@ SWIFT_CLASS_NAMED("HTTPSCallableResult") #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h b/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h index ce52b04787..b94db175a2 100644 --- a/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H #define FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,17 +258,23 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseInAppMessagingSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", \ + defined_in = "FirebaseInAppMessagingSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -257,33 +282,37 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H #define FIREBASEINAPPMESSAGINGSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -292,191 +321,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -485,7 +532,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -499,17 +546,23 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseInAppMessagingSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", \ + defined_in = "FirebaseInAppMessagingSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -517,7 +570,7 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h b/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h index b404b4e97b..44cbf57192 100644 --- a/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h +++ b/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEMLMODELDOWNLOADER_SWIFT_H #define FIREBASEMLMODELDOWNLOADER_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,53 +258,61 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseMLModelDownloader",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseMLModelDownloader", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEMLMODELDOWNLOADER_SWIFT_H #define FIREBASEMLMODELDOWNLOADER_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -294,191 +321,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -487,7 +532,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -501,27 +546,31 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseMLModelDownloader",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseMLModelDownloader", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h b/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h index 9d335c54d5..a232180d4a 100644 --- a/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEREMOTECONFIGSWIFT_SWIFT_H #define FIREBASEREMOTECONFIGSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,54 +258,61 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseRemoteConfigSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseRemoteConfigSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASEREMOTECONFIGSWIFT_SWIFT_H #define FIREBASEREMOTECONFIGSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -295,191 +321,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -488,7 +532,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -502,28 +546,31 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseRemoteConfigSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseRemoteConfigSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) - - #endif #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h b/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h index 5e028d4fde..2841ae0927 100644 --- a/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASESHAREDSWIFT_SWIFT_H #define FIREBASESHAREDSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,17 +258,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseSharedSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseSharedSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -257,33 +281,37 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASESHAREDSWIFT_SWIFT_H #define FIREBASESHAREDSWIFT_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -292,191 +320,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -485,7 +531,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -499,17 +545,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseSharedSwift",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseSharedSwift", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -517,7 +568,7 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/FirebaseStorage-Swift.h b/ios_pod/swift_headers/FirebaseStorage-Swift.h index f9e5c97b1d..daa70f3bdc 100644 --- a/ios_pod/swift_headers/FirebaseStorage-Swift.h +++ b/ios_pod/swift_headers/FirebaseStorage-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASESTORAGE_SWIFT_H #define FIREBASESTORAGE_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -242,17 +261,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseStorage",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseStorage", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -260,107 +284,124 @@ using UInt = size_t; @class FIRApp; @class FIRStorageReference; -/// Firebase Storage is a service that supports uploading and downloading binary objects, -/// such as images, videos, and other files to Google Cloud Storage. Instances of Storage -/// are not thread-safe. -/// If you call Storage.storage(), the instance will initialize with the default FirebaseApp, -/// FirebaseApp.app(), and the storage location will come from the provided -/// GoogleService-Info.plist. -/// If you provide a custom instance of FirebaseApp, -/// the storage location will be specified via the FirebaseOptions.storageBucket property. +/// Firebase Storage is a service that supports uploading and downloading binary +/// objects, such as images, videos, and other files to Google Cloud Storage. +/// Instances of Storage are not thread-safe, but can be accessed +/// from any thread. If you call Storage.storage(), the instance +/// will initialize with the default FirebaseApp, +/// FirebaseApp.app(), and the storage location will come from the +/// provided GoogleService-Info.plist. If you provide a custom +/// instance of FirebaseApp, the storage location will be specified +/// via the FirebaseOptions.storageBucket property. SWIFT_CLASS_NAMED("Storage") @interface FIRStorage : NSObject /// The default Storage instance. /// /// returns: -/// An instance of Storage, configured with the default FirebaseApp. -+ (FIRStorage * _Nonnull)storage SWIFT_WARN_UNUSED_RESULT; -/// A method used to create Storage instances initialized with a custom storage bucket URL. -/// Any StorageReferences generated from this instance of Storage will reference files -/// and directories within the specified bucket. -/// \param url The gs:// URL to your Firebase Storage bucket. +/// An instance of Storage, configured with the default +/// FirebaseApp. ++ (FIRStorage *_Nonnull)storage SWIFT_WARN_UNUSED_RESULT; +/// A method used to create Storage instances initialized with a +/// custom storage bucket URL. Any StorageReferences generated from +/// this instance of Storage will reference files and directories +/// within the specified bucket. \param url The gs:// URL to your +/// Firebase Storage bucket. /// /// /// returns: /// A Storage instance, configured with the custom storage bucket. -+ (FIRStorage * _Nonnull)storageWithURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates an instance of Storage, configured with a custom FirebaseApp. StorageReferences -/// generated from a resulting instance will reference files in the Firebase project -/// associated with custom FirebaseApp. -/// \param app The custom FirebaseApp used for initialization. ++ (FIRStorage *_Nonnull)storageWithURL:(NSString *_Nonnull)url + SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom +/// FirebaseApp. StorageReferences generated from a +/// resulting instance will reference files in the Firebase project associated +/// with custom FirebaseApp. \param app The custom +/// FirebaseApp used for initialization. /// /// /// returns: -/// A Storage instance, configured with the custom FirebaseApp. -+ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; -/// Creates an instance of Storage, configured with a custom FirebaseApp and a custom storage -/// bucket URL. -/// \param app The custom FirebaseApp used for initialization. +/// A Storage instance, configured with the custom +/// FirebaseApp. ++ (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app + SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom +/// FirebaseApp and a custom storage bucket URL. \param app The +/// custom FirebaseApp used for initialization. /// /// \param url The gs:// url to your Firebase Storage bucket. /// /// /// returns: -/// the Storage instance, configured with the custom FirebaseApp and storage bucket URL. -+ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app URL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// the Storage instance, configured with the custom +/// FirebaseApp and storage bucket URL. ++ (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app + URL:(NSString *_Nonnull)url + SWIFT_WARN_UNUSED_RESULT; /// The FirebaseApp associated with this Storage instance. -@property (nonatomic, readonly, strong) FIRApp * _Nonnull app; +@property(nonatomic, readonly, strong) FIRApp *_Nonnull app; /// The maximum time in seconds to retry an upload if a failure occurs. /// Defaults to 10 minutes (600 seconds). -@property (nonatomic) NSTimeInterval maxUploadRetryTime; +@property(nonatomic) NSTimeInterval maxUploadRetryTime; /// The maximum time in seconds to retry a download if a failure occurs. /// Defaults to 10 minutes (600 seconds). -@property (nonatomic) NSTimeInterval maxDownloadRetryTime; -/// The maximum time in seconds to retry operations other than upload and download if a failure occurs. -/// Defaults to 2 minutes (120 seconds). -@property (nonatomic) NSTimeInterval maxOperationRetryTime; -/// Specify the maximum upload chunk size. Values less than 256K (262144) will be rounded up to 256K. Values -/// above 256K will be rounded down to the nearest 256K multiple. The default is no maximum. -@property (nonatomic) int64_t uploadChunkSizeBytes; -/// A DispatchQueue that all developer callbacks are fired on. Defaults to the main queue. -@property (nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue; -/// Creates a StorageReference initialized at the root Firebase Storage location. +@property(nonatomic) NSTimeInterval maxDownloadRetryTime; +/// The maximum time in seconds to retry operations other than upload and +/// download if a failure occurs. Defaults to 2 minutes (120 seconds). +@property(nonatomic) NSTimeInterval maxOperationRetryTime; +/// Specify the maximum upload chunk size. Values less than 256K (262144) will +/// be rounded up to 256K. Values above 256K will be rounded down to the nearest +/// 256K multiple. The default is no maximum. +@property(nonatomic) int64_t uploadChunkSizeBytes; +/// A DispatchQueue that all developer callbacks are fired on. +/// Defaults to the main queue. +@property(nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue; +/// Creates a StorageReference initialized at the root Firebase +/// Storage location. /// /// returns: -/// An instance of StorageReference referencing the root of the storage bucket. -- (FIRStorageReference * _Nonnull)reference SWIFT_WARN_UNUSED_RESULT; -/// Creates a StorageReference given a gs://, http://, or https:// URL pointing to a -/// Firebase Storage location. For example, you can pass in an https:// download URL retrieved from -/// StorageReference.downloadURL(completion:) or the gs:// URL from -/// StorageReference.description. +/// An instance of StorageReference referencing the root of the +/// storage bucket. +- (FIRStorageReference *_Nonnull)reference SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference given a gs://, http://, +/// or https:// URL pointing to a Firebase Storage location. For +/// example, you can pass in an https:// download URL retrieved +/// from StorageReference.downloadURL(completion:) or the +/// gs:// URL from StorageReference.description. /// \param url A gs // or https:// URL to initialize the reference with. /// /// /// throws: -/// Throws a fatal error if url is not associated with the FirebaseApp used to initialize -/// this Storage instance. +/// Throws a fatal error if url is not associated with the +/// FirebaseApp used to initialize this Storage instance. /// /// returns: /// An instance of StorageReference at the given child path. -- (FIRStorageReference * _Nonnull)referenceForURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates a StorageReference initialized at a location specified by the path parameter. -/// \param path A relative path from the root of the storage bucket, -/// for instance @“path/to/object”. +- (FIRStorageReference *_Nonnull)referenceForURL:(NSString *_Nonnull)url + SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference initialized at a location specified +/// by the path parameter. \param path A relative path from the +/// root of the storage bucket, for instance @“path/to/object”. /// /// /// returns: /// An instance of StorageReference pointing to the given path. -- (FIRStorageReference * _Nonnull)referenceWithPath:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; -/// Configures the Storage SDK to use an emulated backend instead of the default remote backend. -/// This method should be called before invoking any other methods on a new instance of Storage. -- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; +- (FIRStorageReference *_Nonnull)referenceWithPath:(NSString *_Nonnull)path + SWIFT_WARN_UNUSED_RESULT; +/// Configures the Storage SDK to use an emulated backend instead of the default +/// remote backend. This method should be called before invoking any other +/// methods on a new instance of Storage. +- (void)useEmulatorWithHost:(NSString *_Nonnull)host port:(NSInteger)port; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property (nonatomic, readonly) NSUInteger hash; +@property(nonatomic, readonly) NSUInteger hash; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - -/// Defines task operations such as pause, resume, cancel, and enqueue for all tasks. -/// All tasks are required to implement enqueue, which begins the task, and may optionally -/// implement pause, resume, and cancel, which operate on the task to pause, resume, and cancel -/// operations. +/// Defines task operations such as pause, resume, cancel, and enqueue for all +/// tasks. All tasks are required to implement enqueue, which begins the task, +/// and may optionally implement pause, resume, and cancel, which operate on the +/// task to pause, resume, and cancel operations. SWIFT_PROTOCOL_NAMED("StorageTaskManagement") @protocol FIRStorageTaskManagement /// Prepares a task and begins execution. @@ -377,30 +418,29 @@ SWIFT_PROTOCOL_NAMED("StorageTaskManagement") @class FIRStorageTaskSnapshot; /// A superclass to all Storage tasks, including StorageUploadTask -/// and StorageDownloadTask, to provide state transitions, event raising, and common storage -/// for metadata and errors. -/// Callbacks are always fired on the developer-specified callback queue. -/// If no queue is specified, it defaults to the main queue. -/// This class is not thread safe, so only call methods on the main thread. +/// and StorageDownloadTask, to provide state transitions, event +/// raising, and common storage for metadata and errors. Callbacks are always +/// fired on the developer-specified callback queue. If no queue is specified, +/// it defaults to the main queue. This class is thread-safe. SWIFT_CLASS_NAMED("StorageTask") @interface FIRStorageTask : NSObject /// An immutable view of the task and associated metadata, progress, error, etc. -@property (nonatomic, readonly, strong) FIRStorageTaskSnapshot * _Nonnull snapshot; +@property(nonatomic, readonly, strong) + FIRStorageTaskSnapshot *_Nonnull snapshot; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end enum FIRStorageTaskStatus : NSInteger; -/// An extended StorageTask providing observable semantics that can be used for responding to changes -/// in task state. -/// Observers produce a StorageHandle, which is used to keep track of and remove specific -/// observers at a later date. -/// This class is not thread safe and can only be called on the main thread. +/// An extended StorageTask providing observable semantics that can +/// be used for responding to changes in task state. Observers produce a +/// StorageHandle, which is used to keep track of and remove +/// specific observers at a later date. SWIFT_CLASS_NAMED("StorageObservableTask") @interface FIRStorageObservableTask : FIRStorageTask -/// Observes changes in the upload status: Resume, Pause, Progress, Success, and Failure. -/// \param status The StorageTaskStatus change to observe. +/// Observes changes in the upload status: Resume, Pause, Progress, Success, and +/// Failure. \param status The StorageTaskStatus change to observe. /// /// \param handler A callback that fires every time the status event occurs, /// containing a StorageTaskSnapshot describing task state. @@ -408,11 +448,13 @@ SWIFT_CLASS_NAMED("StorageObservableTask") /// /// returns: /// A task handle that can be used to remove the observer at a later date. -- (NSString * _Nonnull)observeStatus:(enum FIRStorageTaskStatus)status handler:(void (^ _Nonnull)(FIRStorageTaskSnapshot * _Nonnull))handler; +- (NSString *_Nonnull) + observeStatus:(enum FIRStorageTaskStatus)status + handler:(void (^_Nonnull)(FIRStorageTaskSnapshot *_Nonnull))handler; /// Removes the single observer with the provided handle. -/// \param handle The handle of the task to remove. +/// \param handle The handle of the task to remove. /// -- (void)removeObserverWithHandle:(NSString * _Nonnull)handle; +- (void)removeObserverWithHandle:(NSString *_Nonnull)handle; /// Removes all observers for a single status. /// \param status A StorageTaskStatus to remove all listeners for. /// @@ -421,20 +463,22 @@ SWIFT_CLASS_NAMED("StorageObservableTask") - (void)removeAllObservers; @end - -/// StorageDownloadTask implements resumable downloads from an object in Firebase Storage. -/// Downloads can be returned on completion with a completion handler, and can be monitored -/// by attaching observers, or controlled by calling pause(), resume(), -/// or cancel(). -/// Downloads can currently be returned as Data in memory, or as a URL to a file on disk. -/// Downloads are performed on a background queue, and callbacks are raised on the developer -/// specified callbackQueue in Storage, or the main queue if left unspecified. -/// Currently all downloads must be initiated and managed on the main queue. +/// StorageDownloadTask implements resumable downloads from an +/// object in Firebase Storage. Downloads can be returned on completion with a +/// completion handler, and can be monitored by attaching observers, or +/// controlled by calling pause(), resume(), or +/// cancel(). Downloads can currently be returned as +/// Data in memory, or as a URL to a file on disk. +/// Downloads are performed on a background queue, and callbacks are raised on +/// the developer specified callbackQueue in Storage, or the main +/// queue if left unspecified. SWIFT_CLASS_NAMED("StorageDownloadTask") -@interface FIRStorageDownloadTask : FIRStorageObservableTask +@interface FIRStorageDownloadTask + : FIRStorageObservableTask /// Prepares a task and begins execution. - (void)enqueue; -/// Pauses a task currently in progress. Calling this on a paused task has no effect. +/// Pauses a task currently in progress. Calling this on a paused task has no +/// effect. - (void)pause; /// Cancels a task. - (void)cancel; @@ -442,46 +486,51 @@ SWIFT_CLASS_NAMED("StorageDownloadTask") - (void)resume; @end -/// Adds wrappers for common Firebase Storage errors (including creating errors from GCS errors). -/// For more information on unwrapping GCS errors, see the GCS errors docs: -/// https://cloud.google.com/storage/docs/json_api/v1/status-codes -/// This is never publicly exposed to end developers (as they will simply see an NSError). -typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", open) { - FIRStorageErrorCodeUnknown = -13000, - FIRStorageErrorCodeObjectNotFound = -13010, - FIRStorageErrorCodeBucketNotFound = -13011, - FIRStorageErrorCodeProjectNotFound = -13012, - FIRStorageErrorCodeQuotaExceeded = -13013, - FIRStorageErrorCodeUnauthenticated = -13020, - FIRStorageErrorCodeUnauthorized = -13021, - FIRStorageErrorCodeRetryLimitExceeded = -13030, - FIRStorageErrorCodeNonMatchingChecksum = -13031, - FIRStorageErrorCodeDownloadSizeExceeded = -13032, - FIRStorageErrorCodeCancelled = -13040, - FIRStorageErrorCodeInvalidArgument = -13050, +/// Adds wrappers for common Firebase Storage errors (including creating errors +/// from GCS errors). For more information on unwrapping GCS errors, see the GCS +/// errors docs: https://cloud.google.com/storage/docs/json_api/v1/status-codes +/// This is never publicly exposed to end developers (as they will simply see an +/// NSError). +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", + open){ + FIRStorageErrorCodeUnknown = -13000, + FIRStorageErrorCodeObjectNotFound = -13010, + FIRStorageErrorCodeBucketNotFound = -13011, + FIRStorageErrorCodeProjectNotFound = -13012, + FIRStorageErrorCodeQuotaExceeded = -13013, + FIRStorageErrorCodeUnauthenticated = -13020, + FIRStorageErrorCodeUnauthorized = -13021, + FIRStorageErrorCodeRetryLimitExceeded = -13030, + FIRStorageErrorCodeNonMatchingChecksum = -13031, + FIRStorageErrorCodeDownloadSizeExceeded = -13032, + FIRStorageErrorCodeCancelled = -13040, + FIRStorageErrorCodeInvalidArgument = -13050, }; -static NSString * _Nonnull const FIRStorageErrorCodeDomain = @"FirebaseStorage.StorageErrorCode"; - +static NSString *_Nonnull const FIRStorageErrorCodeDomain = + @"FirebaseStorage.StorageErrorCode"; -/// Contains the prefixes and items returned by a StorageReference.list() call. +/// Contains the prefixes and items returned by a +/// StorageReference.list() call. SWIFT_CLASS_NAMED("StorageListResult") @interface FIRStorageListResult : NSObject /// The prefixes (folders) returned by a list() operation. /// /// returns: /// A list of prefixes (folders). -@property (nonatomic, readonly, copy) NSArray * _Nonnull prefixes; +@property(nonatomic, readonly, copy) + NSArray *_Nonnull prefixes; /// The objects (files) returned by a list() operation. /// /// returns: /// A page token if more results are available. -@property (nonatomic, readonly, copy) NSArray * _Nonnull items; -/// Returns a token that can be used to resume a previous list() operation. nil -/// indicates that there are no more results. +@property(nonatomic, readonly, copy) + NSArray *_Nonnull items; +/// Returns a token that can be used to resume a previous list() +/// operation. nil indicates that there are no more results. /// /// returns: /// A page token if more results are available. -@property (nonatomic, readonly, copy) NSString * _Nullable pageToken; +@property(nonatomic, readonly, copy) NSString *_Nullable pageToken; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @@ -489,284 +538,344 @@ SWIFT_CLASS_NAMED("StorageListResult") @class NSDate; -/// Class which represents the metadata on an object in Firebase Storage. This metadata is -/// returned on successful operations, and can be used to retrieve download URLs, content types, -/// and a Storage reference to the object in question. Full documentation can be found at the GCS -/// Objects#resource docs. +/// Class which represents the metadata on an object in Firebase Storage. This +/// metadata is returned on successful operations, and can be used to retrieve +/// download URLs, content types, and a Storage reference to the object in +/// question. Full documentation can be found at the GCS Objects#resource docs. /// @see https://cloud.google.com/storage/docs/json_api/v1/objects#resource SWIFT_CLASS_NAMED("StorageMetadata") @interface FIRStorageMetadata : NSObject /// The name of the bucket containing this object. -@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; +@property(nonatomic, readonly, copy) NSString *_Nonnull bucket; /// Cache-Control directive for the object data. -@property (nonatomic, copy) NSString * _Nullable cacheControl; +@property(nonatomic, copy) NSString *_Nullable cacheControl; /// Content-Disposition of the object data. -@property (nonatomic, copy) NSString * _Nullable contentDisposition; +@property(nonatomic, copy) NSString *_Nullable contentDisposition; /// Content-Encoding of the object data. -@property (nonatomic, copy) NSString * _Nullable contentEncoding; +@property(nonatomic, copy) NSString *_Nullable contentEncoding; /// Content-Language of the object data. -@property (nonatomic, copy) NSString * _Nullable contentLanguage; +@property(nonatomic, copy) NSString *_Nullable contentLanguage; /// Content-Type of the object data. -@property (nonatomic, copy) NSString * _Nullable contentType; +@property(nonatomic, copy) NSString *_Nullable contentType; /// MD5 hash of the data; encoded using base64. -@property (nonatomic, readonly, copy) NSString * _Nullable md5Hash; +@property(nonatomic, readonly, copy) NSString *_Nullable md5Hash; /// The content generation of this object. Used for object versioning. -@property (nonatomic, readonly) int64_t generation; +@property(nonatomic, readonly) int64_t generation; /// User-provided metadata, in key/value pairs. -@property (nonatomic, copy) NSDictionary * _Nullable customMetadata; +@property(nonatomic, copy) + NSDictionary *_Nullable customMetadata; /// The version of the metadata for this object at this generation. Used -/// for preconditions and for detecting changes in metadata. A metageneration number is only -/// meaningful in the context of a particular generation of a particular object. -@property (nonatomic, readonly) int64_t metageneration; -/// The name of this object, in gs://bucket/path/to/object.txt, this is object.txt. -@property (nonatomic, readonly, copy) NSString * _Nullable name; -/// The full path of this object, in gs://bucket/path/to/object.txt, this is path/to/object.txt. -@property (nonatomic, readonly, copy) NSString * _Nullable path; +/// for preconditions and for detecting changes in metadata. A metageneration +/// number is only meaningful in the context of a particular generation of a +/// particular object. +@property(nonatomic, readonly) int64_t metageneration; +/// The name of this object, in gs://bucket/path/to/object.txt, this is +/// object.txt. +@property(nonatomic, readonly, copy) NSString *_Nullable name; +/// The full path of this object, in gs://bucket/path/to/object.txt, this is +/// path/to/object.txt. +@property(nonatomic, readonly, copy) NSString *_Nullable path; /// Content-Length of the data in bytes. -@property (nonatomic, readonly) int64_t size; +@property(nonatomic, readonly) int64_t size; /// The creation time of the object in RFC 3339 format. -@property (nonatomic, readonly, copy) NSDate * _Nullable timeCreated; +@property(nonatomic, readonly, copy) NSDate *_Nullable timeCreated; /// The modification time of the object metadata in RFC 3339 format. -@property (nonatomic, readonly, copy) NSDate * _Nullable updated; +@property(nonatomic, readonly, copy) NSDate *_Nullable updated; /// Never used API -@property (nonatomic, readonly, strong) FIRStorageReference * _Nullable storageReference SWIFT_DEPRECATED; +@property(nonatomic, readonly, strong) + FIRStorageReference *_Nullable storageReference SWIFT_DEPRECATED; /// Creates a Dictionary from the contents of the metadata. /// @return A Dictionary that represents the contents of the metadata. -- (NSDictionary * _Nonnull)dictionaryRepresentation SWIFT_WARN_UNUSED_RESULT; +- (NSDictionary *_Nonnull) + dictionaryRepresentation SWIFT_WARN_UNUSED_RESULT; /// Determines if the current metadata represents a “file”. -@property (nonatomic, readonly) BOOL isFile; +@property(nonatomic, readonly) BOOL isFile; /// Determines if the current metadata represents a “folder”. -@property (nonatomic, readonly) BOOL isFolder; +@property(nonatomic, readonly) BOOL isFolder; - (nonnull instancetype)init; /// Creates an instance of StorageMetadata from the contents of a dictionary. -/// @return An instance of StorageMetadata that represents the contents of a dictionary. -- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary OBJC_DESIGNATED_INITIALIZER; +/// @return An instance of StorageMetadata that represents the contents of a +/// dictionary. +- (nonnull instancetype)initWithDictionary: + (NSDictionary *_Nonnull)dictionary + OBJC_DESIGNATED_INITIALIZER; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property (nonatomic, readonly) NSUInteger hash; -@property (nonatomic, readonly, copy) NSString * _Nonnull description; +@property(nonatomic, readonly) NSUInteger hash; +@property(nonatomic, readonly, copy) NSString *_Nonnull description; @end - @class NSData; @class FIRStorageUploadTask; @class NSURL; -/// StorageReference represents a reference to a Google Cloud Storage object. Developers can -/// upload and download objects, as well as get/set object metadata, and delete an object at the -/// path. See the Cloud docs for more details: https://cloud.google.com/storage/ +/// StorageReference represents a reference to a Google Cloud +/// Storage object. Developers can upload and download objects, as well as +/// get/set object metadata, and delete an object at the path. See the Cloud +/// docs for more details: https://cloud.google.com/storage/ SWIFT_CLASS_NAMED("StorageReference") @interface FIRStorageReference : NSObject /// The Storage service object which created this reference. -@property (nonatomic, readonly, strong) FIRStorage * _Nonnull storage; +@property(nonatomic, readonly, strong) FIRStorage *_Nonnull storage; /// The name of the Google Cloud Storage bucket associated with this reference. -/// For example, in gs://bucket/path/to/object.txt, the bucket would be ‘bucket’. -@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; +/// For example, in gs://bucket/path/to/object.txt, the bucket +/// would be ‘bucket’. +@property(nonatomic, readonly, copy) NSString *_Nonnull bucket; /// The full path to this object, not including the Google Cloud Storage bucket. -/// In gs://bucket/path/to/object.txt, the full path would be: path/to/object.txt -@property (nonatomic, readonly, copy) NSString * _Nonnull fullPath; +/// In gs://bucket/path/to/object.txt, the full path would be: +/// path/to/object.txt +@property(nonatomic, readonly, copy) NSString *_Nonnull fullPath; /// The short name of the object associated with this reference. -/// In gs://bucket/path/to/object.txt, the name of the object would be object.txt. -@property (nonatomic, readonly, copy) NSString * _Nonnull name; +/// In gs://bucket/path/to/object.txt, the name of the object would +/// be object.txt. +@property(nonatomic, readonly, copy) NSString *_Nonnull name; /// Creates a new StorageReference pointing to the root object. /// /// returns: /// A new StorageReference pointing to the root object. -- (FIRStorageReference * _Nonnull)root SWIFT_WARN_UNUSED_RESULT; -/// Creates a new StorageReference pointing to the parent of the current reference -/// or nil if this instance references the root location. -/// For example: -/// path = foo/bar/baz parent = foo/bar -/// path = foo parent = (root) -/// path = (root) parent = nil +- (FIRStorageReference *_Nonnull)root SWIFT_WARN_UNUSED_RESULT; +/// Creates a new StorageReference pointing to the parent of the +/// current reference or nil if this instance references the root +/// location. For example: path = foo/bar/baz parent = foo/bar path = foo +/// parent = (root) path = (root) parent = nil /// /// returns: -/// A new StorageReference pointing to the parent of the current reference. -- (FIRStorageReference * _Nullable)parent SWIFT_WARN_UNUSED_RESULT; -/// Creates a new StorageReference pointing to a child object of the current reference. -/// path = foo child = bar newPath = foo/bar -/// path = foo/bar child = baz ntask.impl.snapshotwPath = foo/bar/baz -/// All leading and trailing slashes will be removed, and consecutive slashes will be +/// A new StorageReference pointing to the parent of the current +/// reference. +- (FIRStorageReference *_Nullable)parent SWIFT_WARN_UNUSED_RESULT; +/// Creates a new StorageReference pointing to a child object of +/// the current reference. path = foo child = bar newPath = foo/bar path +/// = foo/bar child = baz ntask.impl.snapshotwPath = foo/bar/baz All leading +/// and trailing slashes will be removed, and consecutive slashes will be /// compressed to single slashes. For example: /// child = /foo/bar newPath = foo/bar /// child = foo/bar/ newPath = foo/bar /// child = foo///bar newPath = foo/bar -/// \param path The path to append to the current path. +/// \param path The path to append to the current path. /// /// /// returns: -/// A new StorageReference pointing to a child location of the current reference. -- (FIRStorageReference * _Nonnull)child:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; -/// Asynchronously uploads data to the currently specified StorageReference, -/// without additional metadata. -/// This is not recommended for large files, and one should instead upload a file from disk. +/// A new StorageReference pointing to a child location of the +/// current reference. +- (FIRStorageReference *_Nonnull)child:(NSString *_Nonnull)path + SWIFT_WARN_UNUSED_RESULT; +/// Asynchronously uploads data to the currently specified +/// StorageReference, without additional metadata. This is not +/// recommended for large files, and one should instead upload a file from disk. /// \param uploadData The data to upload. /// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata; -/// Asynchronously uploads data to the currently specified StorageReference. -/// This is not recommended for large files, and one should instead upload a file from disk. -/// \param uploadData The data to upload. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull)putData:(NSData *_Nonnull)uploadData + metadata: + (FIRStorageMetadata *_Nullable)metadata; +/// Asynchronously uploads data to the currently specified +/// StorageReference. This is not recommended for large files, and +/// one should instead upload a file from disk. \param uploadData The data to +/// upload. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData; -/// Asynchronously uploads data to the currently specified StorageReference. -/// This is not recommended for large files, and one should instead upload a file from disk. -/// \param uploadData The data to upload. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull)putData:(NSData *_Nonnull)uploadData; +/// Asynchronously uploads data to the currently specified +/// StorageReference. This is not recommended for large files, and +/// one should instead upload a file from disk. \param uploadData The data to +/// upload. /// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. /// -/// \param completion A closure that either returns the object metadata on success, -/// or an error on failure. +/// \param completion A closure that either returns the object metadata on +/// success, or an error on failure. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; -/// Asynchronously uploads a file to the currently specified StorageReference. -/// putData should be used instead of putFile in Extensions. -/// \param fileURL A URL representing the system file path of the object to be uploaded. -/// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull) + putData:(NSData *_Nonnull)uploadData + metadata:(FIRStorageMetadata *_Nullable)metadata + completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously uploads a file to the currently specified +/// StorageReference. putData should be used instead +/// of putFile in Extensions. \param fileURL A URL representing the +/// system file path of the object to be uploaded. +/// +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata; -/// Asynchronously uploads a file to the currently specified StorageReference, -/// without additional metadata. -/// putData should be used instead of putFile in Extensions. -/// @param fileURL A URL representing the system file path of the object to be uploaded. -/// @return An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL; -/// Asynchronously uploads a file to the currently specified StorageReference. -/// putData should be used instead of putFile in Extensions. -/// \param fileURL A URL representing the system file path of the object to be uploaded. -/// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. -/// -/// \param completion A completion block that either returns the object metadata on success, -/// or an error on failure. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull)putFile:(NSURL *_Nonnull)fileURL + metadata: + (FIRStorageMetadata *_Nullable)metadata; +/// Asynchronously uploads a file to the currently specified +/// StorageReference, without additional metadata. +/// putData should be used instead of putFile in +/// Extensions. +/// @param fileURL A URL representing the system file path of the object to be +/// uploaded. +/// @return An instance of StorageUploadTask, which can be used to monitor or +/// manage the upload. +- (FIRStorageUploadTask *_Nonnull)putFile:(NSURL *_Nonnull)fileURL; +/// Asynchronously uploads a file to the currently specified +/// StorageReference. putData should be used instead +/// of putFile in Extensions. \param fileURL A URL representing the +/// system file path of the object to be uploaded. +/// +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. +/// +/// \param completion A completion block that either returns the object metadata +/// on success, or an error on failure. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; -/// Asynchronously downloads the object at the StorageReference to a Data instance in memory. -/// A Data buffer of the provided max size will be allocated, so ensure that the device has enough free -/// memory to complete the download. For downloading large files, write(toFile:) may be a better option. -/// \param maxSize The maximum size in bytes to download. If the download exceeds this size, -/// the task will be cancelled and an error will be returned. -/// -/// \param completion A completion block that either returns the object data on success, -/// or an error on failure. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull) + putFile:(NSURL *_Nonnull)fileURL + metadata:(FIRStorageMetadata *_Nullable)metadata + completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously downloads the object at the StorageReference to +/// a Data instance in memory. A Data buffer of the +/// provided max size will be allocated, so ensure that the device has enough +/// free memory to complete the download. For downloading large files, +/// write(toFile:) may be a better option. \param maxSize The +/// maximum size in bytes to download. If the download exceeds this size, the +/// task will be cancelled and an error will be returned. +/// +/// \param completion A completion block that either returns the object data on +/// success, or an error on failure. /// /// /// returns: -/// An StorageDownloadTask that can be used to monitor or manage the download. -- (FIRStorageDownloadTask * _Nonnull)dataWithMaxSize:(int64_t)maxSize completion:(void (^ _Nonnull)(NSData * _Nullable, NSError * _Nullable))completion; +/// An StorageDownloadTask that can be used to monitor or manage +/// the download. +- (FIRStorageDownloadTask *_Nonnull) + dataWithMaxSize:(int64_t)maxSize + completion:(void (^_Nonnull)(NSData *_Nullable, + NSError *_Nullable))completion; /// Asynchronously retrieves a long lived download URL with a revokable token. -/// This can be used to share the file with others, but can be revoked by a developer -/// in the Firebase Console. -/// \param completion A completion block that either returns the URL on success, -/// or an error on failure. -/// -- (void)downloadURLWithCompletion:(void (^ _Nonnull)(NSURL * _Nullable, NSError * _Nullable))completion; -/// Asynchronously downloads the object at the current path to a specified system filepath. -///
      +/// This can be used to share the file with others, but can be revoked by a +/// developer in the Firebase Console. \param completion A completion block that +/// either returns the URL on success, or an error on failure. +/// +- (void)downloadURLWithCompletion: + (void (^_Nonnull)(NSURL *_Nullable, NSError *_Nullable))completion; +/// Asynchronously downloads the object at the current path to a specified +/// system filepath.
        ///
      • -/// Returns An StorageDownloadTask that can be used to monitor or manage the download. +/// Returns An StorageDownloadTask that can be used to monitor +/// or manage the download. ///
      • ///
      -/// \param fileURL A file system URL representing the path the object should be downloaded to. +/// \param fileURL A file system URL representing the path the object should be +/// downloaded to. /// -- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL; -/// Asynchronously downloads the object at the current path to a specified system filepath. -/// \param fileURL A file system URL representing the path the object should be downloaded to. +- (FIRStorageDownloadTask *_Nonnull)writeToFile:(NSURL *_Nonnull)fileURL; +/// Asynchronously downloads the object at the current path to a specified +/// system filepath. \param fileURL A file system URL representing the path the +/// object should be downloaded to. /// -/// \param completion A closure that fires when the file download completes, passed either -/// a URL pointing to the file path of the downloaded file on success, -/// or an error on failure. +/// \param completion A closure that fires when the file download completes, +/// passed either a URL pointing to the file path of the downloaded file on +/// success, or an error on failure. /// /// /// returns: -/// A StorageDownloadTask that can be used to monitor or manage the download. -- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL completion:(void (^ _Nullable)(NSURL * _Nullable, NSError * _Nullable))completion; -/// Lists all items (files) and prefixes (folders) under this StorageReference. -/// This is a helper method for calling list() repeatedly until there are no more results. -/// Consistency of the result is not guaranteed if objects are inserted or removed while this -/// operation is executing. All results are buffered in memory. -/// listAll(completion:) is only available for projects using Firebase Rules Version 2. -/// \param completion A completion handler that will be invoked with all items and prefixes under -/// the current StorageReference. -/// -- (void)listAllWithCompletion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; -/// List up to maxResults items (files) and prefixes (folders) under this StorageReference. -/// “/” is treated as a path delimiter. Firebase Storage does not support unsupported object -/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be -/// filtered. -/// list(maxResults:completion:) is only available for projects using Firebase Rules Version 2. -/// \param maxResults The maximum number of results to return in a single page. Must be greater -/// than 0 and at most 1000. -/// -/// \param completion A completion handler that will be invoked with up to maxResults items and -/// prefixes under the current StorageReference. -/// -- (void)listWithMaxResults:(int64_t)maxResults completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; -/// Resumes a previous call to list(maxResults:completion:), starting after a pagination token. -/// Returns the next set of items (files) and prefixes (folders) under this StorageReference. -/// “/” is treated as a path delimiter. Storage does not support unsupported object -/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be -/// filtered. -/// list(maxResults:pageToken:completion:)is only available for projects using Firebase Rules -/// Version 2. -/// \param maxResults The maximum number of results to return in a single page. Must be greater -/// than 0 and at most 1000. +/// A StorageDownloadTask that can be used to monitor or manage the +/// download. +- (FIRStorageDownloadTask *_Nonnull) + writeToFile:(NSURL *_Nonnull)fileURL + completion: + (void (^_Nullable)(NSURL *_Nullable, NSError *_Nullable))completion; +/// Lists all items (files) and prefixes (folders) under this +/// StorageReference. This is a helper method for calling +/// list() repeatedly until there are no more results. Consistency +/// of the result is not guaranteed if objects are inserted or removed while +/// this operation is executing. All results are buffered in memory. +/// listAll(completion:) is only available for projects using +/// Firebase Rules Version 2. \param completion A completion handler that will +/// be invoked with all items and prefixes under the current +/// StorageReference. +/// +- (void)listAllWithCompletion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, + NSError *_Nullable))completion; +/// List up to maxResults items (files) and prefixes (folders) +/// under this StorageReference. “/” is treated as a path delimiter. Firebase +/// Storage does not support unsupported object paths that end with “/” or +/// contain two consecutive “/“s. All invalid objects in GCS will be filtered. +/// list(maxResults:completion:) is only available for projects +/// using Firebase Rules Version 2. \param maxResults The maximum number of +/// results to return in a single page. Must be greater than 0 and at most 1000. +/// +/// \param completion A completion handler that will be invoked with up to +/// maxResults items and prefixes under the current +/// StorageReference. +/// +- (void)listWithMaxResults:(int64_t)maxResults + completion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, + NSError *_Nullable))completion; +/// Resumes a previous call to list(maxResults:completion:), +/// starting after a pagination token. Returns the next set of items (files) and +/// prefixes (folders) under this StorageReference. “/” is treated +/// as a path delimiter. Storage does not support unsupported object paths that +/// end with “/” or contain two consecutive “/“s. All invalid objects in GCS +/// will be filtered. list(maxResults:pageToken:completion:)is only +/// available for projects using Firebase Rules Version 2. \param maxResults The +/// maximum number of results to return in a single page. Must be greater than 0 +/// and at most 1000. /// /// \param pageToken A page token from a previous call to list. /// -/// \param completion A completion handler that will be invoked with the next items and prefixes -/// under the current StorageReference. +/// \param completion A completion handler that will be invoked with the next +/// items and prefixes under the current StorageReference. /// -- (void)listWithMaxResults:(int64_t)maxResults pageToken:(NSString * _Nonnull)pageToken completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; +- (void)listWithMaxResults:(int64_t)maxResults + pageToken:(NSString *_Nonnull)pageToken + completion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, + NSError *_Nullable))completion; /// Retrieves metadata associated with an object at the current path. -/// \param completion A completion block which returns the object metadata on success, -/// or an error on failure. +/// \param completion A completion block which returns the object metadata on +/// success, or an error on failure. /// -- (void)metadataWithCompletion:(void (^ _Nonnull)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +- (void)metadataWithCompletion:(void (^_Nonnull)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; /// Updates the metadata associated with an object at the current path. -/// \param metadata A StorageMetadata object with the metadata to update. +/// \param metadata A StorageMetadata object with the metadata to +/// update. /// -/// \param completion A completion block which returns the StorageMetadata on success, -/// or an error on failure. +/// \param completion A completion block which returns the +/// StorageMetadata on success, or an error on failure. /// -- (void)updateMetadata:(FIRStorageMetadata * _Nonnull)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +- (void)updateMetadata:(FIRStorageMetadata *_Nonnull)metadata + completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; /// Deletes the object at the current path. -/// \param completion A completion block which returns a nonnull error on failure. +/// \param completion A completion block which returns a nonnull error on +/// failure. /// -- (void)deleteWithCompletion:(void (^ _Nullable)(NSError * _Nullable))completion; +- (void)deleteWithCompletion:(void (^_Nullable)(NSError *_Nullable))completion; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property (nonatomic, readonly) NSUInteger hash; -@property (nonatomic, readonly, copy) NSString * _Nonnull description; +@property(nonatomic, readonly) NSUInteger hash; +@property(nonatomic, readonly, copy) NSString *_Nonnull description; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - - - - @class NSProgress; /// StorageTaskSnapshot represents an immutable view of a task. @@ -775,42 +884,41 @@ SWIFT_CLASS_NAMED("StorageReference") SWIFT_CLASS_NAMED("StorageTaskSnapshot") @interface FIRStorageTaskSnapshot : NSObject /// The task this snapshot represents. -@property (nonatomic, readonly, strong) FIRStorageTask * _Nonnull task; +@property(nonatomic, readonly, strong) FIRStorageTask *_Nonnull task; /// Metadata returned by the task, or nil if no metadata returned. -@property (nonatomic, readonly, strong) FIRStorageMetadata * _Nullable metadata; +@property(nonatomic, readonly, strong) FIRStorageMetadata *_Nullable metadata; /// The StorageReference this task operates on. -@property (nonatomic, readonly, strong) FIRStorageReference * _Nonnull reference; +@property(nonatomic, readonly, strong) FIRStorageReference *_Nonnull reference; /// An object which tracks the progress of an upload or download. -@property (nonatomic, readonly, strong) NSProgress * _Nullable progress; -/// An error raised during task execution, or nil if no error occurred. -@property (nonatomic, readonly) NSError * _Nullable error; +@property(nonatomic, readonly, strong) NSProgress *_Nullable progress; +/// An error raised during task execution, or nil if no error +/// occurred. +@property(nonatomic, readonly) NSError *_Nullable error; /// The status of the task. -@property (nonatomic, readonly) enum FIRStorageTaskStatus status; -@property (nonatomic, readonly, copy) NSString * _Nonnull description; +@property(nonatomic, readonly) enum FIRStorageTaskStatus status; +@property(nonatomic, readonly, copy) NSString *_Nonnull description; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end -typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", open) { - FIRStorageTaskStatusUnknown = 0, - FIRStorageTaskStatusResume = 1, - FIRStorageTaskStatusProgress = 2, - FIRStorageTaskStatusPause = 3, - FIRStorageTaskStatusSuccess = 4, - FIRStorageTaskStatusFailure = 5, +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", + open){ + FIRStorageTaskStatusUnknown = 0, FIRStorageTaskStatusResume = 1, + FIRStorageTaskStatusProgress = 2, FIRStorageTaskStatusPause = 3, + FIRStorageTaskStatusSuccess = 4, FIRStorageTaskStatusFailure = 5, }; - -/// StorageUploadTask implements resumable uploads to a file in Firebase Storage. -/// Uploads can be returned on completion with a completion callback, and can be monitored -/// by attaching observers, or controlled by calling pause(), resume(), -/// or cancel(). -/// Uploads can be initialized from Data in memory, or a URL to a file on disk. -/// Uploads are performed on a background queue, and callbacks are raised on the developer -/// specified callbackQueue in Storage, or the main queue if unspecified. -/// Currently all uploads must be initiated and managed on the main queue. +/// StorageUploadTask implements resumable uploads to a file in +/// Firebase Storage. Uploads can be returned on completion with a completion +/// callback, and can be monitored by attaching observers, or controlled by +/// calling pause(), resume(), or +/// cancel(). Uploads can be initialized from Data in +/// memory, or a URL to a file on disk. Uploads are performed on a background +/// queue, and callbacks are raised on the developer specified +/// callbackQueue in Storage, or the main queue if unspecified. SWIFT_CLASS_NAMED("StorageUploadTask") -@interface FIRStorageUploadTask : FIRStorageObservableTask +@interface FIRStorageUploadTask + : FIRStorageObservableTask /// Prepares a task and begins execution. - (void)enqueue; /// Pauses a task currently in progress. @@ -825,33 +933,37 @@ SWIFT_CLASS_NAMED("StorageUploadTask") #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef FIREBASESTORAGE_SWIFT_H #define FIREBASESTORAGE_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -860,191 +972,209 @@ SWIFT_CLASS_NAMED("StorageUploadTask") #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -1053,7 +1183,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -1070,17 +1200,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FirebaseStorage",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "FirebaseStorage", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -1088,107 +1223,124 @@ using UInt = size_t; @class FIRApp; @class FIRStorageReference; -/// Firebase Storage is a service that supports uploading and downloading binary objects, -/// such as images, videos, and other files to Google Cloud Storage. Instances of Storage -/// are not thread-safe. -/// If you call Storage.storage(), the instance will initialize with the default FirebaseApp, -/// FirebaseApp.app(), and the storage location will come from the provided -/// GoogleService-Info.plist. -/// If you provide a custom instance of FirebaseApp, -/// the storage location will be specified via the FirebaseOptions.storageBucket property. +/// Firebase Storage is a service that supports uploading and downloading binary +/// objects, such as images, videos, and other files to Google Cloud Storage. +/// Instances of Storage are not thread-safe, but can be accessed +/// from any thread. If you call Storage.storage(), the instance +/// will initialize with the default FirebaseApp, +/// FirebaseApp.app(), and the storage location will come from the +/// provided GoogleService-Info.plist. If you provide a custom +/// instance of FirebaseApp, the storage location will be specified +/// via the FirebaseOptions.storageBucket property. SWIFT_CLASS_NAMED("Storage") @interface FIRStorage : NSObject /// The default Storage instance. /// /// returns: -/// An instance of Storage, configured with the default FirebaseApp. -+ (FIRStorage * _Nonnull)storage SWIFT_WARN_UNUSED_RESULT; -/// A method used to create Storage instances initialized with a custom storage bucket URL. -/// Any StorageReferences generated from this instance of Storage will reference files -/// and directories within the specified bucket. -/// \param url The gs:// URL to your Firebase Storage bucket. +/// An instance of Storage, configured with the default +/// FirebaseApp. ++ (FIRStorage *_Nonnull)storage SWIFT_WARN_UNUSED_RESULT; +/// A method used to create Storage instances initialized with a +/// custom storage bucket URL. Any StorageReferences generated from +/// this instance of Storage will reference files and directories +/// within the specified bucket. \param url The gs:// URL to your +/// Firebase Storage bucket. /// /// /// returns: /// A Storage instance, configured with the custom storage bucket. -+ (FIRStorage * _Nonnull)storageWithURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates an instance of Storage, configured with a custom FirebaseApp. StorageReferences -/// generated from a resulting instance will reference files in the Firebase project -/// associated with custom FirebaseApp. -/// \param app The custom FirebaseApp used for initialization. ++ (FIRStorage *_Nonnull)storageWithURL:(NSString *_Nonnull)url + SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom +/// FirebaseApp. StorageReferences generated from a +/// resulting instance will reference files in the Firebase project associated +/// with custom FirebaseApp. \param app The custom +/// FirebaseApp used for initialization. /// /// /// returns: -/// A Storage instance, configured with the custom FirebaseApp. -+ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app SWIFT_WARN_UNUSED_RESULT; -/// Creates an instance of Storage, configured with a custom FirebaseApp and a custom storage -/// bucket URL. -/// \param app The custom FirebaseApp used for initialization. +/// A Storage instance, configured with the custom +/// FirebaseApp. ++ (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app + SWIFT_WARN_UNUSED_RESULT; +/// Creates an instance of Storage, configured with a custom +/// FirebaseApp and a custom storage bucket URL. \param app The +/// custom FirebaseApp used for initialization. /// /// \param url The gs:// url to your Firebase Storage bucket. /// /// /// returns: -/// the Storage instance, configured with the custom FirebaseApp and storage bucket URL. -+ (FIRStorage * _Nonnull)storageForApp:(FIRApp * _Nonnull)app URL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; +/// the Storage instance, configured with the custom +/// FirebaseApp and storage bucket URL. ++ (FIRStorage *_Nonnull)storageForApp:(FIRApp *_Nonnull)app + URL:(NSString *_Nonnull)url + SWIFT_WARN_UNUSED_RESULT; /// The FirebaseApp associated with this Storage instance. -@property (nonatomic, readonly, strong) FIRApp * _Nonnull app; +@property(nonatomic, readonly, strong) FIRApp *_Nonnull app; /// The maximum time in seconds to retry an upload if a failure occurs. /// Defaults to 10 minutes (600 seconds). -@property (nonatomic) NSTimeInterval maxUploadRetryTime; +@property(nonatomic) NSTimeInterval maxUploadRetryTime; /// The maximum time in seconds to retry a download if a failure occurs. /// Defaults to 10 minutes (600 seconds). -@property (nonatomic) NSTimeInterval maxDownloadRetryTime; -/// The maximum time in seconds to retry operations other than upload and download if a failure occurs. -/// Defaults to 2 minutes (120 seconds). -@property (nonatomic) NSTimeInterval maxOperationRetryTime; -/// Specify the maximum upload chunk size. Values less than 256K (262144) will be rounded up to 256K. Values -/// above 256K will be rounded down to the nearest 256K multiple. The default is no maximum. -@property (nonatomic) int64_t uploadChunkSizeBytes; -/// A DispatchQueue that all developer callbacks are fired on. Defaults to the main queue. -@property (nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue; -/// Creates a StorageReference initialized at the root Firebase Storage location. +@property(nonatomic) NSTimeInterval maxDownloadRetryTime; +/// The maximum time in seconds to retry operations other than upload and +/// download if a failure occurs. Defaults to 2 minutes (120 seconds). +@property(nonatomic) NSTimeInterval maxOperationRetryTime; +/// Specify the maximum upload chunk size. Values less than 256K (262144) will +/// be rounded up to 256K. Values above 256K will be rounded down to the nearest +/// 256K multiple. The default is no maximum. +@property(nonatomic) int64_t uploadChunkSizeBytes; +/// A DispatchQueue that all developer callbacks are fired on. +/// Defaults to the main queue. +@property(nonatomic, strong) dispatch_queue_t _Nonnull callbackQueue; +/// Creates a StorageReference initialized at the root Firebase +/// Storage location. /// /// returns: -/// An instance of StorageReference referencing the root of the storage bucket. -- (FIRStorageReference * _Nonnull)reference SWIFT_WARN_UNUSED_RESULT; -/// Creates a StorageReference given a gs://, http://, or https:// URL pointing to a -/// Firebase Storage location. For example, you can pass in an https:// download URL retrieved from -/// StorageReference.downloadURL(completion:) or the gs:// URL from -/// StorageReference.description. +/// An instance of StorageReference referencing the root of the +/// storage bucket. +- (FIRStorageReference *_Nonnull)reference SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference given a gs://, http://, +/// or https:// URL pointing to a Firebase Storage location. For +/// example, you can pass in an https:// download URL retrieved +/// from StorageReference.downloadURL(completion:) or the +/// gs:// URL from StorageReference.description. /// \param url A gs // or https:// URL to initialize the reference with. /// /// /// throws: -/// Throws a fatal error if url is not associated with the FirebaseApp used to initialize -/// this Storage instance. +/// Throws a fatal error if url is not associated with the +/// FirebaseApp used to initialize this Storage instance. /// /// returns: /// An instance of StorageReference at the given child path. -- (FIRStorageReference * _Nonnull)referenceForURL:(NSString * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; -/// Creates a StorageReference initialized at a location specified by the path parameter. -/// \param path A relative path from the root of the storage bucket, -/// for instance @“path/to/object”. +- (FIRStorageReference *_Nonnull)referenceForURL:(NSString *_Nonnull)url + SWIFT_WARN_UNUSED_RESULT; +/// Creates a StorageReference initialized at a location specified +/// by the path parameter. \param path A relative path from the +/// root of the storage bucket, for instance @“path/to/object”. /// /// /// returns: /// An instance of StorageReference pointing to the given path. -- (FIRStorageReference * _Nonnull)referenceWithPath:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; -/// Configures the Storage SDK to use an emulated backend instead of the default remote backend. -/// This method should be called before invoking any other methods on a new instance of Storage. -- (void)useEmulatorWithHost:(NSString * _Nonnull)host port:(NSInteger)port; +- (FIRStorageReference *_Nonnull)referenceWithPath:(NSString *_Nonnull)path + SWIFT_WARN_UNUSED_RESULT; +/// Configures the Storage SDK to use an emulated backend instead of the default +/// remote backend. This method should be called before invoking any other +/// methods on a new instance of Storage. +- (void)useEmulatorWithHost:(NSString *_Nonnull)host port:(NSInteger)port; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property (nonatomic, readonly) NSUInteger hash; +@property(nonatomic, readonly) NSUInteger hash; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - -/// Defines task operations such as pause, resume, cancel, and enqueue for all tasks. -/// All tasks are required to implement enqueue, which begins the task, and may optionally -/// implement pause, resume, and cancel, which operate on the task to pause, resume, and cancel -/// operations. +/// Defines task operations such as pause, resume, cancel, and enqueue for all +/// tasks. All tasks are required to implement enqueue, which begins the task, +/// and may optionally implement pause, resume, and cancel, which operate on the +/// task to pause, resume, and cancel operations. SWIFT_PROTOCOL_NAMED("StorageTaskManagement") @protocol FIRStorageTaskManagement /// Prepares a task and begins execution. @@ -1205,30 +1357,29 @@ SWIFT_PROTOCOL_NAMED("StorageTaskManagement") @class FIRStorageTaskSnapshot; /// A superclass to all Storage tasks, including StorageUploadTask -/// and StorageDownloadTask, to provide state transitions, event raising, and common storage -/// for metadata and errors. -/// Callbacks are always fired on the developer-specified callback queue. -/// If no queue is specified, it defaults to the main queue. -/// This class is not thread safe, so only call methods on the main thread. +/// and StorageDownloadTask, to provide state transitions, event +/// raising, and common storage for metadata and errors. Callbacks are always +/// fired on the developer-specified callback queue. If no queue is specified, +/// it defaults to the main queue. This class is thread-safe. SWIFT_CLASS_NAMED("StorageTask") @interface FIRStorageTask : NSObject /// An immutable view of the task and associated metadata, progress, error, etc. -@property (nonatomic, readonly, strong) FIRStorageTaskSnapshot * _Nonnull snapshot; +@property(nonatomic, readonly, strong) + FIRStorageTaskSnapshot *_Nonnull snapshot; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end enum FIRStorageTaskStatus : NSInteger; -/// An extended StorageTask providing observable semantics that can be used for responding to changes -/// in task state. -/// Observers produce a StorageHandle, which is used to keep track of and remove specific -/// observers at a later date. -/// This class is not thread safe and can only be called on the main thread. +/// An extended StorageTask providing observable semantics that can +/// be used for responding to changes in task state. Observers produce a +/// StorageHandle, which is used to keep track of and remove +/// specific observers at a later date. SWIFT_CLASS_NAMED("StorageObservableTask") @interface FIRStorageObservableTask : FIRStorageTask -/// Observes changes in the upload status: Resume, Pause, Progress, Success, and Failure. -/// \param status The StorageTaskStatus change to observe. +/// Observes changes in the upload status: Resume, Pause, Progress, Success, and +/// Failure. \param status The StorageTaskStatus change to observe. /// /// \param handler A callback that fires every time the status event occurs, /// containing a StorageTaskSnapshot describing task state. @@ -1236,11 +1387,13 @@ SWIFT_CLASS_NAMED("StorageObservableTask") /// /// returns: /// A task handle that can be used to remove the observer at a later date. -- (NSString * _Nonnull)observeStatus:(enum FIRStorageTaskStatus)status handler:(void (^ _Nonnull)(FIRStorageTaskSnapshot * _Nonnull))handler; +- (NSString *_Nonnull) + observeStatus:(enum FIRStorageTaskStatus)status + handler:(void (^_Nonnull)(FIRStorageTaskSnapshot *_Nonnull))handler; /// Removes the single observer with the provided handle. -/// \param handle The handle of the task to remove. +/// \param handle The handle of the task to remove. /// -- (void)removeObserverWithHandle:(NSString * _Nonnull)handle; +- (void)removeObserverWithHandle:(NSString *_Nonnull)handle; /// Removes all observers for a single status. /// \param status A StorageTaskStatus to remove all listeners for. /// @@ -1249,20 +1402,22 @@ SWIFT_CLASS_NAMED("StorageObservableTask") - (void)removeAllObservers; @end - -/// StorageDownloadTask implements resumable downloads from an object in Firebase Storage. -/// Downloads can be returned on completion with a completion handler, and can be monitored -/// by attaching observers, or controlled by calling pause(), resume(), -/// or cancel(). -/// Downloads can currently be returned as Data in memory, or as a URL to a file on disk. -/// Downloads are performed on a background queue, and callbacks are raised on the developer -/// specified callbackQueue in Storage, or the main queue if left unspecified. -/// Currently all downloads must be initiated and managed on the main queue. +/// StorageDownloadTask implements resumable downloads from an +/// object in Firebase Storage. Downloads can be returned on completion with a +/// completion handler, and can be monitored by attaching observers, or +/// controlled by calling pause(), resume(), or +/// cancel(). Downloads can currently be returned as +/// Data in memory, or as a URL to a file on disk. +/// Downloads are performed on a background queue, and callbacks are raised on +/// the developer specified callbackQueue in Storage, or the main +/// queue if left unspecified. SWIFT_CLASS_NAMED("StorageDownloadTask") -@interface FIRStorageDownloadTask : FIRStorageObservableTask +@interface FIRStorageDownloadTask + : FIRStorageObservableTask /// Prepares a task and begins execution. - (void)enqueue; -/// Pauses a task currently in progress. Calling this on a paused task has no effect. +/// Pauses a task currently in progress. Calling this on a paused task has no +/// effect. - (void)pause; /// Cancels a task. - (void)cancel; @@ -1270,46 +1425,51 @@ SWIFT_CLASS_NAMED("StorageDownloadTask") - (void)resume; @end -/// Adds wrappers for common Firebase Storage errors (including creating errors from GCS errors). -/// For more information on unwrapping GCS errors, see the GCS errors docs: -/// https://cloud.google.com/storage/docs/json_api/v1/status-codes -/// This is never publicly exposed to end developers (as they will simply see an NSError). -typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", open) { - FIRStorageErrorCodeUnknown = -13000, - FIRStorageErrorCodeObjectNotFound = -13010, - FIRStorageErrorCodeBucketNotFound = -13011, - FIRStorageErrorCodeProjectNotFound = -13012, - FIRStorageErrorCodeQuotaExceeded = -13013, - FIRStorageErrorCodeUnauthenticated = -13020, - FIRStorageErrorCodeUnauthorized = -13021, - FIRStorageErrorCodeRetryLimitExceeded = -13030, - FIRStorageErrorCodeNonMatchingChecksum = -13031, - FIRStorageErrorCodeDownloadSizeExceeded = -13032, - FIRStorageErrorCodeCancelled = -13040, - FIRStorageErrorCodeInvalidArgument = -13050, +/// Adds wrappers for common Firebase Storage errors (including creating errors +/// from GCS errors). For more information on unwrapping GCS errors, see the GCS +/// errors docs: https://cloud.google.com/storage/docs/json_api/v1/status-codes +/// This is never publicly exposed to end developers (as they will simply see an +/// NSError). +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", + open){ + FIRStorageErrorCodeUnknown = -13000, + FIRStorageErrorCodeObjectNotFound = -13010, + FIRStorageErrorCodeBucketNotFound = -13011, + FIRStorageErrorCodeProjectNotFound = -13012, + FIRStorageErrorCodeQuotaExceeded = -13013, + FIRStorageErrorCodeUnauthenticated = -13020, + FIRStorageErrorCodeUnauthorized = -13021, + FIRStorageErrorCodeRetryLimitExceeded = -13030, + FIRStorageErrorCodeNonMatchingChecksum = -13031, + FIRStorageErrorCodeDownloadSizeExceeded = -13032, + FIRStorageErrorCodeCancelled = -13040, + FIRStorageErrorCodeInvalidArgument = -13050, }; -static NSString * _Nonnull const FIRStorageErrorCodeDomain = @"FirebaseStorage.StorageErrorCode"; +static NSString *_Nonnull const FIRStorageErrorCodeDomain = + @"FirebaseStorage.StorageErrorCode"; - -/// Contains the prefixes and items returned by a StorageReference.list() call. +/// Contains the prefixes and items returned by a +/// StorageReference.list() call. SWIFT_CLASS_NAMED("StorageListResult") @interface FIRStorageListResult : NSObject /// The prefixes (folders) returned by a list() operation. /// /// returns: /// A list of prefixes (folders). -@property (nonatomic, readonly, copy) NSArray * _Nonnull prefixes; +@property(nonatomic, readonly, copy) + NSArray *_Nonnull prefixes; /// The objects (files) returned by a list() operation. /// /// returns: /// A page token if more results are available. -@property (nonatomic, readonly, copy) NSArray * _Nonnull items; -/// Returns a token that can be used to resume a previous list() operation. nil -/// indicates that there are no more results. +@property(nonatomic, readonly, copy) + NSArray *_Nonnull items; +/// Returns a token that can be used to resume a previous list() +/// operation. nil indicates that there are no more results. /// /// returns: /// A page token if more results are available. -@property (nonatomic, readonly, copy) NSString * _Nullable pageToken; +@property(nonatomic, readonly, copy) NSString *_Nullable pageToken; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @@ -1317,284 +1477,344 @@ SWIFT_CLASS_NAMED("StorageListResult") @class NSDate; -/// Class which represents the metadata on an object in Firebase Storage. This metadata is -/// returned on successful operations, and can be used to retrieve download URLs, content types, -/// and a Storage reference to the object in question. Full documentation can be found at the GCS -/// Objects#resource docs. +/// Class which represents the metadata on an object in Firebase Storage. This +/// metadata is returned on successful operations, and can be used to retrieve +/// download URLs, content types, and a Storage reference to the object in +/// question. Full documentation can be found at the GCS Objects#resource docs. /// @see https://cloud.google.com/storage/docs/json_api/v1/objects#resource SWIFT_CLASS_NAMED("StorageMetadata") @interface FIRStorageMetadata : NSObject /// The name of the bucket containing this object. -@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; +@property(nonatomic, readonly, copy) NSString *_Nonnull bucket; /// Cache-Control directive for the object data. -@property (nonatomic, copy) NSString * _Nullable cacheControl; +@property(nonatomic, copy) NSString *_Nullable cacheControl; /// Content-Disposition of the object data. -@property (nonatomic, copy) NSString * _Nullable contentDisposition; +@property(nonatomic, copy) NSString *_Nullable contentDisposition; /// Content-Encoding of the object data. -@property (nonatomic, copy) NSString * _Nullable contentEncoding; +@property(nonatomic, copy) NSString *_Nullable contentEncoding; /// Content-Language of the object data. -@property (nonatomic, copy) NSString * _Nullable contentLanguage; +@property(nonatomic, copy) NSString *_Nullable contentLanguage; /// Content-Type of the object data. -@property (nonatomic, copy) NSString * _Nullable contentType; +@property(nonatomic, copy) NSString *_Nullable contentType; /// MD5 hash of the data; encoded using base64. -@property (nonatomic, readonly, copy) NSString * _Nullable md5Hash; +@property(nonatomic, readonly, copy) NSString *_Nullable md5Hash; /// The content generation of this object. Used for object versioning. -@property (nonatomic, readonly) int64_t generation; +@property(nonatomic, readonly) int64_t generation; /// User-provided metadata, in key/value pairs. -@property (nonatomic, copy) NSDictionary * _Nullable customMetadata; +@property(nonatomic, copy) + NSDictionary *_Nullable customMetadata; /// The version of the metadata for this object at this generation. Used -/// for preconditions and for detecting changes in metadata. A metageneration number is only -/// meaningful in the context of a particular generation of a particular object. -@property (nonatomic, readonly) int64_t metageneration; -/// The name of this object, in gs://bucket/path/to/object.txt, this is object.txt. -@property (nonatomic, readonly, copy) NSString * _Nullable name; -/// The full path of this object, in gs://bucket/path/to/object.txt, this is path/to/object.txt. -@property (nonatomic, readonly, copy) NSString * _Nullable path; +/// for preconditions and for detecting changes in metadata. A metageneration +/// number is only meaningful in the context of a particular generation of a +/// particular object. +@property(nonatomic, readonly) int64_t metageneration; +/// The name of this object, in gs://bucket/path/to/object.txt, this is +/// object.txt. +@property(nonatomic, readonly, copy) NSString *_Nullable name; +/// The full path of this object, in gs://bucket/path/to/object.txt, this is +/// path/to/object.txt. +@property(nonatomic, readonly, copy) NSString *_Nullable path; /// Content-Length of the data in bytes. -@property (nonatomic, readonly) int64_t size; +@property(nonatomic, readonly) int64_t size; /// The creation time of the object in RFC 3339 format. -@property (nonatomic, readonly, copy) NSDate * _Nullable timeCreated; +@property(nonatomic, readonly, copy) NSDate *_Nullable timeCreated; /// The modification time of the object metadata in RFC 3339 format. -@property (nonatomic, readonly, copy) NSDate * _Nullable updated; +@property(nonatomic, readonly, copy) NSDate *_Nullable updated; /// Never used API -@property (nonatomic, readonly, strong) FIRStorageReference * _Nullable storageReference SWIFT_DEPRECATED; +@property(nonatomic, readonly, strong) + FIRStorageReference *_Nullable storageReference SWIFT_DEPRECATED; /// Creates a Dictionary from the contents of the metadata. /// @return A Dictionary that represents the contents of the metadata. -- (NSDictionary * _Nonnull)dictionaryRepresentation SWIFT_WARN_UNUSED_RESULT; +- (NSDictionary *_Nonnull) + dictionaryRepresentation SWIFT_WARN_UNUSED_RESULT; /// Determines if the current metadata represents a “file”. -@property (nonatomic, readonly) BOOL isFile; +@property(nonatomic, readonly) BOOL isFile; /// Determines if the current metadata represents a “folder”. -@property (nonatomic, readonly) BOOL isFolder; +@property(nonatomic, readonly) BOOL isFolder; - (nonnull instancetype)init; /// Creates an instance of StorageMetadata from the contents of a dictionary. -/// @return An instance of StorageMetadata that represents the contents of a dictionary. -- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary OBJC_DESIGNATED_INITIALIZER; +/// @return An instance of StorageMetadata that represents the contents of a +/// dictionary. +- (nonnull instancetype)initWithDictionary: + (NSDictionary *_Nonnull)dictionary + OBJC_DESIGNATED_INITIALIZER; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property (nonatomic, readonly) NSUInteger hash; -@property (nonatomic, readonly, copy) NSString * _Nonnull description; +@property(nonatomic, readonly) NSUInteger hash; +@property(nonatomic, readonly, copy) NSString *_Nonnull description; @end - @class NSData; @class FIRStorageUploadTask; @class NSURL; -/// StorageReference represents a reference to a Google Cloud Storage object. Developers can -/// upload and download objects, as well as get/set object metadata, and delete an object at the -/// path. See the Cloud docs for more details: https://cloud.google.com/storage/ +/// StorageReference represents a reference to a Google Cloud +/// Storage object. Developers can upload and download objects, as well as +/// get/set object metadata, and delete an object at the path. See the Cloud +/// docs for more details: https://cloud.google.com/storage/ SWIFT_CLASS_NAMED("StorageReference") @interface FIRStorageReference : NSObject /// The Storage service object which created this reference. -@property (nonatomic, readonly, strong) FIRStorage * _Nonnull storage; +@property(nonatomic, readonly, strong) FIRStorage *_Nonnull storage; /// The name of the Google Cloud Storage bucket associated with this reference. -/// For example, in gs://bucket/path/to/object.txt, the bucket would be ‘bucket’. -@property (nonatomic, readonly, copy) NSString * _Nonnull bucket; +/// For example, in gs://bucket/path/to/object.txt, the bucket +/// would be ‘bucket’. +@property(nonatomic, readonly, copy) NSString *_Nonnull bucket; /// The full path to this object, not including the Google Cloud Storage bucket. -/// In gs://bucket/path/to/object.txt, the full path would be: path/to/object.txt -@property (nonatomic, readonly, copy) NSString * _Nonnull fullPath; +/// In gs://bucket/path/to/object.txt, the full path would be: +/// path/to/object.txt +@property(nonatomic, readonly, copy) NSString *_Nonnull fullPath; /// The short name of the object associated with this reference. -/// In gs://bucket/path/to/object.txt, the name of the object would be object.txt. -@property (nonatomic, readonly, copy) NSString * _Nonnull name; +/// In gs://bucket/path/to/object.txt, the name of the object would +/// be object.txt. +@property(nonatomic, readonly, copy) NSString *_Nonnull name; /// Creates a new StorageReference pointing to the root object. /// /// returns: /// A new StorageReference pointing to the root object. -- (FIRStorageReference * _Nonnull)root SWIFT_WARN_UNUSED_RESULT; -/// Creates a new StorageReference pointing to the parent of the current reference -/// or nil if this instance references the root location. -/// For example: -/// path = foo/bar/baz parent = foo/bar -/// path = foo parent = (root) -/// path = (root) parent = nil +- (FIRStorageReference *_Nonnull)root SWIFT_WARN_UNUSED_RESULT; +/// Creates a new StorageReference pointing to the parent of the +/// current reference or nil if this instance references the root +/// location. For example: path = foo/bar/baz parent = foo/bar path = foo +/// parent = (root) path = (root) parent = nil /// /// returns: -/// A new StorageReference pointing to the parent of the current reference. -- (FIRStorageReference * _Nullable)parent SWIFT_WARN_UNUSED_RESULT; -/// Creates a new StorageReference pointing to a child object of the current reference. -/// path = foo child = bar newPath = foo/bar -/// path = foo/bar child = baz ntask.impl.snapshotwPath = foo/bar/baz -/// All leading and trailing slashes will be removed, and consecutive slashes will be +/// A new StorageReference pointing to the parent of the current +/// reference. +- (FIRStorageReference *_Nullable)parent SWIFT_WARN_UNUSED_RESULT; +/// Creates a new StorageReference pointing to a child object of +/// the current reference. path = foo child = bar newPath = foo/bar path +/// = foo/bar child = baz ntask.impl.snapshotwPath = foo/bar/baz All leading +/// and trailing slashes will be removed, and consecutive slashes will be /// compressed to single slashes. For example: /// child = /foo/bar newPath = foo/bar /// child = foo/bar/ newPath = foo/bar /// child = foo///bar newPath = foo/bar -/// \param path The path to append to the current path. +/// \param path The path to append to the current path. /// /// /// returns: -/// A new StorageReference pointing to a child location of the current reference. -- (FIRStorageReference * _Nonnull)child:(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT; -/// Asynchronously uploads data to the currently specified StorageReference, -/// without additional metadata. -/// This is not recommended for large files, and one should instead upload a file from disk. +/// A new StorageReference pointing to a child location of the +/// current reference. +- (FIRStorageReference *_Nonnull)child:(NSString *_Nonnull)path + SWIFT_WARN_UNUSED_RESULT; +/// Asynchronously uploads data to the currently specified +/// StorageReference, without additional metadata. This is not +/// recommended for large files, and one should instead upload a file from disk. /// \param uploadData The data to upload. /// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata; -/// Asynchronously uploads data to the currently specified StorageReference. -/// This is not recommended for large files, and one should instead upload a file from disk. -/// \param uploadData The data to upload. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull)putData:(NSData *_Nonnull)uploadData + metadata: + (FIRStorageMetadata *_Nullable)metadata; +/// Asynchronously uploads data to the currently specified +/// StorageReference. This is not recommended for large files, and +/// one should instead upload a file from disk. \param uploadData The data to +/// upload. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData; -/// Asynchronously uploads data to the currently specified StorageReference. -/// This is not recommended for large files, and one should instead upload a file from disk. -/// \param uploadData The data to upload. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull)putData:(NSData *_Nonnull)uploadData; +/// Asynchronously uploads data to the currently specified +/// StorageReference. This is not recommended for large files, and +/// one should instead upload a file from disk. \param uploadData The data to +/// upload. /// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. /// -/// \param completion A closure that either returns the object metadata on success, -/// or an error on failure. +/// \param completion A closure that either returns the object metadata on +/// success, or an error on failure. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putData:(NSData * _Nonnull)uploadData metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; -/// Asynchronously uploads a file to the currently specified StorageReference. -/// putData should be used instead of putFile in Extensions. -/// \param fileURL A URL representing the system file path of the object to be uploaded. -/// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull) + putData:(NSData *_Nonnull)uploadData + metadata:(FIRStorageMetadata *_Nullable)metadata + completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously uploads a file to the currently specified +/// StorageReference. putData should be used instead +/// of putFile in Extensions. \param fileURL A URL representing the +/// system file path of the object to be uploaded. +/// +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata; -/// Asynchronously uploads a file to the currently specified StorageReference, -/// without additional metadata. -/// putData should be used instead of putFile in Extensions. -/// @param fileURL A URL representing the system file path of the object to be uploaded. -/// @return An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL; -/// Asynchronously uploads a file to the currently specified StorageReference. -/// putData should be used instead of putFile in Extensions. -/// \param fileURL A URL representing the system file path of the object to be uploaded. -/// -/// \param metadata StorageMetadata containing additional information (MIME type, etc.) -/// about the object being uploaded. -/// -/// \param completion A completion block that either returns the object metadata on success, -/// or an error on failure. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull)putFile:(NSURL *_Nonnull)fileURL + metadata: + (FIRStorageMetadata *_Nullable)metadata; +/// Asynchronously uploads a file to the currently specified +/// StorageReference, without additional metadata. +/// putData should be used instead of putFile in +/// Extensions. +/// @param fileURL A URL representing the system file path of the object to be +/// uploaded. +/// @return An instance of StorageUploadTask, which can be used to monitor or +/// manage the upload. +- (FIRStorageUploadTask *_Nonnull)putFile:(NSURL *_Nonnull)fileURL; +/// Asynchronously uploads a file to the currently specified +/// StorageReference. putData should be used instead +/// of putFile in Extensions. \param fileURL A URL representing the +/// system file path of the object to be uploaded. +/// +/// \param metadata StorageMetadata containing additional +/// information (MIME type, etc.) about the object being uploaded. +/// +/// \param completion A completion block that either returns the object metadata +/// on success, or an error on failure. /// /// /// returns: -/// An instance of StorageUploadTask, which can be used to monitor or manage the upload. -- (FIRStorageUploadTask * _Nonnull)putFile:(NSURL * _Nonnull)fileURL metadata:(FIRStorageMetadata * _Nullable)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; -/// Asynchronously downloads the object at the StorageReference to a Data instance in memory. -/// A Data buffer of the provided max size will be allocated, so ensure that the device has enough free -/// memory to complete the download. For downloading large files, write(toFile:) may be a better option. -/// \param maxSize The maximum size in bytes to download. If the download exceeds this size, -/// the task will be cancelled and an error will be returned. -/// -/// \param completion A completion block that either returns the object data on success, -/// or an error on failure. +/// An instance of StorageUploadTask, which can be used to monitor +/// or manage the upload. +- (FIRStorageUploadTask *_Nonnull) + putFile:(NSURL *_Nonnull)fileURL + metadata:(FIRStorageMetadata *_Nullable)metadata + completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously downloads the object at the StorageReference to +/// a Data instance in memory. A Data buffer of the +/// provided max size will be allocated, so ensure that the device has enough +/// free memory to complete the download. For downloading large files, +/// write(toFile:) may be a better option. \param maxSize The +/// maximum size in bytes to download. If the download exceeds this size, the +/// task will be cancelled and an error will be returned. +/// +/// \param completion A completion block that either returns the object data on +/// success, or an error on failure. /// /// /// returns: -/// An StorageDownloadTask that can be used to monitor or manage the download. -- (FIRStorageDownloadTask * _Nonnull)dataWithMaxSize:(int64_t)maxSize completion:(void (^ _Nonnull)(NSData * _Nullable, NSError * _Nullable))completion; +/// An StorageDownloadTask that can be used to monitor or manage +/// the download. +- (FIRStorageDownloadTask *_Nonnull) + dataWithMaxSize:(int64_t)maxSize + completion:(void (^_Nonnull)(NSData *_Nullable, + NSError *_Nullable))completion; /// Asynchronously retrieves a long lived download URL with a revokable token. -/// This can be used to share the file with others, but can be revoked by a developer -/// in the Firebase Console. -/// \param completion A completion block that either returns the URL on success, -/// or an error on failure. -/// -- (void)downloadURLWithCompletion:(void (^ _Nonnull)(NSURL * _Nullable, NSError * _Nullable))completion; -/// Asynchronously downloads the object at the current path to a specified system filepath. -///
        +/// This can be used to share the file with others, but can be revoked by a +/// developer in the Firebase Console. \param completion A completion block that +/// either returns the URL on success, or an error on failure. +/// +- (void)downloadURLWithCompletion: + (void (^_Nonnull)(NSURL *_Nullable, NSError *_Nullable))completion; +/// Asynchronously downloads the object at the current path to a specified +/// system filepath.
          ///
        • -/// Returns An StorageDownloadTask that can be used to monitor or manage the download. +/// Returns An StorageDownloadTask that can be used to monitor +/// or manage the download. ///
        • ///
        -/// \param fileURL A file system URL representing the path the object should be downloaded to. +/// \param fileURL A file system URL representing the path the object should be +/// downloaded to. /// -- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL; -/// Asynchronously downloads the object at the current path to a specified system filepath. -/// \param fileURL A file system URL representing the path the object should be downloaded to. +- (FIRStorageDownloadTask *_Nonnull)writeToFile:(NSURL *_Nonnull)fileURL; +/// Asynchronously downloads the object at the current path to a specified +/// system filepath. \param fileURL A file system URL representing the path the +/// object should be downloaded to. /// -/// \param completion A closure that fires when the file download completes, passed either -/// a URL pointing to the file path of the downloaded file on success, -/// or an error on failure. +/// \param completion A closure that fires when the file download completes, +/// passed either a URL pointing to the file path of the downloaded file on +/// success, or an error on failure. /// /// /// returns: -/// A StorageDownloadTask that can be used to monitor or manage the download. -- (FIRStorageDownloadTask * _Nonnull)writeToFile:(NSURL * _Nonnull)fileURL completion:(void (^ _Nullable)(NSURL * _Nullable, NSError * _Nullable))completion; -/// Lists all items (files) and prefixes (folders) under this StorageReference. -/// This is a helper method for calling list() repeatedly until there are no more results. -/// Consistency of the result is not guaranteed if objects are inserted or removed while this -/// operation is executing. All results are buffered in memory. -/// listAll(completion:) is only available for projects using Firebase Rules Version 2. -/// \param completion A completion handler that will be invoked with all items and prefixes under -/// the current StorageReference. -/// -- (void)listAllWithCompletion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; -/// List up to maxResults items (files) and prefixes (folders) under this StorageReference. -/// “/” is treated as a path delimiter. Firebase Storage does not support unsupported object -/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be -/// filtered. -/// list(maxResults:completion:) is only available for projects using Firebase Rules Version 2. -/// \param maxResults The maximum number of results to return in a single page. Must be greater -/// than 0 and at most 1000. -/// -/// \param completion A completion handler that will be invoked with up to maxResults items and -/// prefixes under the current StorageReference. -/// -- (void)listWithMaxResults:(int64_t)maxResults completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; -/// Resumes a previous call to list(maxResults:completion:), starting after a pagination token. -/// Returns the next set of items (files) and prefixes (folders) under this StorageReference. -/// “/” is treated as a path delimiter. Storage does not support unsupported object -/// paths that end with “/” or contain two consecutive “/“s. All invalid objects in GCS will be -/// filtered. -/// list(maxResults:pageToken:completion:)is only available for projects using Firebase Rules -/// Version 2. -/// \param maxResults The maximum number of results to return in a single page. Must be greater -/// than 0 and at most 1000. +/// A StorageDownloadTask that can be used to monitor or manage the +/// download. +- (FIRStorageDownloadTask *_Nonnull) + writeToFile:(NSURL *_Nonnull)fileURL + completion: + (void (^_Nullable)(NSURL *_Nullable, NSError *_Nullable))completion; +/// Lists all items (files) and prefixes (folders) under this +/// StorageReference. This is a helper method for calling +/// list() repeatedly until there are no more results. Consistency +/// of the result is not guaranteed if objects are inserted or removed while +/// this operation is executing. All results are buffered in memory. +/// listAll(completion:) is only available for projects using +/// Firebase Rules Version 2. \param completion A completion handler that will +/// be invoked with all items and prefixes under the current +/// StorageReference. +/// +- (void)listAllWithCompletion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, + NSError *_Nullable))completion; +/// List up to maxResults items (files) and prefixes (folders) +/// under this StorageReference. “/” is treated as a path delimiter. Firebase +/// Storage does not support unsupported object paths that end with “/” or +/// contain two consecutive “/“s. All invalid objects in GCS will be filtered. +/// list(maxResults:completion:) is only available for projects +/// using Firebase Rules Version 2. \param maxResults The maximum number of +/// results to return in a single page. Must be greater than 0 and at most 1000. +/// +/// \param completion A completion handler that will be invoked with up to +/// maxResults items and prefixes under the current +/// StorageReference. +/// +- (void)listWithMaxResults:(int64_t)maxResults + completion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, + NSError *_Nullable))completion; +/// Resumes a previous call to list(maxResults:completion:), +/// starting after a pagination token. Returns the next set of items (files) and +/// prefixes (folders) under this StorageReference. “/” is treated +/// as a path delimiter. Storage does not support unsupported object paths that +/// end with “/” or contain two consecutive “/“s. All invalid objects in GCS +/// will be filtered. list(maxResults:pageToken:completion:)is only +/// available for projects using Firebase Rules Version 2. \param maxResults The +/// maximum number of results to return in a single page. Must be greater than 0 +/// and at most 1000. /// /// \param pageToken A page token from a previous call to list. /// -/// \param completion A completion handler that will be invoked with the next items and prefixes -/// under the current StorageReference. +/// \param completion A completion handler that will be invoked with the next +/// items and prefixes under the current StorageReference. /// -- (void)listWithMaxResults:(int64_t)maxResults pageToken:(NSString * _Nonnull)pageToken completion:(void (^ _Nonnull)(FIRStorageListResult * _Nullable, NSError * _Nullable))completion; +- (void)listWithMaxResults:(int64_t)maxResults + pageToken:(NSString *_Nonnull)pageToken + completion:(void (^_Nonnull)(FIRStorageListResult *_Nullable, + NSError *_Nullable))completion; /// Retrieves metadata associated with an object at the current path. -/// \param completion A completion block which returns the object metadata on success, -/// or an error on failure. +/// \param completion A completion block which returns the object metadata on +/// success, or an error on failure. /// -- (void)metadataWithCompletion:(void (^ _Nonnull)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +- (void)metadataWithCompletion:(void (^_Nonnull)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; /// Updates the metadata associated with an object at the current path. -/// \param metadata A StorageMetadata object with the metadata to update. +/// \param metadata A StorageMetadata object with the metadata to +/// update. /// -/// \param completion A completion block which returns the StorageMetadata on success, -/// or an error on failure. +/// \param completion A completion block which returns the +/// StorageMetadata on success, or an error on failure. /// -- (void)updateMetadata:(FIRStorageMetadata * _Nonnull)metadata completion:(void (^ _Nullable)(FIRStorageMetadata * _Nullable, NSError * _Nullable))completion; +- (void)updateMetadata:(FIRStorageMetadata *_Nonnull)metadata + completion:(void (^_Nullable)(FIRStorageMetadata *_Nullable, + NSError *_Nullable))completion; /// Deletes the object at the current path. -/// \param completion A completion block which returns a nonnull error on failure. +/// \param completion A completion block which returns a nonnull error on +/// failure. /// -- (void)deleteWithCompletion:(void (^ _Nullable)(NSError * _Nullable))completion; +- (void)deleteWithCompletion:(void (^_Nullable)(NSError *_Nullable))completion; - (id _Nonnull)copy SWIFT_WARN_UNUSED_RESULT; - (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; -@property (nonatomic, readonly) NSUInteger hash; -@property (nonatomic, readonly, copy) NSString * _Nonnull description; +@property(nonatomic, readonly) NSUInteger hash; +@property(nonatomic, readonly, copy) NSString *_Nonnull description; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end - - - - @class NSProgress; /// StorageTaskSnapshot represents an immutable view of a task. @@ -1603,42 +1823,41 @@ SWIFT_CLASS_NAMED("StorageReference") SWIFT_CLASS_NAMED("StorageTaskSnapshot") @interface FIRStorageTaskSnapshot : NSObject /// The task this snapshot represents. -@property (nonatomic, readonly, strong) FIRStorageTask * _Nonnull task; +@property(nonatomic, readonly, strong) FIRStorageTask *_Nonnull task; /// Metadata returned by the task, or nil if no metadata returned. -@property (nonatomic, readonly, strong) FIRStorageMetadata * _Nullable metadata; +@property(nonatomic, readonly, strong) FIRStorageMetadata *_Nullable metadata; /// The StorageReference this task operates on. -@property (nonatomic, readonly, strong) FIRStorageReference * _Nonnull reference; +@property(nonatomic, readonly, strong) FIRStorageReference *_Nonnull reference; /// An object which tracks the progress of an upload or download. -@property (nonatomic, readonly, strong) NSProgress * _Nullable progress; -/// An error raised during task execution, or nil if no error occurred. -@property (nonatomic, readonly) NSError * _Nullable error; +@property(nonatomic, readonly, strong) NSProgress *_Nullable progress; +/// An error raised during task execution, or nil if no error +/// occurred. +@property(nonatomic, readonly) NSError *_Nullable error; /// The status of the task. -@property (nonatomic, readonly) enum FIRStorageTaskStatus status; -@property (nonatomic, readonly, copy) NSString * _Nonnull description; +@property(nonatomic, readonly) enum FIRStorageTaskStatus status; +@property(nonatomic, readonly, copy) NSString *_Nonnull description; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end -typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", open) { - FIRStorageTaskStatusUnknown = 0, - FIRStorageTaskStatusResume = 1, - FIRStorageTaskStatusProgress = 2, - FIRStorageTaskStatusPause = 3, - FIRStorageTaskStatusSuccess = 4, - FIRStorageTaskStatusFailure = 5, +typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", + open){ + FIRStorageTaskStatusUnknown = 0, FIRStorageTaskStatusResume = 1, + FIRStorageTaskStatusProgress = 2, FIRStorageTaskStatusPause = 3, + FIRStorageTaskStatusSuccess = 4, FIRStorageTaskStatusFailure = 5, }; - -/// StorageUploadTask implements resumable uploads to a file in Firebase Storage. -/// Uploads can be returned on completion with a completion callback, and can be monitored -/// by attaching observers, or controlled by calling pause(), resume(), -/// or cancel(). -/// Uploads can be initialized from Data in memory, or a URL to a file on disk. -/// Uploads are performed on a background queue, and callbacks are raised on the developer -/// specified callbackQueue in Storage, or the main queue if unspecified. -/// Currently all uploads must be initiated and managed on the main queue. +/// StorageUploadTask implements resumable uploads to a file in +/// Firebase Storage. Uploads can be returned on completion with a completion +/// callback, and can be monitored by attaching observers, or controlled by +/// calling pause(), resume(), or +/// cancel(). Uploads can be initialized from Data in +/// memory, or a URL to a file on disk. Uploads are performed on a background +/// queue, and callbacks are raised on the developer specified +/// callbackQueue in Storage, or the main queue if unspecified. SWIFT_CLASS_NAMED("StorageUploadTask") -@interface FIRStorageUploadTask : FIRStorageObservableTask +@interface FIRStorageUploadTask + : FIRStorageObservableTask /// Prepares a task and begins execution. - (void)enqueue; /// Pauses a task currently in progress. @@ -1653,7 +1872,7 @@ SWIFT_CLASS_NAMED("StorageUploadTask") #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/ios_pod/swift_headers/SwiftProtobuf-Swift.h b/ios_pod/swift_headers/SwiftProtobuf-Swift.h index fb5b1f0f2c..8c7bd8ec0f 100644 --- a/ios_pod/swift_headers/SwiftProtobuf-Swift.h +++ b/ios_pod/swift_headers/SwiftProtobuf-Swift.h @@ -1,29 +1,30 @@ -// Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.13.0. - #if 0 #elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef SWIFTPROTOBUF_SWIFT_H #define SWIFTPROTOBUF_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -32,191 +33,209 @@ #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -225,7 +244,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -239,17 +258,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftProtobuf",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "SwiftProtobuf", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -257,33 +281,37 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif #elif defined(__x86_64__) && __x86_64__ -// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// Copyright 2023 Google LLC +// Copied from Firebase iOS SDK 10.14.0. + +// Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 +// clang-1400.0.29.51) #ifndef SWIFTPROTOBUF_SWIFT_H #define SWIFTPROTOBUF_SWIFT_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" #if !defined(__has_include) -# define __has_include(x) 0 +#define __has_include(x) 0 #endif #if !defined(__has_attribute) -# define __has_attribute(x) 0 +#define __has_attribute(x) 0 #endif #if !defined(__has_feature) -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if !defined(__has_warning) -# define __has_warning(x) 0 +#define __has_warning(x) 0 #endif #if __has_include() -# include +#include #endif #pragma clang diagnostic ignored "-Wduplicate-method-match" @@ -292,191 +320,209 @@ using UInt = size_t; #include #endif #if defined(__cplusplus) -#include -#include #include +#include +#include #else -#include -#include #include +#include +#include #endif #if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) +#define SWIFT_TYPEDEFS 1 +#if __has_include() +#include +#elif !defined(__cplusplus) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#define SWIFT_PASTE_HELPER(x, y) x##y +#define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class +#define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif +#if __has_feature(objc_class_property) +#define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +#else +#define SWIFT_CLASS_PROPERTY(...) +#endif #endif #if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else -# define SWIFT_RUNTIME_NAME(X) +#define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else -# define SWIFT_COMPILE_NAME(X) +#define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else -# define SWIFT_METHOD_FAMILY(X) +#define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) +#define SWIFT_NOESCAPE __attribute__((noescape)) #else -# define SWIFT_NOESCAPE +#define SWIFT_NOESCAPE #endif #if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) #else -# define SWIFT_RELEASES_ARGUMENT +#define SWIFT_RELEASES_ARGUMENT #endif #if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else -# define SWIFT_WARN_UNUSED_RESULT +#define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) +#define SWIFT_NORETURN __attribute__((noreturn)) #else -# define SWIFT_NORETURN +#define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA +#define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif +#if __has_attribute(objc_subclassing_restricted) +#define SWIFT_CLASS(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) \ + SWIFT_CLASS_EXTRA +#else +#define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#define SWIFT_CLASS_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +#endif #endif #if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif +#if __has_attribute(objc_class_stub) +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) \ + SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) \ + __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +#else +#define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +#define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +#endif #endif #if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL(SWIFT_NAME) \ + SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) \ + SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif +#if __has_attribute(objc_designated_initializer) +#define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define OBJC_DESIGNATED_INITIALIZER +#endif #endif #if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif +#if defined(__has_attribute) && __has_attribute(enum_extensibility) +#define SWIFT_ENUM_ATTR(_extensibility) \ + __attribute__((enum_extensibility(_extensibility))) +#else +#define SWIFT_ENUM_ATTR(_extensibility) +#endif #endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif +#define SWIFT_ENUM(_type, _name, _extensibility) \ + enum _name : _type _name; \ + enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +#if __has_feature(generalized_swift_name) +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); \ + enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) \ + SWIFT_ENUM_EXTRA _name : _type +#else +#define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) \ + SWIFT_ENUM(_type, _name, _extensibility) +#endif #endif #if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#define SWIFT_AVAILABILITY(plat, ...) \ + __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#define SWIFT_WEAK_IMPORT __attribute__((weak_import)) #endif #if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) +#define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#define SWIFT_DEPRECATED_OBJC(Msg) \ + __attribute__((diagnose_if(1, Msg, "warning"))) #else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if defined(__OBJC__) #if !defined(IBSegueAction) -# define IBSegueAction +#define IBSegueAction #endif #endif #if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif +#if defined(__cplusplus) +#define SWIFT_EXTERN extern "C" +#else +#define SWIFT_EXTERN extern +#endif #endif #if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) +#define SWIFT_CALL __attribute__((swiftcall)) #endif #if defined(__cplusplus) #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT noexcept +#define SWIFT_NOEXCEPT noexcept #endif #else #if !defined(SWIFT_NOEXCEPT) -# define SWIFT_NOEXCEPT +#define SWIFT_NOEXCEPT #endif #endif #if defined(__cplusplus) @@ -485,7 +531,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); namespace swift { using Int = ptrdiff_t; using UInt = size_t; -} +} // namespace swift #endif #endif #if defined(__OBJC__) @@ -499,17 +545,22 @@ using UInt = size_t; #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" #if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SwiftProtobuf",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") +#pragma push_macro("any") +#undef any +#pragma clang attribute push( \ + __attribute__((external_source_symbol( \ + language = "Swift", defined_in = "SwiftProtobuf", \ + generated_declaration))), \ + apply_to = any(function, enum, objc_interface, objc_category, \ + objc_protocol)) +#pragma pop_macro("any") #endif #if defined(__OBJC__) @@ -517,7 +568,7 @@ using UInt = size_t; #if defined(__cplusplus) #endif #if __has_attribute(external_source_symbol) -# pragma clang attribute pop +#pragma clang attribute pop #endif #pragma clang diagnostic pop #endif diff --git a/messaging/integration_test/Podfile b/messaging/integration_test/Podfile index 6e4903f8b2..e7cead4e9a 100644 --- a/messaging/integration_test/Podfile +++ b/messaging/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Messaging', '10.13.0' + pod 'Firebase/Messaging', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Messaging', '10.13.0' + pod 'Firebase/Messaging', '10.14.0' end post_install do |installer| diff --git a/messaging/messaging_java/build.gradle b/messaging/messaging_java/build.gradle index 5289dac1a8..9a2126f779 100644 --- a/messaging/messaging_java/build.gradle +++ b/messaging/messaging_java/build.gradle @@ -55,7 +55,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-messaging' implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0' diff --git a/release_build_files/Android/firebase_dependencies.gradle b/release_build_files/Android/firebase_dependencies.gradle index 67d8d1120f..8d6fa09c28 100644 --- a/release_build_files/Android/firebase_dependencies.gradle +++ b/release_build_files/Android/firebase_dependencies.gradle @@ -27,7 +27,7 @@ def firebaseDependenciesMap = [ 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'], 'firestore' : ['com.google.firebase:firebase-firestore'], 'functions' : ['com.google.firebase:firebase-functions'], - 'gma' : ['com.google.android.gms:play-services-ads:22.2.0'], + 'gma' : ['com.google.android.gms:play-services-ads:22.3.0'], 'installations' : ['com.google.firebase:firebase-installations'], 'invites' : ['com.google.firebase:firebase-invites'], // Messaging has an additional local dependency to include. @@ -131,7 +131,7 @@ project.afterEvaluate { // Add the bill-of-materials project.dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') } for (String lib : firebaseCpp.dependencies.libSet) { // Messaging includes an aar, which to be depended on properly requires diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 9b03e10cdb..2a6ed8bd31 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -86,7 +86,7 @@ distributed as part of the core Firebase Feature | Required Libraries and Gradle Packages -------------------------- | -------------------------------------- -All Firebase SDKs | platform(com.google.firebase:firebase-bom:32.2.2) +All Firebase SDKs | platform(com.google.firebase:firebase-bom:32.2.3) | | (Android Bill of Materials) Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a @@ -134,7 +134,7 @@ Google Mobile Ads | libfirebase_gma.a | | libfirebase_app.a | | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.android.gms:play-services-ads:22.2.0 +| | com.google.android.gms:play-services-ads:22.3.0 | | (Maven package) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a @@ -228,49 +228,49 @@ Feature | Required Frameworks and Cocoapods -------------------------- | --------------------------------------- Firebase Analytics | firebase_analytics.xcframework | | firebase.xcframework -| | Firebase/Analytics Cocoapod (10.13.0) +| | Firebase/Analytics Cocoapod (10.14.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.13.0) +| | Firebase/AppCheck Cocoapod (10.14.0) Firebase Authentication | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.14.0) Firebase Dynamic Links | firebase_dynamic_links.xcframework | | firebase.xcframework -| | Firebase/DynamicLinks Cocoapod (10.13.0) +| | Firebase/DynamicLinks Cocoapod (10.14.0) Cloud Firestore | firebase_firestore.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Firestore Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Firestore Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Firebase Functions | firebase_functions.xcframework | | firebase_auth.xcframework (optional) | | firebase.xcframework -| | Firebase/Functions Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Functions Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Google Mobile Ads | firebase_gma.xcframework | | firebase.xcframework -| | Firebase/CoreOnly Cocoapod (10.13.0) +| | Firebase/CoreOnly Cocoapod (10.14.0) | | Google-Mobile-Ads-SDK Cocoapod (10.9.0) Firebase Installations | firebase_installations.xcframework | | firebase.xcframework -| | FirebaseInstallations Cocoapod (10.13.0) +| | FirebaseInstallations Cocoapod (10.14.0) Firebase Cloud Messaging | firebase_messaging.xcframework | | firebase.xcframework -| | Firebase/Messaging Cocoapod (10.13.0) +| | Firebase/Messaging Cocoapod (10.14.0) Firebase Realtime Database | firebase_database.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Database Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Database Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Firebase Remote Config | firebase_remote_config.xcframework | | firebase.xcframework -| | Firebase/RemoteConfig Cocoapod (10.13.0) +| | Firebase/RemoteConfig Cocoapod (10.14.0) Firebase Storage | firebase_storage.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Storage Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Storage Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Important: Each version of the Firebase C++ SDK supports a specific version of the Firebase iOS SDK. Please ensure that you reference the Cocoapod versions @@ -290,49 +290,49 @@ Feature | Required Libraries and Cocoapods -------------------------- | ----------------------------------------- Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a -| | Firebase/Analytics Cocoapod (10.13.0) +| | Firebase/Analytics Cocoapod (10.14.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.13.0) +| | Firebase/AppCheck Cocoapod (10.14.0) Firebase Authentication | libfirebase_auth.a | | libfirebase_app.a -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Auth Cocoapod (10.14.0) Firebase Dynamic Links | libfirebase_dynamic_links.a | | libfirebase_app.a -| | Firebase/DynamicLinks Cocoapod (10.13.0) +| | Firebase/DynamicLinks Cocoapod (10.14.0) Cloud Firestore | libfirebase_firestore.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Firestore Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Firestore Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Firebase Functions | libfirebase_functions.a | | libfirebase_app.a | | libfirebase_auth.a (optional) -| | Firebase/Functions Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Functions Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Google Mobile Ads | libfirebase_gma.a | | libfirebase_app.a -| | Firebase/CoreOnly Cocoapod (10.13.0) +| | Firebase/CoreOnly Cocoapod (10.14.0) | | Google-Mobile-Ads-SDK Cocoapod (10.9.0) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a -| | FirebaseInstallations Cocoapod (10.13.0) +| | FirebaseInstallations Cocoapod (10.14.0) Firebase Cloud Messaging | libfirebase_messaging.a | | libfirebase_app.a -| | Firebase/CloudMessaging Cocoapod (10.13.0) +| | Firebase/CloudMessaging Cocoapod (10.14.0) Firebase Realtime Database | libfirebase_database.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Database Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Database Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Firebase Remote Config | libfirebase_remote_config.a | | libfirebase_app.a -| | Firebase/RemoteConfig Cocoapod (10.13.0) +| | Firebase/RemoteConfig Cocoapod (10.14.0) Firebase Storage | libfirebase_storage.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Storage Cocoapod (10.13.0) -| | Firebase/Auth Cocoapod (10.13.0) +| | Firebase/Storage Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.14.0) Important: Each version of the Firebase C++ SDK supports a specific version of the Firebase iOS SDK. Please ensure that you reference the Cocoapod versions @@ -629,6 +629,9 @@ code. ## Release Notes ### Next Release - Changes + - Analytics (iOS): Added InitiateOnDeviceConversionMeasurementWithPhoneNumber + function to facilitate the [on-device conversion + measurement](https://support.google.com/google-ads/answer/12119136) API. - Auth: Add Firebase Auth Emulator support. Set the environment variable USE_AUTH_EMULATOR=yes (and optionally AUTH_EMULATOR_PORT, default 9099) to connect to the local Firebase Auth Emulator. diff --git a/remote_config/integration_test/Podfile b/remote_config/integration_test/Podfile index 0c0ee247d1..68736f86ec 100644 --- a/remote_config/integration_test/Podfile +++ b/remote_config/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/RemoteConfig', '10.13.0' + pod 'Firebase/RemoteConfig', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/RemoteConfig', '10.13.0' + pod 'Firebase/RemoteConfig', '10.14.0' end post_install do |installer| diff --git a/remote_config/remote_config_resources/build.gradle b/remote_config/remote_config_resources/build.gradle index cf94b86b23..5a091ace7c 100644 --- a/remote_config/remote_config_resources/build.gradle +++ b/remote_config/remote_config_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-config' } diff --git a/storage/integration_test/Podfile b/storage/integration_test/Podfile index 1c27de3760..799c9fd8a8 100644 --- a/storage/integration_test/Podfile +++ b/storage/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Storage', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Storage', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Storage', '10.13.0' - pod 'Firebase/Auth', '10.13.0' + pod 'Firebase/Storage', '10.14.0' + pod 'Firebase/Auth', '10.14.0' end post_install do |installer| diff --git a/storage/storage_resources/build.gradle b/storage/storage_resources/build.gradle index 7e5ca796e2..17ec453219 100644 --- a/storage/storage_resources/build.gradle +++ b/storage/storage_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-storage' } From d704337714b026c8210cba5efcf4841467325b1e Mon Sep 17 00:00:00 2001 From: "firebase-workflow-trigger[bot]" <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:36:41 +0000 Subject: [PATCH 07/13] Automatic merge of main into feature_branch/ump-sdk - Sep 11, 2023 (#1442) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae98f767c45f0a402fc9492bf6cc2ce55885. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d48d28c52352f5e40640831934ff6921e4e. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Jon Simantov Co-authored-by: almostmatt@google.com * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang * Update merge-to-main script (#1420) * Before creating the merge-main PR, branch it off main, so merge conflicts can be addressed in the branch rather than by committing to main. * Format. * Update release version number for M135, 11.4.0 (#1421) * feat(auth): enable emulator support on desktop (#1423) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change --------- Co-authored-by: Cynthia Jiang * Internal Updates. (#1422) * Add logic to trim webp parameter from native image urls * Add Analytics function for on-device conversion (#1429) * Add Analytics function for phone number conversion * Formatting * Update analytics.h * Update analytics_test.cc * Update mobile dependencies - Tue Aug 29 2023 (#1436) * Update mobile dependencies - Tue Aug 29 2023 ### Android - com.google.android.gms.play_services_ads → 22.3.0 - com.google.firebase.firebase_bom → 32.2.3 ### iOS - Firebase/Analytics → 10.14.0 - Firebase/AppCheck → 10.14.0 - Firebase/Auth → 10.14.0 - Firebase/Core → 10.14.0 - Firebase/CoreOnly → 10.14.0 - Firebase/Crashlytics → 10.14.0 - Firebase/Database → 10.14.0 - Firebase/DynamicLinks → 10.14.0 - Firebase/Firestore → 10.14.0 - Firebase/Functions → 10.14.0 - Firebase/Installations → 10.14.0 - Firebase/Messaging → 10.14.0 - Firebase/RemoteConfig → 10.14.0 - Firebase/Storage → 10.14.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6016988287). * Update query_main to use normalized_order_bys * Update query_main.cc --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: a-maurice * add UseEmulator api to auth (#1437) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change * remove platform logging v1 code * add useEmulator api * test with emulator * clean up for review * tweak for review * update with comments * put back necessary heartbeat blocks --------- Co-authored-by: Cynthia Jiang --------- Co-authored-by: Jon Simantov Co-authored-by: Tom Andersen Co-authored-by: Matthew Hyndman Co-authored-by: a-maurice Co-authored-by: Saleem Abdulrasool Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Cynthia J Co-authored-by: Cynthia Jiang Co-authored-by: nakirekommula <126601200+nakirekommula@users.noreply.github.com> --- ios_pod/Podfile | 1 - 1 file changed, 1 deletion(-) diff --git a/ios_pod/Podfile b/ios_pod/Podfile index b637910139..22771e2081 100644 --- a/ios_pod/Podfile +++ b/ios_pod/Podfile @@ -4,7 +4,6 @@ use_frameworks! target 'GetPods' do pod 'Firebase/Core', '10.14.0' - pod 'Google-Mobile-Ads-SDK', '10.9.0' pod 'GoogleUserMessagingPlatform', '2.1.0' pod 'Firebase/Analytics', '10.14.0' From 92eb59436193cd35407965d7ee1acdb640d4c8a5 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Thu, 14 Sep 2023 11:19:30 -0700 Subject: [PATCH 08/13] Add support for User Messaging Platform SDK on Android (#1428) * Added debug device ID fetch to Android. * Add Java method for obtaining Android ID from secure settings. * Update android ID algorithm. * Add flatbuffers patch when building for Android. * Add stub Android files. * Fix path. * Add ConsentInfoHelper class with some starting functionality. * Fix GetDebugDeviceId on Android. * Format code. * Add UMP dependency. * Fix overrides. * Add initialization. * Lint. * Lint. * Move UMP resources to their own resource file and class path. * Fix relocated UMP resources. Add lint skip (like App Check). * Add enum conversion and fix build. * Add enum cache. * Android implementation of ConsentInfo functionality. * Format code. * Fix JNI type. * Fix Java build errors and format code. * Fix call. * Fix initialization. * Fix for debugDeviceId * Remove extra Enum method, and also format code. * Fix error message handling for Unavailable error. And format code. * Fix compile issue. * Remove extra debugging output. * Remove test filter for UMP only. * Remove extraneous HasExceptionOccurred function since ExceptionCheck does it for us. * Add OperationInProgress check to iOS SDK as well, and a test for it. Clean up enum cache and remove requirement to sync up c++/java enums. * Remove lint abortOnError false * Try enabling parallel gradle builds for Windows. * Restore script. * Remove lint on error abort. * Remove extra manifest file. * Restore build.gradle for GMA library proper * Temporarily remove ump_resources to see if this fixes Windows build hang. * Remove Flatbuffers patch to diagnose Windows hang. * Fix build error. * Add missing dependencies. * Revert "Add missing dependencies." This reverts commit 03deccad8ca163bd8daca57413aa39df596deef9. * Add ump-resources back in. * Add code back in. * Modify comment. * Remove lint abort. * Add compatibility version. * Move ConsentInfoHelper class into regular gma_resources. No need for a separate ump_resources. * Remove comment about build hang because spoiler alert, it doesn't cause it. * Ensure that GMA and UMP only load their shared class files once. * Rename mutex. * Update copyright date and fix lock issue. Also disable lint warning in this testapp (temporarily?) * Move lock to later in the destructor. * Format code. * Fix non-UI tests. --- Android/firebase_dependencies.gradle | 3 +- gma/CMakeLists.txt | 2 +- gma/gma_resources/build.gradle | 6 + gma/integration_test/build.gradle | 3 + gma/integration_test/src/integration_test.cc | 95 ++- gma/src/android/gma_android.cc | 28 +- gma/src/android/gma_android.h | 12 + .../ump/consent_info_internal_android.cc | 668 ++++++++++++++++++ .../ump/consent_info_internal_android.h | 132 ++++ gma/src/common/ump/consent_info.cc | 13 +- gma/src/common/ump/consent_info_internal.h | 9 + .../include/firebase/gma/ump/consent_info.h | 3 +- gma/src/ios/ump/consent_info_internal_ios.mm | 41 ++ .../gma/internal/cpp/ConsentInfoHelper.java | 312 ++++++++ messaging/messaging_java/build.gradle | 8 + .../Android/firebase_dependencies.gradle | 3 +- .../android_firebase_test_framework.cc | 52 +- .../google/firebase/example/TestHelper.java | 30 + 18 files changed, 1403 insertions(+), 17 deletions(-) create mode 100644 gma/src/android/ump/consent_info_internal_android.cc create mode 100644 gma/src/android/ump/consent_info_internal_android.h create mode 100644 gma/src_java/com/google/firebase/gma/internal/cpp/ConsentInfoHelper.java diff --git a/Android/firebase_dependencies.gradle b/Android/firebase_dependencies.gradle index 232026a2b1..1ae4a4674d 100644 --- a/Android/firebase_dependencies.gradle +++ b/Android/firebase_dependencies.gradle @@ -27,7 +27,8 @@ def firebaseDependenciesMap = [ 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'], 'firestore' : ['com.google.firebase:firebase-firestore'], 'functions' : ['com.google.firebase:firebase-functions'], - 'gma' : ['com.google.android.gms:play-services-ads:22.3.0'], + 'gma' : ['com.google.android.gms:play-services-ads:22.3.0', + 'com.google.android.ump:user-messaging-platform:2.1.0'], 'installations' : ['com.google.firebase:firebase-installations'], 'invites' : ['com.google.firebase:firebase-invites'], // Messaging has an additional local dependency to include. diff --git a/gma/CMakeLists.txt b/gma/CMakeLists.txt index 887139f1db..a58354f7f9 100644 --- a/gma/CMakeLists.txt +++ b/gma/CMakeLists.txt @@ -40,7 +40,7 @@ binary_to_array("gma_resources" # Source files used by the Android implementation. set(android_SRCS ${gma_resources_source} - src/stub/ump/consent_info_internal_stub.cc + src/android/ump/consent_info_internal_android.cc src/android/ad_request_converter.cc src/android/ad_error_android.cc src/android/adapter_response_info_android.cc diff --git a/gma/gma_resources/build.gradle b/gma/gma_resources/build.gradle index 735d2291cc..d79977e4a0 100644 --- a/gma/gma_resources/build.gradle +++ b/gma/gma_resources/build.gradle @@ -32,6 +32,11 @@ allprojects { apply plugin: 'com.android.library' android { + compileOptions { + sourceCompatibility 1.8 + targetCompatibility 1.8 + } + compileSdkVersion 28 sourceSets { @@ -48,6 +53,7 @@ dependencies { implementation platform('com.google.firebase:firebase-bom:32.2.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-ads:22.3.0' + implementation 'com.google.android.ump:user-messaging-platform:2.1.0' } afterEvaluate { diff --git a/gma/integration_test/build.gradle b/gma/integration_test/build.gradle index bbbfd2577d..fd65c3885e 100644 --- a/gma/integration_test/build.gradle +++ b/gma/integration_test/build.gradle @@ -73,6 +73,9 @@ android { proguardFile file('proguard.pro') } } + lintOptions { + abortOnError false + } } apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle" diff --git a/gma/integration_test/src/integration_test.cc b/gma/integration_test/src/integration_test.cc index da158fa0ea..b51a96d3af 100644 --- a/gma/integration_test/src/integration_test.cc +++ b/gma/integration_test/src/integration_test.cc @@ -268,6 +268,7 @@ void FirebaseGmaTest::SetUp() { // debugging. They appear as a long string of hex characters. firebase::gma::RequestConfiguration request_configuration; request_configuration.test_device_ids = kTestDeviceIDs; + request_configuration.test_device_ids.push_back(GetDebugDeviceId()); firebase::gma::SetRequestConfiguration(request_configuration); } @@ -332,6 +333,7 @@ void FirebaseGmaUITest::SetUp() { // debugging. They appear as a long string of hex characters. firebase::gma::RequestConfiguration request_configuration; request_configuration.test_device_ids = kTestDeviceIDs; + request_configuration.test_device_ids.push_back(GetDebugDeviceId()); firebase::gma::SetRequestConfiguration(request_configuration); } @@ -2493,7 +2495,12 @@ class FirebaseGmaUmpTest : public FirebaseGmaTest { void FirebaseGmaUmpTest::InitializeUmp(ResetOption reset) { using firebase::gma::ump::ConsentInfo; - consent_info_ = ConsentInfo::GetInstance(*shared_app_); + firebase::InitResult result; + consent_info_ = ConsentInfo::GetInstance(*shared_app_, &result); + + EXPECT_NE(consent_info_, nullptr); + EXPECT_EQ(result, firebase::kInitResultSuccess); + if (consent_info_ != nullptr && reset == kReset) { consent_info_->Reset(); } @@ -2937,4 +2944,90 @@ TEST_F(FirebaseGmaUmpTest, TestUmpCleanupRaceCondition) { EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid); } +TEST_F(FirebaseGmaUmpTest, TestUmpMethodsReturnOperationInProgress) { + SKIP_TEST_ON_DESKTOP; + + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + // Check that all of the UMP operations properly return an OperationInProgress + // error if called more than once at the same time. Each step of this test is + // inherently flaky, so add flaky test blocks all over. + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + ShouldRunUITests() ? firebase::gma::ump::kConsentDebugGeographyEEA + : firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); + + FLAKY_TEST_SECTION_BEGIN(); + firebase::Future future_request_1 = + consent_info_->RequestConsentInfoUpdate(params); + firebase::Future future_request_2 = + consent_info_->RequestConsentInfoUpdate(params); + WaitForCompletion( + future_request_2, "RequestConsentInfoUpdate second", + firebase::gma::ump::kConsentRequestErrorOperationInProgress); + WaitForCompletion(future_request_1, "RequestConsentInfoUpdate first"); + FLAKY_TEST_SECTION_END(); + + if (ShouldRunUITests()) { + // The below should only be checked if UI tests are enabled, as they + // require some interaction. + FLAKY_TEST_SECTION_BEGIN(); + firebase::Future future_load_1 = consent_info_->LoadConsentForm(); + firebase::Future future_load_2 = consent_info_->LoadConsentForm(); + WaitForCompletion(future_load_2, "LoadConsentForm second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_load_1, "LoadConsentForm first"); + FLAKY_TEST_SECTION_END(); + + FLAKY_TEST_SECTION_BEGIN(); + firebase::Future future_show_1 = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); + firebase::Future future_show_2 = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); + WaitForCompletion(future_show_2, "ShowConsentForm second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_show_1, "ShowConsentForm first"); + FLAKY_TEST_SECTION_END(); + + FLAKY_TEST_SECTION_BEGIN(); + firebase::Future future_privacy_1 = + consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); + firebase::Future future_privacy_2 = + consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); + WaitForCompletion(future_privacy_2, "ShowPrivacyOptionsForm second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_privacy_1, "ShowPrivacyOptionsForm first"); + FLAKY_TEST_SECTION_END(); + + consent_info_->Reset(); + // Request again so we can test LoadAndShowConsentFormIfRequired. + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + FLAKY_TEST_SECTION_BEGIN(); + firebase::Future future_load_and_show_1 = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + firebase::Future future_load_and_show_2 = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + WaitForCompletion(future_load_and_show_2, + "LoadAndShowConsentFormIfRequired second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_load_and_show_1, + "LoadAndShowConsentFormIfRequired first"); + FLAKY_TEST_SECTION_END(); + } else { + LogInfo("Skipping methods that require user interaction."); + } +} + } // namespace firebase_testapp_automated diff --git a/gma/src/android/gma_android.cc b/gma/src/android/gma_android.cc index bcc7e35949..8ce19c7295 100644 --- a/gma/src/android/gma_android.cc +++ b/gma/src/android/gma_android.cc @@ -49,6 +49,12 @@ namespace firebase { namespace gma { +namespace internal { +::firebase::Mutex g_cached_gma_embedded_files_mutex; +std::vector<::firebase::internal::EmbeddedFile>* g_cached_gma_embedded_files = + nullptr; +} // namespace internal + METHOD_LOOKUP_DEFINITION(mobile_ads, PROGUARD_KEEP_CLASS "com/google/android/gms/ads/MobileAds", @@ -308,12 +314,22 @@ Future Initialize(JNIEnv* env, jobject activity, return Future(); } - const std::vector embedded_files = - util::CacheEmbeddedFiles(env, activity, - firebase::internal::EmbeddedFile::ToVector( - firebase_gma::gma_resources_filename, - firebase_gma::gma_resources_data, - firebase_gma::gma_resources_size)); + // Between this and UMP, we only want to load these files once. + { + MutexLock lock(internal::g_cached_gma_embedded_files_mutex); + if (internal::g_cached_gma_embedded_files == nullptr) { + internal::g_cached_gma_embedded_files = + new std::vector(); + *internal::g_cached_gma_embedded_files = + util::CacheEmbeddedFiles(env, activity, + firebase::internal::EmbeddedFile::ToVector( + firebase_gma::gma_resources_filename, + firebase_gma::gma_resources_data, + firebase_gma::gma_resources_size)); + } + } + const std::vector& embedded_files = + *internal::g_cached_gma_embedded_files; if (!(mobile_ads::CacheMethodIds(env, activity) && ad_request_builder::CacheMethodIds(env, activity) && diff --git a/gma/src/android/gma_android.h b/gma/src/android/gma_android.h index f2a38f9d21..8ada58c3d2 100644 --- a/gma/src/android/gma_android.h +++ b/gma/src/android/gma_android.h @@ -19,7 +19,11 @@ #include +#include + +#include "app/src/embedded_file.h" #include "app/src/util_android.h" +#include "firebase/internal/mutex.h" #include "gma/src/common/gma_common.h" namespace firebase { @@ -189,6 +193,14 @@ void ReleaseClasses(JNIEnv* env); jobject CreateJavaAdSize(JNIEnv* env, jobject activity, const AdSize& an_ad_size); +namespace internal { +// GMA and UMP share embedded dex files; this ensures +// that they are only loaded once each run. +extern ::firebase::Mutex g_cached_gma_embedded_files_mutex; +extern std::vector<::firebase::internal::EmbeddedFile>* + g_cached_gma_embedded_files; +} // namespace internal + } // namespace gma } // namespace firebase diff --git a/gma/src/android/ump/consent_info_internal_android.cc b/gma/src/android/ump/consent_info_internal_android.cc new file mode 100644 index 0000000000..903b7126cd --- /dev/null +++ b/gma/src/android/ump/consent_info_internal_android.cc @@ -0,0 +1,668 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gma/src/android/ump/consent_info_internal_android.h" + +#include + +#include +#include + +#include "app/src/assert.h" +#include "app/src/thread.h" +#include "app/src/util_android.h" +#include "firebase/internal/common.h" +#include "gma/gma_resources.h" +#include "gma/src/android/gma_android.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +ConsentInfoInternalAndroid* ConsentInfoInternalAndroid::s_instance = nullptr; +firebase::Mutex ConsentInfoInternalAndroid::s_instance_mutex; + +// clang-format off +#define CONSENTINFOHELPER_METHODS(X) \ + X(Constructor, "", "(JLandroid/app/Activity;)V"), \ + X(GetConsentStatus, "getConsentStatus", "()I"), \ + X(RequestConsentInfoUpdate, "requestConsentInfoUpdate", \ + "(JZILjava/util/ArrayList;)V"), \ + X(LoadConsentForm, "loadConsentForm", "(J)V"), \ + X(ShowConsentForm, "showConsentForm", "(JLandroid/app/Activity;)Z"), \ + X(LoadAndShowConsentFormIfRequired, "loadAndShowConsentFormIfRequired", \ + "(JLandroid/app/Activity;)V"), \ + X(GetPrivacyOptionsRequirementStatus, "getPrivacyOptionsRequirementStatus", \ + "()I"), \ + X(ShowPrivacyOptionsForm, "showPrivacyOptionsForm", \ + "(JLandroid/app/Activity;)V"), \ + X(Reset, "reset", "()V"), \ + X(CanRequestAds, "canRequestAds", "()Z"), \ + X(IsConsentFormAvailable, "isConsentFormAvailable", "()Z"), \ + X(Disconnect, "disconnect", "()V") +// clang-format on + +// clang-format off +#define CONSENTINFOHELPER_FIELDS(X) \ + X(PrivacyOptionsRequirementUnknown, \ + "PRIVACY_OPTIONS_REQUIREMENT_UNKNOWN", "I", util::kFieldTypeStatic), \ + X(PrivacyOptionsRequirementRequired, \ + "PRIVACY_OPTIONS_REQUIREMENT_REQUIRED", "I", util::kFieldTypeStatic), \ + X(PrivacyOptionsRequirementNotRequired, \ + "PRIVACY_OPTIONS_REQUIREMENT_NOT_REQUIRED", "I", util::kFieldTypeStatic), \ + X(FunctionRequestConsentInfoUpdate, \ + "FUNCTION_REQUEST_CONSENT_INFO_UPDATE", "I", util::kFieldTypeStatic), \ + X(FunctionLoadConsentForm, \ + "FUNCTION_LOAD_CONSENT_FORM", "I", util::kFieldTypeStatic), \ + X(FunctionShowConsentForm, \ + "FUNCTION_SHOW_CONSENT_FORM", "I", util::kFieldTypeStatic), \ + X(FunctionLoadAndShowConsentFormIfRequired, \ + "FUNCTION_LOAD_AND_SHOW_CONSENT_FORM_IF_REQUIRED", \ + "I", util::kFieldTypeStatic), \ + X(FunctionShowPrivacyOptionsForm, \ + "FUNCTION_SHOW_PRIVACY_OPTIONS_FORM", "I", util::kFieldTypeStatic), \ + X(FunctionCount, "FUNCTION_COUNT", "I", util::kFieldTypeStatic) +// clang-format on + +METHOD_LOOKUP_DECLARATION(consent_info_helper, CONSENTINFOHELPER_METHODS, + CONSENTINFOHELPER_FIELDS); + +METHOD_LOOKUP_DEFINITION( + consent_info_helper, + "com/google/firebase/gma/internal/cpp/ConsentInfoHelper", + CONSENTINFOHELPER_METHODS, CONSENTINFOHELPER_FIELDS); + +// clang-format off +#define CONSENTINFORMATION_CONSENTSTATUS_FIELDS(X) \ + X(Unknown, "UNKNOWN", "I", util::kFieldTypeStatic), \ + X(NotRequired, "NOT_REQUIRED", "I", util::kFieldTypeStatic), \ + X(Required, "REQUIRED", "I", util::kFieldTypeStatic), \ + X(Obtained, "OBTAINED", "I", util::kFieldTypeStatic) +// clang-format on + +METHOD_LOOKUP_DECLARATION(consentinformation_consentstatus, METHOD_LOOKUP_NONE, + CONSENTINFORMATION_CONSENTSTATUS_FIELDS); +METHOD_LOOKUP_DEFINITION( + consentinformation_consentstatus, + PROGUARD_KEEP_CLASS + "com/google/android/ump/ConsentInformation$ConsentStatus", + METHOD_LOOKUP_NONE, CONSENTINFORMATION_CONSENTSTATUS_FIELDS); + +// clang-format off +#define FORMERROR_ERRORCODE_FIELDS(X) \ + X(InternalError, "INTERNAL_ERROR", "I", util::kFieldTypeStatic), \ + X(InternetError, "INTERNET_ERROR", "I", util::kFieldTypeStatic), \ + X(InvalidOperation, "INVALID_OPERATION", "I", util::kFieldTypeStatic), \ + X(TimeOut, "TIME_OUT", "I", util::kFieldTypeStatic) +// clang-format on + +METHOD_LOOKUP_DECLARATION(formerror_errorcode, METHOD_LOOKUP_NONE, + FORMERROR_ERRORCODE_FIELDS); +METHOD_LOOKUP_DEFINITION(formerror_errorcode, + PROGUARD_KEEP_CLASS + "com/google/android/ump/FormError$ErrorCode", + METHOD_LOOKUP_NONE, FORMERROR_ERRORCODE_FIELDS); + +// clang-format off +#define CONSENTDEBUGSETTINGS_DEBUGGEOGRAPHY_FIELDS(X) \ + X(Disabled, "DEBUG_GEOGRAPHY_DISABLED", "I", util::kFieldTypeStatic), \ + X(EEA, "DEBUG_GEOGRAPHY_EEA", "I", util::kFieldTypeStatic), \ + X(NotEEA, "DEBUG_GEOGRAPHY_NOT_EEA", "I", util::kFieldTypeStatic) +// clang-format on + +METHOD_LOOKUP_DECLARATION(consentdebugsettings_debuggeography, + METHOD_LOOKUP_NONE, + CONSENTDEBUGSETTINGS_DEBUGGEOGRAPHY_FIELDS); +METHOD_LOOKUP_DEFINITION( + consentdebugsettings_debuggeography, + PROGUARD_KEEP_CLASS + "com/google/android/ump/ConsentDebugSettings$DebugGeography", + METHOD_LOOKUP_NONE, CONSENTDEBUGSETTINGS_DEBUGGEOGRAPHY_FIELDS); + +// This explicitly implements the constructor for the outer class, +// ConsentInfoInternal. +ConsentInfoInternal* ConsentInfoInternal::CreateInstance(JNIEnv* jni_env, + jobject activity) { + ConsentInfoInternalAndroid* ptr = + new ConsentInfoInternalAndroid(jni_env, activity); + if (!ptr->valid()) { + delete ptr; + return nullptr; + } + return ptr; +} + +static void ReleaseClasses(JNIEnv* env) { + consent_info_helper::ReleaseClass(env); + consentinformation_consentstatus::ReleaseClass(env); + formerror_errorcode::ReleaseClass(env); + consentdebugsettings_debuggeography::ReleaseClass(env); +} + +ConsentInfoInternalAndroid::~ConsentInfoInternalAndroid() { + JNIEnv* env = GetJNIEnv(); + env->CallVoidMethod(helper_, consent_info_helper::GetMethodId( + consent_info_helper::kDisconnect)); + + MutexLock lock(s_instance_mutex); + s_instance = nullptr; + + env->DeleteGlobalRef(helper_); + helper_ = nullptr; + + ReleaseClasses(env); + util::Terminate(env); + + env->DeleteGlobalRef(activity_); + activity_ = nullptr; + java_vm_ = nullptr; +} + +// clang-format off +#define ENUM_VALUE(class_namespace, field_name) \ + env->GetStaticIntField(class_namespace::GetClass(), \ + class_namespace::GetFieldId(class_namespace::k##field_name)) +// clang-format on + +void ConsentInfoInternalAndroid::CacheEnumValues(JNIEnv* env) { + // Cache enum values when the class loads, to avoid JNI lookups during + // callbacks later on when converting enums between Android and C++ values. + enums_.consentstatus_unknown = + ENUM_VALUE(consentinformation_consentstatus, Unknown); + enums_.consentstatus_required = + ENUM_VALUE(consentinformation_consentstatus, Required); + enums_.consentstatus_not_required = + ENUM_VALUE(consentinformation_consentstatus, NotRequired); + enums_.consentstatus_obtained = + ENUM_VALUE(consentinformation_consentstatus, Obtained); + + enums_.debug_geography_disabled = + ENUM_VALUE(consentdebugsettings_debuggeography, Disabled); + enums_.debug_geography_eea = + ENUM_VALUE(consentdebugsettings_debuggeography, EEA); + enums_.debug_geography_not_eea = + ENUM_VALUE(consentdebugsettings_debuggeography, NotEEA); + + enums_.formerror_success = 0; + enums_.formerror_internal = ENUM_VALUE(formerror_errorcode, InternalError); + enums_.formerror_network = ENUM_VALUE(formerror_errorcode, InternetError); + enums_.formerror_invalid_operation = + ENUM_VALUE(formerror_errorcode, InvalidOperation); + enums_.formerror_timeout = ENUM_VALUE(formerror_errorcode, TimeOut); + + enums_.privacy_options_requirement_unknown = + ENUM_VALUE(consent_info_helper, PrivacyOptionsRequirementUnknown); + enums_.privacy_options_requirement_required = + ENUM_VALUE(consent_info_helper, PrivacyOptionsRequirementRequired); + enums_.privacy_options_requirement_not_required = + ENUM_VALUE(consent_info_helper, PrivacyOptionsRequirementNotRequired); + + enums_.function_request_consent_info_update = + ENUM_VALUE(consent_info_helper, FunctionRequestConsentInfoUpdate); + enums_.function_load_consent_form = + ENUM_VALUE(consent_info_helper, FunctionLoadConsentForm); + enums_.function_show_consent_form = + ENUM_VALUE(consent_info_helper, FunctionShowConsentForm); + enums_.function_load_and_show_consent_form_if_required = + ENUM_VALUE(consent_info_helper, FunctionLoadAndShowConsentFormIfRequired); + enums_.function_show_privacy_options_form = + ENUM_VALUE(consent_info_helper, FunctionShowPrivacyOptionsForm); + enums_.function_count = ENUM_VALUE(consent_info_helper, FunctionCount); +} + +void ConsentInfoInternalAndroid::JNI_ConsentInfoHelper_completeFuture( + JNIEnv* env, jclass clazz, jint future_fn, jlong consent_info_internal_ptr, + jlong future_handle, jint error_code, jobject error_message_obj) { + MutexLock lock(s_instance_mutex); + if (consent_info_internal_ptr == 0 || s_instance == nullptr) { + // Calling this with a null pointer, or if there is no active + // instance, is a no-op, so just return. + return; + } + ConsentInfoInternalAndroid* instance = + reinterpret_cast(consent_info_internal_ptr); + if (s_instance != instance) { + // If the instance we were called with does not match the current + // instance, a bad race condition has occurred (whereby while waiting for + // the operation to complete, ConsentInfo was deleted and then recreated). + // In that case, fully ignore this callback. + return; + } + std::string error_message = + error_message_obj ? util::JniStringToString(env, error_message_obj) : ""; + instance->CompleteFutureFromJniCallback( + env, future_fn, static_cast(future_handle), + static_cast(error_code), + error_message.length() > 0 ? error_message.c_str() : nullptr); +} + +ConsentInfoInternalAndroid::ConsentInfoInternalAndroid(JNIEnv* env, + jobject activity) + : java_vm_(nullptr), + activity_(nullptr), + helper_(nullptr), + has_requested_consent_info_update_(false) { + MutexLock lock(s_instance_mutex); + FIREBASE_ASSERT(s_instance == nullptr); + s_instance = this; + + util::Initialize(env, activity); + env->GetJavaVM(&java_vm_); + + // Between this and GMA, we only want to load these files once. + { + MutexLock lock( + ::firebase::gma::internal::g_cached_gma_embedded_files_mutex); + if (::firebase::gma::internal::g_cached_gma_embedded_files == nullptr) { + ::firebase::gma::internal::g_cached_gma_embedded_files = + new std::vector(); + *::firebase::gma::internal::g_cached_gma_embedded_files = + util::CacheEmbeddedFiles(env, activity, + firebase::internal::EmbeddedFile::ToVector( + firebase_gma::gma_resources_filename, + firebase_gma::gma_resources_data, + firebase_gma::gma_resources_size)); + } + } + const std::vector& embedded_files = + *::firebase::gma::internal::g_cached_gma_embedded_files; + + if (!(consent_info_helper::CacheClassFromFiles(env, activity, + &embedded_files) != nullptr && + consent_info_helper::CacheMethodIds(env, activity) && + consent_info_helper::CacheFieldIds(env, activity) && + consentinformation_consentstatus::CacheFieldIds(env, activity) && + formerror_errorcode::CacheFieldIds(env, activity) && + consentdebugsettings_debuggeography::CacheFieldIds(env, activity))) { + ReleaseClasses(env); + util::Terminate(env); + return; + } + static const JNINativeMethod kConsentInfoHelperNativeMethods[] = { + {"completeFuture", "(IJJILjava/lang/String;)V", + reinterpret_cast(&JNI_ConsentInfoHelper_completeFuture)}}; + if (!consent_info_helper::RegisterNatives( + env, kConsentInfoHelperNativeMethods, + FIREBASE_ARRAYSIZE(kConsentInfoHelperNativeMethods))) { + util::CheckAndClearJniExceptions(env); + ReleaseClasses(env); + util::Terminate(env); + return; + } + util::CheckAndClearJniExceptions(env); + jobject helper_ref = env->NewObject( + consent_info_helper::GetClass(), + consent_info_helper::GetMethodId(consent_info_helper::kConstructor), + reinterpret_cast(this), activity); + util::CheckAndClearJniExceptions(env); + if (!helper_ref) { + ReleaseClasses(env); + util::Terminate(env); + return; + } + + helper_ = env->NewGlobalRef(helper_ref); + FIREBASE_ASSERT(helper_); + env->DeleteLocalRef(helper_ref); + + activity_ = env->NewGlobalRef(activity); + + util::CheckAndClearJniExceptions(env); + + CacheEnumValues(env); + + util::CheckAndClearJniExceptions(env); +} + +ConsentStatus ConsentInfoInternalAndroid::CppConsentStatusFromAndroid( + jint status) { + if (status == enums().consentstatus_unknown) return kConsentStatusUnknown; + if (status == enums().consentstatus_required) return kConsentStatusRequired; + if (status == enums().consentstatus_not_required) + return kConsentStatusNotRequired; + if (status == enums().consentstatus_obtained) return kConsentStatusObtained; + LogWarning("GMA: Unknown ConsentStatus returned by UMP Android SDK: %d", + (int)status); + return kConsentStatusUnknown; +} + +PrivacyOptionsRequirementStatus +ConsentInfoInternalAndroid::CppPrivacyOptionsRequirementStatusFromAndroid( + jint status) { + if (status == enums().privacy_options_requirement_unknown) + return kPrivacyOptionsRequirementStatusUnknown; + if (status == enums().privacy_options_requirement_required) + return kPrivacyOptionsRequirementStatusRequired; + if (status == enums().privacy_options_requirement_not_required) + return kPrivacyOptionsRequirementStatusNotRequired; + LogWarning( + "GMA: Unknown PrivacyOptionsRequirementStatus returned by UMP Android " + "SDK: %d", + (int)status); + return kPrivacyOptionsRequirementStatusUnknown; +} + +jint ConsentInfoInternalAndroid::AndroidDebugGeographyFromCppDebugGeography( + ConsentDebugGeography geo) { + switch (geo) { + case kConsentDebugGeographyDisabled: + return enums().debug_geography_disabled; + case kConsentDebugGeographyEEA: + return enums().debug_geography_eea; + case kConsentDebugGeographyNonEEA: + return enums().debug_geography_not_eea; + default: + return enums().debug_geography_disabled; + } +} + +// Android uses FormError to report request errors as well. +ConsentRequestError +ConsentInfoInternalAndroid::CppConsentRequestErrorFromAndroidFormError( + jint error, const char* message) { + if (error == enums().formerror_success) return kConsentRequestSuccess; + if (error == enums().formerror_internal) return kConsentRequestErrorInternal; + if (error == enums().formerror_network) return kConsentRequestErrorNetwork; + if (error == enums().formerror_invalid_operation) { + // Error strings taken directly from the UMP Android SDK. + if (message && strcasestr(message, "misconfiguration") != nullptr) + return kConsentRequestErrorMisconfiguration; + else if (message && + strcasestr(message, "requires a valid application ID") != nullptr) + return kConsentRequestErrorInvalidAppId; + else + return kConsentRequestErrorInvalidOperation; + } + LogWarning("GMA: Unknown RequestError returned by UMP Android SDK: %d (%s)", + (int)error, message ? message : ""); + return kConsentRequestErrorUnknown; +} + +ConsentFormError +ConsentInfoInternalAndroid::CppConsentFormErrorFromAndroidFormError( + jint error, const char* message) { + if (error == enums().formerror_success) return kConsentFormSuccess; + if (error == enums().formerror_internal) return kConsentFormErrorInternal; + if (error == enums().formerror_timeout) return kConsentFormErrorTimeout; + if (error == enums().formerror_invalid_operation) { + // Error strings taken directly from the UMP Android SDK. + if (message && strcasestr(message, "no available form") != nullptr) + return kConsentFormErrorUnavailable; + else if (message && strcasestr(message, "form is not required") != nullptr) + return kConsentFormErrorUnavailable; + else if (message && + strcasestr(message, "can only be invoked once") != nullptr) + return kConsentFormErrorAlreadyUsed; + else + return kConsentFormErrorInvalidOperation; + } + LogWarning("GMA: Unknown RequestError returned by UMP Android SDK: %d (%s)", + (int)error, message ? message : ""); + return kConsentFormErrorUnknown; +} + +Future ConsentInfoInternalAndroid::RequestConsentInfoUpdate( + const ConsentRequestParameters& params) { + if (RequestConsentInfoUpdateLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentRequestErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnRequestConsentInfoUpdate); + JNIEnv* env = GetJNIEnv(); + + jlong future_handle = static_cast(handle.get().id()); + jboolean tag_for_under_age_of_consent = + params.tag_for_under_age_of_consent ? JNI_TRUE : JNI_FALSE; + jint debug_geography = AndroidDebugGeographyFromCppDebugGeography( + params.debug_settings.debug_geography); + jobject debug_device_ids_list = + util::StdVectorToJavaList(env, params.debug_settings.debug_device_ids); + env->CallVoidMethod(helper_, + consent_info_helper::GetMethodId( + consent_info_helper::kRequestConsentInfoUpdate), + future_handle, tag_for_under_age_of_consent, + debug_geography, debug_device_ids_list); + + if (env->ExceptionCheck()) { + std::string exception_message = util::GetAndClearExceptionMessage(env); + CompleteFuture(handle, kConsentRequestErrorInternal, + exception_message.c_str()); + } else { + has_requested_consent_info_update_ = true; + } + env->DeleteLocalRef(debug_device_ids_list); + + return MakeFuture(futures(), handle); +} + +ConsentStatus ConsentInfoInternalAndroid::GetConsentStatus() { + if (!valid()) { + return kConsentStatusUnknown; + } + JNIEnv* env = GetJNIEnv(); + jint result = env->CallIntMethod( + helper_, + consent_info_helper::GetMethodId(consent_info_helper::kGetConsentStatus)); + if (env->ExceptionCheck()) { + util::CheckAndClearJniExceptions(env); + return kConsentStatusUnknown; + } + return CppConsentStatusFromAndroid(result); +} + +ConsentFormStatus ConsentInfoInternalAndroid::GetConsentFormStatus() { + if (!valid() || !has_requested_consent_info_update_) { + return kConsentFormStatusUnknown; + } + JNIEnv* env = GetJNIEnv(); + jboolean is_available = env->CallBooleanMethod( + helper_, consent_info_helper::GetMethodId( + consent_info_helper::kIsConsentFormAvailable)); + if (env->ExceptionCheck()) { + util::CheckAndClearJniExceptions(env); + return kConsentFormStatusUnknown; + } + return (is_available == JNI_FALSE) ? kConsentFormStatusUnavailable + : kConsentFormStatusAvailable; +} + +Future ConsentInfoInternalAndroid::LoadConsentForm() { + if (LoadConsentFormLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + + SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadConsentForm); + JNIEnv* env = GetJNIEnv(); + jlong future_handle = static_cast(handle.get().id()); + + env->CallVoidMethod( + helper_, + consent_info_helper::GetMethodId(consent_info_helper::kLoadConsentForm), + future_handle); + if (env->ExceptionCheck()) { + std::string exception_message = util::GetAndClearExceptionMessage(env); + CompleteFuture(handle, kConsentFormErrorInternal, + exception_message.c_str()); + } + return MakeFuture(futures(), handle); +} + +Future ConsentInfoInternalAndroid::ShowConsentForm(FormParent parent) { + if (ShowConsentFormLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + + SafeFutureHandle handle = CreateFuture(kConsentInfoFnShowConsentForm); + JNIEnv* env = GetJNIEnv(); + + jlong future_handle = static_cast(handle.get().id()); + jboolean success = env->CallBooleanMethod( + helper_, + consent_info_helper::GetMethodId(consent_info_helper::kShowConsentForm), + future_handle, parent); + if (env->ExceptionCheck()) { + std::string exception_message = util::GetAndClearExceptionMessage(env); + CompleteFuture(handle, kConsentFormErrorInternal, + exception_message.c_str()); + } else if (success == JNI_FALSE) { + CompleteFuture( + handle, kConsentFormErrorUnavailable, + "The consent form is unavailable. Please call LoadConsentForm and " + "ensure it completes successfully before calling ShowConsentForm."); + } + return MakeFuture(futures(), handle); +} + +Future ConsentInfoInternalAndroid::LoadAndShowConsentFormIfRequired( + FormParent parent) { + if (LoadAndShowConsentFormIfRequiredLastResult().status() == + kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnLoadAndShowConsentFormIfRequired); + + JNIEnv* env = GetJNIEnv(); + jlong future_handle = static_cast(handle.get().id()); + + env->CallVoidMethod( + helper_, + consent_info_helper::GetMethodId( + consent_info_helper::kLoadAndShowConsentFormIfRequired), + future_handle, parent); + if (env->ExceptionCheck()) { + std::string exception_message = util::GetAndClearExceptionMessage(env); + CompleteFuture(handle, kConsentFormErrorInternal, + exception_message.c_str()); + } + + return MakeFuture(futures(), handle); +} + +PrivacyOptionsRequirementStatus +ConsentInfoInternalAndroid::GetPrivacyOptionsRequirementStatus() { + if (!valid()) { + return kPrivacyOptionsRequirementStatusUnknown; + } + JNIEnv* env = GetJNIEnv(); + jint result = env->CallIntMethod( + helper_, consent_info_helper::GetMethodId( + consent_info_helper::kGetPrivacyOptionsRequirementStatus)); + return CppPrivacyOptionsRequirementStatusFromAndroid(result); +} + +Future ConsentInfoInternalAndroid::ShowPrivacyOptionsForm( + FormParent parent) { + if (ShowPrivacyOptionsFormLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + + SafeFutureHandle handle = + CreateFuture(kConsentInfoFnShowPrivacyOptionsForm); + + JNIEnv* env = GetJNIEnv(); + jlong future_handle = static_cast(handle.get().id()); + + env->CallVoidMethod(helper_, + consent_info_helper::GetMethodId( + consent_info_helper::kShowPrivacyOptionsForm), + future_handle, parent); + if (env->ExceptionCheck()) { + std::string exception_message = util::GetAndClearExceptionMessage(env); + CompleteFuture(handle, kConsentFormErrorInternal, + exception_message.c_str()); + } + + return MakeFuture(futures(), handle); +} + +bool ConsentInfoInternalAndroid::CanRequestAds() { + JNIEnv* env = GetJNIEnv(); + jboolean can_request = env->CallBooleanMethod( + helper_, + consent_info_helper::GetMethodId(consent_info_helper::kCanRequestAds)); + if (env->ExceptionCheck()) { + util::CheckAndClearJniExceptions(env); + return false; + } + return (can_request == JNI_FALSE) ? false : true; +} + +void ConsentInfoInternalAndroid::Reset() { + JNIEnv* env = GetJNIEnv(); + env->CallVoidMethod( + helper_, consent_info_helper::GetMethodId(consent_info_helper::kReset)); + util::CheckAndClearJniExceptions(env); +} + +JNIEnv* ConsentInfoInternalAndroid::GetJNIEnv() { + return firebase::util::GetThreadsafeJNIEnv(java_vm_); +} +jobject ConsentInfoInternalAndroid::activity() { return activity_; } + +void ConsentInfoInternalAndroid::CompleteFutureFromJniCallback( + JNIEnv* env, jint future_fn, FutureHandleId handle_id, int java_error_code, + const char* error_message) { + if (!futures()->ValidFuture(handle_id)) { + // This future is no longer valid, so no need to complete it. + return; + } + if (future_fn < 0 || future_fn >= enums().function_count) { + // Called with an invalid function ID, ignore this callback. + return; + } + FutureHandle raw_handle(handle_id); + SafeFutureHandle handle(raw_handle); + if (future_fn == enums().function_request_consent_info_update) { + // RequestConsentInfoUpdate uses the ConsentRequestError enum. + ConsentRequestError error_code = CppConsentRequestErrorFromAndroidFormError( + java_error_code, error_message); + CompleteFuture(handle, error_code, error_message); + } else { + // All other methods use the ConsentFormError enum. + ConsentFormError error_code = + CppConsentFormErrorFromAndroidFormError(java_error_code, error_message); + CompleteFuture(handle, error_code, error_message); + } +} + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase diff --git a/gma/src/android/ump/consent_info_internal_android.h b/gma/src/android/ump/consent_info_internal_android.h new file mode 100644 index 0000000000..4c0498671f --- /dev/null +++ b/gma/src/android/ump/consent_info_internal_android.h @@ -0,0 +1,132 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_GMA_SRC_ANDROID_UMP_CONSENT_INFO_INTERNAL_ANDROID_H_ +#define FIREBASE_GMA_SRC_ANDROID_UMP_CONSENT_INFO_INTERNAL_ANDROID_H_ + +#include + +#include "app/src/util_android.h" +#include "firebase/internal/mutex.h" +#include "gma/src/common/ump/consent_info_internal.h" + +namespace firebase { +namespace gma { +namespace ump { +namespace internal { + +class ConsentInfoInternalAndroid : public ConsentInfoInternal { + public: + ConsentInfoInternalAndroid(JNIEnv* env, jobject activity); + ~ConsentInfoInternalAndroid() override; + + ConsentStatus GetConsentStatus() override; + ConsentFormStatus GetConsentFormStatus() override; + + Future RequestConsentInfoUpdate( + const ConsentRequestParameters& params) override; + Future LoadConsentForm() override; + Future ShowConsentForm(FormParent parent) override; + + Future LoadAndShowConsentFormIfRequired(FormParent parent) override; + + PrivacyOptionsRequirementStatus GetPrivacyOptionsRequirementStatus() override; + Future ShowPrivacyOptionsForm(FormParent parent) override; + + bool CanRequestAds() override; + + void Reset() override; + + bool valid() { return (helper_ != nullptr); } + + JNIEnv* GetJNIEnv(); + jobject activity(); + + private: + struct EnumCache { + jint consentstatus_unknown; + jint consentstatus_required; + jint consentstatus_not_required; + jint consentstatus_obtained; + + jint formerror_success; + jint formerror_internal; + jint formerror_network; + jint formerror_invalid_operation; + jint formerror_timeout; + + jint debug_geography_disabled; + jint debug_geography_eea; + jint debug_geography_not_eea; + + jint privacy_options_requirement_unknown; + jint privacy_options_requirement_required; + jint privacy_options_requirement_not_required; + + jint function_request_consent_info_update; + jint function_load_consent_form; + jint function_show_consent_form; + jint function_load_and_show_consent_form_if_required; + jint function_show_privacy_options_form; + jint function_count; + }; + + // JNI native method callback for ConsentInfoHelper.completeFuture. + // Calls CompleteFutureFromJniCallback() below. + static void JNI_ConsentInfoHelper_completeFuture( + JNIEnv* env, jclass clazz, jint future_fn, + jlong consent_info_internal_ptr, jlong future_handle, jint error_code, + jobject error_message_obj); + + // Complete the given Future when called from JNI. + void CompleteFutureFromJniCallback(JNIEnv* env, jint future_fn, + FutureHandleId handle_id, int error_code, + const char* error_message); + + // Cache Java enum field values in the struct below. + void CacheEnumValues(JNIEnv* env); + + // Enum conversion methods. + ConsentStatus CppConsentStatusFromAndroid(jint status); + PrivacyOptionsRequirementStatus CppPrivacyOptionsRequirementStatusFromAndroid( + jint status); + jint AndroidDebugGeographyFromCppDebugGeography(ConsentDebugGeography geo); + ConsentRequestError CppConsentRequestErrorFromAndroidFormError( + jint error, const char* message = nullptr); + ConsentFormError CppConsentFormErrorFromAndroidFormError( + jint error, const char* message = nullptr); + + const EnumCache& enums() { return enums_; } + + static ConsentInfoInternalAndroid* s_instance; + static firebase::Mutex s_instance_mutex; + + EnumCache enums_; + + JavaVM* java_vm_; + jobject activity_; + jobject helper_; + + // Needed for GetConsentFormStatus to return Unknown. + bool has_requested_consent_info_update_; +}; + +} // namespace internal +} // namespace ump +} // namespace gma +} // namespace firebase + +#endif // FIREBASE_GMA_SRC_ANDROID_UMP_CONSENT_INFO_INTERNAL_ANDROID_H_ diff --git a/gma/src/common/ump/consent_info.cc b/gma/src/common/ump/consent_info.cc index 89f2ed0410..334a11d735 100644 --- a/gma/src/common/ump/consent_info.cc +++ b/gma/src/common/ump/consent_info.cc @@ -56,13 +56,12 @@ ConsentInfo* ConsentInfo::GetInstance(::firebase::InitResult* init_result_out) { ConsentInfo* consent_info = new ConsentInfo(); #if FIREBASE_PLATFORM_ANDROID - InitResult result = - consent_info->Initialize(/* jni_env, activity */); // TODO(b/291622888) + InitResult result = consent_info->Initialize(jni_env, activity); #else InitResult result = consent_info->Initialize(); #endif + if (init_result_out) *init_result_out = result; if (result != kInitResultSuccess) { - if (init_result_out) *init_result_out = result; delete consent_info; return nullptr; } @@ -85,11 +84,19 @@ ConsentInfo::~ConsentInfo() { s_instance_ = nullptr; } +#if FIREBASE_PLATFORM_ANDROID +InitResult ConsentInfo::Initialize(JNIEnv* jni_env, jobject activity) { + FIREBASE_ASSERT(!internal_); + internal_ = internal::ConsentInfoInternal::CreateInstance(jni_env, activity); + return internal_ ? kInitResultSuccess : kInitResultFailedMissingDependency; +} +#else InitResult ConsentInfo::Initialize() { FIREBASE_ASSERT(!internal_); internal_ = internal::ConsentInfoInternal::CreateInstance(); return kInitResultSuccess; } +#endif // Below this, everything is a passthrough to ConsentInfoInternal. If there is // no internal_ pointer (e.g. it's been cleaned up), return default values and diff --git a/gma/src/common/ump/consent_info_internal.h b/gma/src/common/ump/consent_info_internal.h index 88160a341c..94d87a5ec0 100644 --- a/gma/src/common/ump/consent_info_internal.h +++ b/gma/src/common/ump/consent_info_internal.h @@ -22,6 +22,11 @@ #include "firebase/future.h" #include "firebase/gma/ump.h" #include "firebase/gma/ump/types.h" +#include "firebase/internal/platform.h" + +#if FIREBASE_PLATFORM_ANDROID +#include +#endif namespace firebase { namespace gma { @@ -44,7 +49,11 @@ class ConsentInfoInternal { // Implemented in platform-specific code to instantiate a // platform-specific subclass. +#if FIREBASE_PLATFORM_ANDROID + static ConsentInfoInternal* CreateInstance(JNIEnv* jni_env, jobject activity); +#else static ConsentInfoInternal* CreateInstance(); +#endif virtual ConsentStatus GetConsentStatus() = 0; virtual ConsentFormStatus GetConsentFormStatus() = 0; diff --git a/gma/src/include/firebase/gma/ump/consent_info.h b/gma/src/include/firebase/gma/ump/consent_info.h index 32abf089f8..c092f6f8f1 100644 --- a/gma/src/include/firebase/gma/ump/consent_info.h +++ b/gma/src/include/firebase/gma/ump/consent_info.h @@ -202,8 +202,7 @@ class ConsentInfo { private: ConsentInfo(); #if FIREBASE_PLATFORM_ANDROID - // TODO(b/291622888) Implement Android-specific Initialize.. - InitResult Initialize(/* JNIEnv* jni_env, jobject activity */); + InitResult Initialize(JNIEnv* jni_env, jobject activity); #else InitResult Initialize(); #endif // FIREBASE_PLATFORM_ANDROID diff --git a/gma/src/ios/ump/consent_info_internal_ios.mm b/gma/src/ios/ump/consent_info_internal_ios.mm index 08d2a0d004..266f554328 100644 --- a/gma/src/ios/ump/consent_info_internal_ios.mm +++ b/gma/src/ios/ump/consent_info_internal_ios.mm @@ -85,6 +85,14 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { Future ConsentInfoInternalIos::RequestConsentInfoUpdate( const ConsentRequestParameters& params) { + if (RequestConsentInfoUpdateLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentRequestErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + SafeFutureHandle handle = CreateFuture(kConsentInfoFnRequestConsentInfoUpdate); @@ -162,6 +170,14 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { } Future ConsentInfoInternalIos::LoadConsentForm() { + if (LoadConsentFormLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadConsentForm); loaded_form_ = nil; @@ -191,6 +207,14 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { } Future ConsentInfoInternalIos::ShowConsentForm(FormParent parent) { + if (ShowConsentFormLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + SafeFutureHandle handle = CreateFuture(kConsentInfoFnShowConsentForm); if (!loaded_form_) { @@ -219,6 +243,15 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { Future ConsentInfoInternalIos::LoadAndShowConsentFormIfRequired( FormParent parent) { + if (LoadAndShowConsentFormIfRequiredLastResult().status() == + kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadAndShowConsentFormIfRequired); @@ -260,6 +293,14 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { } Future ConsentInfoInternalIos::ShowPrivacyOptionsForm(FormParent parent) { + if (ShowPrivacyOptionsFormLastResult().status() == kFutureStatusPending) { + // This operation is already in progress. + // Return a future with an error - this will not override the Fn entry. + SafeFutureHandle error_handle = CreateFuture(); + CompleteFuture(error_handle, kConsentFormErrorOperationInProgress); + return MakeFuture(futures(), error_handle); + } + SafeFutureHandle handle = CreateFuture(kConsentInfoFnShowPrivacyOptionsForm); util::DispatchAsyncSafeMainQueue(^{ diff --git a/gma/src_java/com/google/firebase/gma/internal/cpp/ConsentInfoHelper.java b/gma/src_java/com/google/firebase/gma/internal/cpp/ConsentInfoHelper.java new file mode 100644 index 0000000000..4b2bf1852b --- /dev/null +++ b/gma/src_java/com/google/firebase/gma/internal/cpp/ConsentInfoHelper.java @@ -0,0 +1,312 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.gma.internal.cpp; + +import android.app.Activity; +import android.content.Context; +import android.util.Log; +import com.google.android.ump.ConsentDebugSettings; +import com.google.android.ump.ConsentForm; +import com.google.android.ump.ConsentForm.OnConsentFormDismissedListener; +import com.google.android.ump.ConsentInformation; +import com.google.android.ump.ConsentInformation.OnConsentInfoUpdateFailureListener; +import com.google.android.ump.ConsentInformation.OnConsentInfoUpdateSuccessListener; +import com.google.android.ump.ConsentInformation.PrivacyOptionsRequirementStatus; +import com.google.android.ump.ConsentRequestParameters; +import com.google.android.ump.FormError; +import com.google.android.ump.UserMessagingPlatform; +import com.google.android.ump.UserMessagingPlatform.OnConsentFormLoadFailureListener; +import com.google.android.ump.UserMessagingPlatform.OnConsentFormLoadSuccessListener; +import java.util.ArrayList; + +/** + * Helper class to make interactions between the GMA UMP C++ wrapper and the Android UMP API. + */ +public class ConsentInfoHelper { + // C++ nullptr for use with the callbacks. + private static final long CPP_NULLPTR = 0; + + // Synchronization object for thread safe access to: + private final Object mLock = new Object(); + // Pointer to the internal ConsentInfoInternalAndroid C++ object. + // This can be reset back to 0 by calling disconnect(). + private long mInternalPtr = 0; + // The Activity that this was initialized with. + private Activity mActivity = null; + // The loaded consent form, if any. + private ConsentForm mConsentForm = null; + + // Create our own local passthrough version of these enum object values + // as integers, to make it easier for the C++ SDK to access them. + public static final int PRIVACY_OPTIONS_REQUIREMENT_UNKNOWN = + PrivacyOptionsRequirementStatus.UNKNOWN.ordinal(); + public static final int PRIVACY_OPTIONS_REQUIREMENT_REQUIRED = + PrivacyOptionsRequirementStatus.REQUIRED.ordinal(); + public static final int PRIVACY_OPTIONS_REQUIREMENT_NOT_REQUIRED = + PrivacyOptionsRequirementStatus.NOT_REQUIRED.ordinal(); + + // Enum values for tracking which function we are calling back. + // Ensure these are incremental starting at 0. + // These don't have to match ConsentInfoFn, as the C++ code will + // use these Java enums directly. + public static final int FUNCTION_REQUEST_CONSENT_INFO_UPDATE = 0; + public static final int FUNCTION_LOAD_CONSENT_FORM = 1; + public static final int FUNCTION_SHOW_CONSENT_FORM = 2; + public static final int FUNCTION_LOAD_AND_SHOW_CONSENT_FORM_IF_REQUIRED = 3; + public static final int FUNCTION_SHOW_PRIVACY_OPTIONS_FORM = 4; + public static final int FUNCTION_COUNT = 5; + + public ConsentInfoHelper(long consentInfoInternalPtr, Activity activity) { + synchronized (mLock) { + mInternalPtr = consentInfoInternalPtr; + mActivity = activity; + // Test the callbacks and fail quickly if something's wrong. + completeFuture(-1, CPP_NULLPTR, CPP_NULLPTR, 0, null); + } + } + + public int getConsentStatus() { + ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(mActivity); + return consentInfo.getConsentStatus(); + } + + public void requestConsentInfoUpdate(final long futureHandle, boolean tagForUnderAgeOfConsent, + int debugGeography, ArrayList debugIdList) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + } + final int functionId = FUNCTION_REQUEST_CONSENT_INFO_UPDATE; + + ConsentDebugSettings.Builder debugSettingsBuilder = null; + + // Only create and use debugSettingsBuilder if a debug option is set. + if (debugGeography != ConsentDebugSettings.DebugGeography.DEBUG_GEOGRAPHY_DISABLED) { + debugSettingsBuilder = + new ConsentDebugSettings.Builder(mActivity).setDebugGeography(debugGeography); + } + if (debugIdList != null && debugIdList.size() > 0) { + if (debugSettingsBuilder == null) { + debugSettingsBuilder = new ConsentDebugSettings.Builder(mActivity); + } + for (int i = 0; i < debugIdList.size(); i++) { + debugSettingsBuilder = debugSettingsBuilder.addTestDeviceHashedId(debugIdList.get(i)); + } + } + ConsentRequestParameters.Builder paramsBuilder = + new ConsentRequestParameters.Builder().setTagForUnderAgeOfConsent(tagForUnderAgeOfConsent); + + if (debugSettingsBuilder != null) { + paramsBuilder = paramsBuilder.setConsentDebugSettings(debugSettingsBuilder.build()); + } + + final ConsentRequestParameters params = paramsBuilder.build(); + + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(mActivity); + consentInfo.requestConsentInfoUpdate(mActivity, params, + new OnConsentInfoUpdateSuccessListener() { + @Override + public void onConsentInfoUpdateSuccess() { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + completeFuture(functionId, mInternalPtr, futureHandle, 0, null); + } + } + }, + new OnConsentInfoUpdateFailureListener() { + @Override + public void onConsentInfoUpdateFailure(FormError formError) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + completeFuture(functionId, mInternalPtr, futureHandle, formError.getErrorCode(), + formError.getMessage()); + } + } + }); + } + }); + } + + public void loadConsentForm(final long futureHandle) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + } + final int functionId = FUNCTION_LOAD_CONSENT_FORM; + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + UserMessagingPlatform.loadConsentForm(mActivity, + new OnConsentFormLoadSuccessListener() { + @Override + public void onConsentFormLoadSuccess(ConsentForm form) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + mConsentForm = form; + completeFuture(functionId, mInternalPtr, futureHandle, 0, null); + } + } + }, + new OnConsentFormLoadFailureListener() { + @Override + public void onConsentFormLoadFailure(FormError formError) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + mConsentForm = null; + completeFuture(functionId, mInternalPtr, futureHandle, formError.getErrorCode(), + formError.getMessage()); + } + } + }); + } + }); + } + + public boolean showConsentForm(final long futureHandle, final Activity activity) { + synchronized (mLock) { + if (mInternalPtr == 0) + return false; + } + final int functionId = FUNCTION_SHOW_CONSENT_FORM; + ConsentForm consentForm; + synchronized (mLock) { + if (mConsentForm == null) { + // Consent form was not loaded, return an error. + return false; + } + consentForm = mConsentForm; + mConsentForm = null; + } + final ConsentForm consentFormForThread = consentForm; + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + consentFormForThread.show(activity, new OnConsentFormDismissedListener() { + @Override + public void onConsentFormDismissed(FormError formError) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + if (formError == null) { + completeFuture(functionId, mInternalPtr, futureHandle, 0, null); + } else { + completeFuture(functionId, mInternalPtr, futureHandle, formError.getErrorCode(), + formError.getMessage()); + } + } + } + }); + } + }); + // Consent form is loaded. + return true; + } + + public void loadAndShowConsentFormIfRequired(final long futureHandle, final Activity activity) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + } + final int functionId = FUNCTION_LOAD_AND_SHOW_CONSENT_FORM_IF_REQUIRED; + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + UserMessagingPlatform.loadAndShowConsentFormIfRequired( + activity, new OnConsentFormDismissedListener() { + @Override + public void onConsentFormDismissed(FormError formError) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + if (formError == null) { + completeFuture(functionId, mInternalPtr, futureHandle, 0, null); + } else { + completeFuture(functionId, mInternalPtr, futureHandle, formError.getErrorCode(), + formError.getMessage()); + } + } + } + }); + } + }); + } + + public int getPrivacyOptionsRequirementStatus() { + ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(mActivity); + return consentInfo.getPrivacyOptionsRequirementStatus().ordinal(); + } + + public void showPrivacyOptionsForm(final long futureHandle, final Activity activity) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + } + final int functionId = FUNCTION_SHOW_PRIVACY_OPTIONS_FORM; + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + UserMessagingPlatform.showPrivacyOptionsForm( + activity, new OnConsentFormDismissedListener() { + @Override + public void onConsentFormDismissed(FormError formError) { + synchronized (mLock) { + if (mInternalPtr == 0) + return; + if (formError == null) { + completeFuture(functionId, mInternalPtr, futureHandle, 0, null); + } else { + completeFuture(functionId, mInternalPtr, futureHandle, formError.getErrorCode(), + formError.getMessage()); + } + } + } + }); + } + }); + } + + public boolean canRequestAds() { + ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(mActivity); + return consentInfo.canRequestAds(); + } + + public boolean isConsentFormAvailable() { + ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(mActivity); + return consentInfo.isConsentFormAvailable(); + } + + public void reset() { + ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(mActivity); + consentInfo.reset(); + } + + /** Disconnect the helper from the native object. */ + public void disconnect() { + synchronized (mLock) { + mInternalPtr = CPP_NULLPTR; + } + } + public static native void completeFuture( + int futureFn, long nativeInternalPtr, long futureHandle, int errorCode, String errorMessage); +} diff --git a/messaging/messaging_java/build.gradle b/messaging/messaging_java/build.gradle index 9a2126f779..6b2fccefc9 100644 --- a/messaging/messaging_java/build.gradle +++ b/messaging/messaging_java/build.gradle @@ -81,6 +81,14 @@ afterEvaluate { 'https://github.com/google/flatbuffers.git', flatbuffersDir } + exec { + executable 'git' + args 'apply', + '../../scripts/git/patches/flatbuffers/0001-remove-unused-var.patch', + '--verbose', + '--directory', + 'messaging/messaging_java/build/flatbuffers' + } } // Locate or build flatc. diff --git a/release_build_files/Android/firebase_dependencies.gradle b/release_build_files/Android/firebase_dependencies.gradle index 8d6fa09c28..cd5244449f 100644 --- a/release_build_files/Android/firebase_dependencies.gradle +++ b/release_build_files/Android/firebase_dependencies.gradle @@ -27,7 +27,8 @@ def firebaseDependenciesMap = [ 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'], 'firestore' : ['com.google.firebase:firebase-firestore'], 'functions' : ['com.google.firebase:firebase-functions'], - 'gma' : ['com.google.android.gms:play-services-ads:22.3.0'], + 'gma' : ['com.google.android.gms:play-services-ads:22.3.0', + 'com.google.android.ump:user-messaging-platform:2.1.0'], 'installations' : ['com.google.firebase:firebase-installations'], 'invites' : ['com.google.firebase:firebase-invites'], // Messaging has an additional local dependency to include. diff --git a/testing/test_framework/src/android/android_firebase_test_framework.cc b/testing/test_framework/src/android/android_firebase_test_framework.cc index 03513c0924..8c37eec1a1 100644 --- a/testing/test_framework/src/android/android_firebase_test_framework.cc +++ b/testing/test_framework/src/android/android_firebase_test_framework.cc @@ -268,8 +268,56 @@ int FirebaseTest::GetGooglePlayServicesVersion() { } std::string FirebaseTest::GetDebugDeviceId() { - // TODO(jsimantov): Add this for Android. - return "placeholder-device-id"; + static char* device_id = nullptr; + if (!device_id) { + JNIEnv* env = app_framework::GetJniEnv(); + jobject activity = app_framework::GetActivity(); + jclass test_helper_class = app_framework::FindClass( + env, activity, "com/google/firebase/example/TestHelper"); + if (env->ExceptionCheck()) { + LogError("Couldn't find TestHelper class"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return ""; + } + jmethodID get_id = + env->GetStaticMethodID(test_helper_class, "getDebugDeviceId", + "(Landroid/content/Context;)Ljava/lang/String;"); + + if (env->ExceptionCheck()) { + LogError("Couldn't look up getDebugDeviceId method"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return ""; + } + jobject device_id_obj = + env->CallStaticObjectMethod(test_helper_class, get_id, activity); + if (env->ExceptionCheck()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + return ""; + } + jstring device_id_jstring = static_cast(device_id_obj); + const char* device_id_text = + env->GetStringUTFChars(device_id_jstring, nullptr); + + if (env->ExceptionCheck()) { + LogError("Couldn't get debug device ID"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return ""; + } + device_id = new char[strlen(device_id_text) + 1]; + strcpy(device_id, device_id_text); // NOLINT + + env->ReleaseStringUTFChars(device_id_jstring, device_id_text); + env->DeleteLocalRef(device_id_jstring); + if (env->ExceptionCheck()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } + } + return device_id; } } // namespace firebase_test_framework diff --git a/testing/test_framework/src/android/java/com/google/firebase/example/TestHelper.java b/testing/test_framework/src/android/java/com/google/firebase/example/TestHelper.java index f2fb23d5ea..36151b6b65 100644 --- a/testing/test_framework/src/android/java/com/google/firebase/example/TestHelper.java +++ b/testing/test_framework/src/android/java/com/google/firebase/example/TestHelper.java @@ -14,12 +14,18 @@ package com.google.firebase.example; +import android.content.ContentResolver; import android.content.Context; import android.os.Build; +import android.provider.Settings; import android.util.Log; import java.lang.Class; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Collection; /** * A simple class with test helper methods. @@ -58,4 +64,28 @@ public static int getGooglePlayServicesVersion(Context context) { } return 0; } + + private static String md5(String message) { + String result = null; + if (message == null || message.length() == 0) + return ""; + try { + MessageDigest md5 = MessageDigest.getInstance("MD5"); + md5.update(message.getBytes(), 0, message.length()); + result = String.format("%032X", new BigInteger(1, md5.digest())); + } catch (NoSuchAlgorithmException ex) { + result = ""; + } catch (ArithmeticException ex) { + return ""; + } + return result; + } + + public static String getDebugDeviceId(Context context) { + ContentResolver contentResolver = context.getContentResolver(); + if (contentResolver == null) { + return "error"; + } + return md5(Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)); + } } From 1a8c017bd45b6358331eb4309bec473c5400ba19 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Wed, 27 Sep 2023 10:53:04 -0700 Subject: [PATCH 09/13] Merge main into UMP feature branch 9/21 (#1454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae98f767c45f0a402fc9492bf6cc2ce55885. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d48d28c52352f5e40640831934ff6921e4e. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Jon Simantov Co-authored-by: almostmatt@google.com * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang * Update merge-to-main script (#1420) * Before creating the merge-main PR, branch it off main, so merge conflicts can be addressed in the branch rather than by committing to main. * Format. * Update release version number for M135, 11.4.0 (#1421) * feat(auth): enable emulator support on desktop (#1423) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change --------- Co-authored-by: Cynthia Jiang * Internal Updates. (#1422) * Add logic to trim webp parameter from native image urls * Add Analytics function for on-device conversion (#1429) * Add Analytics function for phone number conversion * Formatting * Update analytics.h * Update analytics_test.cc * Update mobile dependencies - Tue Aug 29 2023 (#1436) * Update mobile dependencies - Tue Aug 29 2023 ### Android - com.google.android.gms.play_services_ads → 22.3.0 - com.google.firebase.firebase_bom → 32.2.3 ### iOS - Firebase/Analytics → 10.14.0 - Firebase/AppCheck → 10.14.0 - Firebase/Auth → 10.14.0 - Firebase/Core → 10.14.0 - Firebase/CoreOnly → 10.14.0 - Firebase/Crashlytics → 10.14.0 - Firebase/Database → 10.14.0 - Firebase/DynamicLinks → 10.14.0 - Firebase/Firestore → 10.14.0 - Firebase/Functions → 10.14.0 - Firebase/Installations → 10.14.0 - Firebase/Messaging → 10.14.0 - Firebase/RemoteConfig → 10.14.0 - Firebase/Storage → 10.14.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6016988287). * Update query_main to use normalized_order_bys * Update query_main.cc --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: a-maurice * add UseEmulator api to auth (#1437) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change * remove platform logging v1 code * add useEmulator api * test with emulator * clean up for review * tweak for review * update with comments * put back necessary heartbeat blocks --------- Co-authored-by: Cynthia Jiang * On Android, set dynamic code files to readonly (#1430) * To address an Android 14 security issue, set dex files to readonly. This follows the advice on dynamic code loading here: https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading * Format code. * Reorder exception check so that we cover all the spots. * Add release note. * Update iOS dependencies - Tue Sep 12 2023 (#1443) ### iOS - Firebase/Analytics → 10.15.0 - Firebase/AppCheck → 10.15.0 - Firebase/Auth → 10.15.0 - Firebase/Core → 10.15.0 - Firebase/CoreOnly → 10.15.0 - Firebase/Crashlytics → 10.15.0 - Firebase/Database → 10.15.0 - Firebase/DynamicLinks → 10.15.0 - Firebase/Firestore → 10.15.0 - Firebase/Functions → 10.15.0 - Firebase/Installations → 10.15.0 - Firebase/Messaging → 10.15.0 - Firebase/RemoteConfig → 10.15.0 - Firebase/Storage → 10.15.0 - Google-Mobile-Ads-SDK → 10.10.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6164028143). Co-authored-by: firebase-workflow-trigger-bot * Apply unused variables patch to Flatbuffers on Android as well. (#1444) Already applied on desktop elsewhere. * Fix iOS test version from deprecate 16.5 to 16.6. (#1449) * Update Android dependencies - Mon Sep 18 2023 (#1448) * Update release version to 11.5.0. * Update readme. * Update Android dependencies - Mon Sep 18 2023 ### Android - com.google.android.gms.play_services_ads → 22.4.0 - com.google.firebase.firebase_bom → 32.3.1 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6226059256). * Add note about GMA Android. * Revert play-services-ads to 22.3.0. --------- Co-authored-by: Jon Simantov Co-authored-by: firebase-workflow-trigger-bot * Add a matrix label to FTL test runs, to make sorting them easier. (#1452) * Add a matrix label to FTL test runs, to make sorting them easier. * Fix label for iOS --------- Co-authored-by: Tom Andersen Co-authored-by: Matthew Hyndman Co-authored-by: a-maurice Co-authored-by: Saleem Abdulrasool Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Cynthia J Co-authored-by: Cynthia Jiang Co-authored-by: nakirekommula <126601200+nakirekommula@users.noreply.github.com> --- .github/workflows/integration_tests.yml | 2 + Android/firebase_dependencies.gradle | 2 +- analytics/integration_test/Podfile | 4 +- analytics/ios_headers/FIREventNames.h | 2 +- analytics/ios_headers/FIRParameterNames.h | 2 +- analytics/ios_headers/FIRUserPropertyNames.h | 2 +- app/app_resources/build.gradle | 2 +- app/google_api_resources/build.gradle | 2 +- app/integration_test/Podfile | 2 +- app/invites_resources/build.gradle | 2 +- app/src/util_android.cc | 26 ++++++ app/src/util_android.h | 4 + app_check/app_check_resources/build.gradle | 2 +- app_check/integration_test/Podfile | 20 ++--- auth/auth_resources/build.gradle | 2 +- auth/integration_test/Podfile | 4 +- cmake/external/firestore.cmake | 2 +- cpp_sdk_version.json | 6 +- database/database_resources/build.gradle | 2 +- database/integration_test/Podfile | 8 +- dynamic_links/integration_test/Podfile | 2 +- firestore/firestore_resources/build.gradle | 2 +- firestore/integration_test/Podfile | 8 +- firestore/integration_test_internal/Podfile | 8 +- functions/integration_test/Podfile | 8 +- gma/gma_resources/build.gradle | 2 +- gma/integration_test/Podfile | 4 +- installations/integration_test/Podfile | 4 +- ios_pod/Podfile | 30 +++---- .../FirebaseAnalyticsSwift-Swift.h | 4 +- .../FirebaseCoreInternal-Swift.h | 4 +- .../FirebaseDatabaseSwift-Swift.h | 4 +- .../FirebaseFirestoreSwift-Swift.h | 4 +- .../swift_headers/FirebaseFunctions-Swift.h | 4 +- .../FirebaseInAppMessagingSwift-Swift.h | 4 +- .../FirebaseMLModelDownloader-Swift.h | 4 +- .../FirebaseRemoteConfigSwift-Swift.h | 4 +- .../swift_headers/FirebaseSharedSwift-Swift.h | 4 +- ios_pod/swift_headers/FirebaseStorage-Swift.h | 4 +- ios_pod/swift_headers/SwiftProtobuf-Swift.h | 4 +- messaging/integration_test/Podfile | 4 +- messaging/messaging_java/build.gradle | 2 +- .../Android/firebase_dependencies.gradle | 2 +- release_build_files/readme.md | 80 ++++++++++--------- remote_config/integration_test/Podfile | 4 +- .../remote_config_resources/build.gradle | 2 +- scripts/gha/print_matrix_configuration.py | 2 +- storage/integration_test/Podfile | 8 +- storage/storage_resources/build.gradle | 2 +- 49 files changed, 178 insertions(+), 138 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 22daa2be7a..21435fca16 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -1046,6 +1046,7 @@ jobs: test_devices: ${{ steps.device-info.outputs.device }} max_attempts: 3 validator: ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py + additional_flags: '--client-details matrixLabel=android-${{ github.run_id }}-${{ matrix.build_os }}-${{ matrix.android_device }}' - name: Read FTL Test Result if: ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }} shell: bash @@ -1189,6 +1190,7 @@ jobs: test_devices: ${{ steps.device-info.outputs.device }} max_attempts: 3 validator: ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py + additional_flags: '--client-details matrixLabel=ios-${{ github.run_id }}-${{ matrix.build_os }}-${{ matrix.ios_device }}' - name: Read FTL Test Result if: ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }} shell: bash diff --git a/Android/firebase_dependencies.gradle b/Android/firebase_dependencies.gradle index 1ae4a4674d..601fa3ad6a 100644 --- a/Android/firebase_dependencies.gradle +++ b/Android/firebase_dependencies.gradle @@ -159,7 +159,7 @@ project.afterEvaluate { // Add the bill-of-materials project.dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') } for (String lib : firebaseCpp.dependencies.libSet) { // Generate and include the proguard file diff --git a/analytics/integration_test/Podfile b/analytics/integration_test/Podfile index 1f559b860b..42a7f29b62 100644 --- a/analytics/integration_test/Podfile +++ b/analytics/integration_test/Podfile @@ -5,12 +5,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Analytics', '10.14.0' + pod 'Firebase/Analytics', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Analytics', '10.14.0' + pod 'Firebase/Analytics', '10.15.0' end post_install do |installer| diff --git a/analytics/ios_headers/FIREventNames.h b/analytics/ios_headers/FIREventNames.h index 539cec6c64..2c5a36af7e 100644 --- a/analytics/ios_headers/FIREventNames.h +++ b/analytics/ios_headers/FIREventNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.14.0. +// Copied from Firebase Analytics iOS SDK 10.15.0. /// @file FIREventNames.h /// diff --git a/analytics/ios_headers/FIRParameterNames.h b/analytics/ios_headers/FIRParameterNames.h index 9906ae0924..f60ae421c1 100644 --- a/analytics/ios_headers/FIRParameterNames.h +++ b/analytics/ios_headers/FIRParameterNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.14.0. +// Copied from Firebase Analytics iOS SDK 10.15.0. /// @file FIRParameterNames.h /// diff --git a/analytics/ios_headers/FIRUserPropertyNames.h b/analytics/ios_headers/FIRUserPropertyNames.h index a836839559..fce0bfa4e2 100644 --- a/analytics/ios_headers/FIRUserPropertyNames.h +++ b/analytics/ios_headers/FIRUserPropertyNames.h @@ -1,6 +1,6 @@ // Copyright 2023 Google LLC -// Copied from Firebase Analytics iOS SDK 10.14.0. +// Copied from Firebase Analytics iOS SDK 10.15.0. /// @file FIRUserPropertyNames.h /// diff --git a/app/app_resources/build.gradle b/app/app_resources/build.gradle index 0e2e67eb90..ae1c95e847 100644 --- a/app/app_resources/build.gradle +++ b/app/app_resources/build.gradle @@ -50,7 +50,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' } diff --git a/app/google_api_resources/build.gradle b/app/google_api_resources/build.gradle index 7179f73249..629f8ecf69 100644 --- a/app/google_api_resources/build.gradle +++ b/app/google_api_resources/build.gradle @@ -53,7 +53,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-base:18.2.0' implementation project(':app:app_resources') diff --git a/app/integration_test/Podfile b/app/integration_test/Podfile index 004068168c..030a579e3f 100644 --- a/app/integration_test/Podfile +++ b/app/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/Analytics', '10.14.0' + pod 'Firebase/Analytics', '10.15.0' end post_install do |installer| diff --git a/app/invites_resources/build.gradle b/app/invites_resources/build.gradle index bb867b88c0..27031a758b 100644 --- a/app/invites_resources/build.gradle +++ b/app/invites_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-dynamic-links' implementation project(':app:app_resources') diff --git a/app/src/util_android.cc b/app/src/util_android.cc index 1ece3f1797..678c0452ee 100644 --- a/app/src/util_android.cc +++ b/app/src/util_android.cc @@ -1587,12 +1587,33 @@ const std::vector& CacheEmbeddedFiles( file::GetClass(), file::GetMethodId(file::kConstructorFilePath), cache_dir, filename); env->DeleteLocalRef(filename); + CheckAndClearJniExceptions(env); + // Below, we would have set the file read only on a previous run. Here, set + // it to writable and then delete it before creating it again. + // + // if output_file.exists() { + if (env->CallBooleanMethod(output_file, file::GetMethodId(file::kExists))) { + CheckAndClearJniExceptions(env); + // output_file.setWritable(true); + env->CallBooleanMethod(output_file, file::GetMethodId(file::kSetWritable), + JNI_TRUE); + CheckAndClearJniExceptions(env); + // output_file.delete(); + env->CallBooleanMethod(output_file, file::GetMethodId(file::kDelete)); + CheckAndClearJniExceptions(env); + } jobject output_stream = env->NewObject( file_output_stream::GetClass(), file_output_stream::GetMethodId(file_output_stream::kConstructorFile), output_file); bool failed = CheckAndClearJniExceptions(env); if (!failed) { + // Android 14 requires that we set the open dex file to readonly BEFORE + // writing code to it. + jboolean did_set_readonly = env->CallBooleanMethod( + output_file, file::GetMethodId(file::kSetReadOnly)); + // If it failed, move on and try again later after closing the file. + if (CheckAndClearJniExceptions(env)) did_set_readonly = JNI_FALSE; jobject output_array = env->NewByteArray(it->size); env->SetByteArrayRegion(static_cast(output_array), 0, it->size, @@ -1605,6 +1626,11 @@ const std::vector& CacheEmbeddedFiles( env->CallVoidMethod(output_stream, file_output_stream::GetMethodId( file_output_stream::kClose)); failed |= CheckAndClearJniExceptions(env); + if (!did_set_readonly) { + env->CallBooleanMethod(output_file, + file::GetMethodId(file::kSetReadOnly)); + util::CheckAndClearJniExceptions(env); + } env->DeleteLocalRef(output_array); env->DeleteLocalRef(output_stream); } diff --git a/app/src/util_android.h b/app/src/util_android.h index 722e81bbe0..6cfeae5acf 100644 --- a/app/src/util_android.h +++ b/app/src/util_android.h @@ -568,6 +568,10 @@ METHOD_LOOKUP_DECLARATION(intent, INTENT_METHODS); X(ConstructorFilePath, "", "(Ljava/io/File;Ljava/lang/String;)V"), \ X(GetAbsolutePath, "getAbsolutePath", "()Ljava/lang/String;"), \ X(GetPath, "getPath", "()Ljava/lang/String;"), \ + X(Exists, "exists", "()Z"), \ + X(Delete, "delete", "()Z"), \ + X(SetReadOnly, "setReadOnly", "()Z"), \ + X(SetWritable, "setWritable", "(Z)Z"), \ X(ToUri, "toURI", "()Ljava/net/URI;") // clang-format on METHOD_LOOKUP_DECLARATION(file, FILE_METHODS) diff --git a/app_check/app_check_resources/build.gradle b/app_check/app_check_resources/build.gradle index 5826312c0a..6eba43dc42 100644 --- a/app_check/app_check_resources/build.gradle +++ b/app_check/app_check_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-appcheck' } diff --git a/app_check/integration_test/Podfile b/app_check/integration_test/Podfile index 8d33fe3857..84bcca180a 100644 --- a/app_check/integration_test/Podfile +++ b/app_check/integration_test/Podfile @@ -4,20 +4,20 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/AppCheck', '10.14.0' - pod 'Firebase/Database', '10.14.0' - pod 'Firebase/Auth', '10.14.0' - pod 'Firebase/Storage', '10.14.0' - pod 'Firebase/Functions', '10.14.0' + pod 'Firebase/AppCheck', '10.15.0' + pod 'Firebase/Database', '10.15.0' + pod 'Firebase/Auth', '10.15.0' + pod 'Firebase/Storage', '10.15.0' + pod 'Firebase/Functions', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/AppCheck', '10.14.0' - pod 'Firebase/Database', '10.14.0' - pod 'Firebase/Auth', '10.14.0' - pod 'Firebase/Storage', '10.14.0' - pod 'Firebase/Functions', '10.14.0' + pod 'Firebase/AppCheck', '10.15.0' + pod 'Firebase/Database', '10.15.0' + pod 'Firebase/Auth', '10.15.0' + pod 'Firebase/Storage', '10.15.0' + pod 'Firebase/Functions', '10.15.0' end post_install do |installer| diff --git a/auth/auth_resources/build.gradle b/auth/auth_resources/build.gradle index 6fce36e3c4..392128769e 100644 --- a/auth/auth_resources/build.gradle +++ b/auth/auth_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-auth' implementation project(':app:app_resources') diff --git a/auth/integration_test/Podfile b/auth/integration_test/Podfile index 9e0f830af9..2498fe55b1 100644 --- a/auth/integration_test/Podfile +++ b/auth/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Auth', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Auth', '10.15.0' end post_install do |installer| diff --git a/cmake/external/firestore.cmake b/cmake/external/firestore.cmake index 825dab88f4..a7076d075d 100644 --- a/cmake/external/firestore.cmake +++ b/cmake/external/firestore.cmake @@ -20,7 +20,7 @@ endif() # If the format of the line below changes, then be sure to update # https://github.com/firebase/firebase-cpp-sdk/blob/fd054fa016/.github/workflows/update-dependencies.yml#L81 -set(version CocoaPods-10.14.0) +set(version CocoaPods-10.15.0) function(GetReleasedDep) message("Getting released firebase-ios-sdk @ ${version}") diff --git a/cpp_sdk_version.json b/cpp_sdk_version.json index 0eb24cc9c4..68cb6cd9e8 100644 --- a/cpp_sdk_version.json +++ b/cpp_sdk_version.json @@ -1,5 +1,5 @@ { - "released": "11.4.0", - "stable": "11.4.0", - "head": "11.4.0" + "released": "11.5.0", + "stable": "11.5.0", + "head": "11.5.0" } diff --git a/database/database_resources/build.gradle b/database/database_resources/build.gradle index 6e4e81f191..54c3a74ebb 100644 --- a/database/database_resources/build.gradle +++ b/database/database_resources/build.gradle @@ -45,7 +45,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-database' //implementation project(':app:app_resources') diff --git a/database/integration_test/Podfile b/database/integration_test/Podfile index 29649fd9a7..d46bac178d 100644 --- a/database/integration_test/Podfile +++ b/database/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Database', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Database', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Database', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Database', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end post_install do |installer| diff --git a/dynamic_links/integration_test/Podfile b/dynamic_links/integration_test/Podfile index 2fa773d205..306206be5d 100644 --- a/dynamic_links/integration_test/Podfile +++ b/dynamic_links/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/DynamicLinks', '10.14.0' + pod 'Firebase/DynamicLinks', '10.15.0' end post_install do |installer| diff --git a/firestore/firestore_resources/build.gradle b/firestore/firestore_resources/build.gradle index cbd73238e0..33e5738460 100644 --- a/firestore/firestore_resources/build.gradle +++ b/firestore/firestore_resources/build.gradle @@ -53,7 +53,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-firestore' } diff --git a/firestore/integration_test/Podfile b/firestore/integration_test/Podfile index 174654f54d..9f936452c2 100644 --- a/firestore/integration_test/Podfile +++ b/firestore/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Firestore', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Firestore', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Firestore', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end post_install do |installer| diff --git a/firestore/integration_test_internal/Podfile b/firestore/integration_test_internal/Podfile index 374efd97c7..8e15b4dc8c 100644 --- a/firestore/integration_test_internal/Podfile +++ b/firestore/integration_test_internal/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Firestore', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Firestore', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Firestore', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end post_install do |installer| diff --git a/functions/integration_test/Podfile b/functions/integration_test/Podfile index 04bd164eec..f3b0bf9c77 100644 --- a/functions/integration_test/Podfile +++ b/functions/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Functions', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Functions', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Functions', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Functions', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end post_install do |installer| diff --git a/gma/gma_resources/build.gradle b/gma/gma_resources/build.gradle index d79977e4a0..22ae76f5fd 100644 --- a/gma/gma_resources/build.gradle +++ b/gma/gma_resources/build.gradle @@ -50,7 +50,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-ads:22.3.0' implementation 'com.google.android.ump:user-messaging-platform:2.1.0' diff --git a/gma/integration_test/Podfile b/gma/integration_test/Podfile index d01f3826b1..f0056c5936 100644 --- a/gma/integration_test/Podfile +++ b/gma/integration_test/Podfile @@ -4,8 +4,8 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/CoreOnly', '10.14.0' - pod 'Google-Mobile-Ads-SDK', '10.9.0' + pod 'Firebase/CoreOnly', '10.15.0' + pod 'Google-Mobile-Ads-SDK', '10.10.0' pod 'GoogleUserMessagingPlatform', '2.1.0' end diff --git a/installations/integration_test/Podfile b/installations/integration_test/Podfile index 3a330ec187..cf9a0fac39 100644 --- a/installations/integration_test/Podfile +++ b/installations/integration_test/Podfile @@ -4,8 +4,8 @@ platform :ios, '11.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/Analytics', '10.14.0' - pod 'Firebase/Installations', '10.14.0' + pod 'Firebase/Analytics', '10.15.0' + pod 'Firebase/Installations', '10.15.0' end post_install do |installer| diff --git a/ios_pod/Podfile b/ios_pod/Podfile index 22771e2081..afed9324b6 100644 --- a/ios_pod/Podfile +++ b/ios_pod/Podfile @@ -3,19 +3,21 @@ platform :ios, '11.0' use_frameworks! target 'GetPods' do - pod 'Firebase/Core', '10.14.0' - pod 'Google-Mobile-Ads-SDK', '10.9.0' + pod 'Firebase/Core', '10.15.0' + + pod 'Google-Mobile-Ads-SDK', '10.10.0' pod 'GoogleUserMessagingPlatform', '2.1.0' - pod 'Firebase/Analytics', '10.14.0' - pod 'Firebase/AppCheck', '10.14.0' - pod 'Firebase/Auth', '10.14.0' - pod 'Firebase/Crashlytics', '10.14.0' - pod 'Firebase/Database', '10.14.0' - pod 'Firebase/DynamicLinks', '10.14.0' - pod 'Firebase/Firestore', '10.14.0' - pod 'Firebase/Functions', '10.14.0' - pod 'Firebase/Installations', '10.14.0' - pod 'Firebase/Messaging', '10.14.0' - pod 'Firebase/RemoteConfig', '10.14.0' - pod 'Firebase/Storage', '10.14.0' + pod 'Firebase/Analytics', '10.15.0' + pod 'Firebase/AppCheck', '10.15.0' + pod 'Firebase/Auth', '10.15.0' + pod 'Firebase/Crashlytics', '10.15.0' + pod 'Firebase/Database', '10.15.0' + pod 'Firebase/DynamicLinks', '10.15.0' + pod 'Firebase/Firestore', '10.15.0' + pod 'Firebase/Functions', '10.15.0' + pod 'Firebase/Installations', '10.15.0' + pod 'Firebase/Messaging', '10.15.0' + pod 'Firebase/RemoteConfig', '10.15.0' + pod 'Firebase/Storage', '10.15.0' + end diff --git a/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h b/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h index df3530cbde..13d9f74b4d 100644 --- a/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseAnalyticsSwift-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -288,7 +288,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h b/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h index 65e8219511..f9efa9bd4c 100644 --- a/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h +++ b/ios_pod/swift_headers/FirebaseCoreInternal-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -345,7 +345,7 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h b/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h index bc4894cb40..adb0e2cfa9 100644 --- a/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseDatabaseSwift-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -289,7 +289,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h b/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h index 2ef87db1c4..fdea7dcb7c 100644 --- a/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseFirestoreSwift-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -289,7 +289,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseFunctions-Swift.h b/ios_pod/swift_headers/FirebaseFunctions-Swift.h index 3cf7c4903e..25e474279f 100644 --- a/ios_pod/swift_headers/FirebaseFunctions-Swift.h +++ b/ios_pod/swift_headers/FirebaseFunctions-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -569,7 +569,7 @@ SWIFT_CLASS_NAMED("HTTPSCallableResult") #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h b/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h index b94db175a2..c4d9d5152f 100644 --- a/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseInAppMessagingSwift-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -289,7 +289,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h b/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h index 44cbf57192..a1b322280b 100644 --- a/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h +++ b/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -289,7 +289,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h b/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h index a232180d4a..29b645af98 100644 --- a/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseRemoteConfigSwift-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -289,7 +289,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h b/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h index 2841ae0927..b6498d35f3 100644 --- a/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h +++ b/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -288,7 +288,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/FirebaseStorage-Swift.h b/ios_pod/swift_headers/FirebaseStorage-Swift.h index daa70f3bdc..5e93c2ab3f 100644 --- a/ios_pod/swift_headers/FirebaseStorage-Swift.h +++ b/ios_pod/swift_headers/FirebaseStorage-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -940,7 +940,7 @@ SWIFT_CLASS_NAMED("StorageUploadTask") #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/ios_pod/swift_headers/SwiftProtobuf-Swift.h b/ios_pod/swift_headers/SwiftProtobuf-Swift.h index 8c7bd8ec0f..973c5274e1 100644 --- a/ios_pod/swift_headers/SwiftProtobuf-Swift.h +++ b/ios_pod/swift_headers/SwiftProtobuf-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) @@ -288,7 +288,7 @@ using UInt = size_t; #elif defined(__x86_64__) && __x86_64__ // Copyright 2023 Google LLC -// Copied from Firebase iOS SDK 10.14.0. +// Copied from Firebase iOS SDK 10.15.0. // Generated by Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 // clang-1400.0.29.51) diff --git a/messaging/integration_test/Podfile b/messaging/integration_test/Podfile index e7cead4e9a..22d8899915 100644 --- a/messaging/integration_test/Podfile +++ b/messaging/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Messaging', '10.14.0' + pod 'Firebase/Messaging', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Messaging', '10.14.0' + pod 'Firebase/Messaging', '10.15.0' end post_install do |installer| diff --git a/messaging/messaging_java/build.gradle b/messaging/messaging_java/build.gradle index 6b2fccefc9..4ec8598643 100644 --- a/messaging/messaging_java/build.gradle +++ b/messaging/messaging_java/build.gradle @@ -55,7 +55,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-messaging' implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0' diff --git a/release_build_files/Android/firebase_dependencies.gradle b/release_build_files/Android/firebase_dependencies.gradle index cd5244449f..0e4c71a3af 100644 --- a/release_build_files/Android/firebase_dependencies.gradle +++ b/release_build_files/Android/firebase_dependencies.gradle @@ -132,7 +132,7 @@ project.afterEvaluate { // Add the bill-of-materials project.dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') } for (String lib : firebaseCpp.dependencies.libSet) { // Messaging includes an aar, which to be depended on properly requires diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 2a6ed8bd31..6e0680c9b8 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -86,7 +86,7 @@ distributed as part of the core Firebase Feature | Required Libraries and Gradle Packages -------------------------- | -------------------------------------- -All Firebase SDKs | platform(com.google.firebase:firebase-bom:32.2.3) +All Firebase SDKs | platform(com.google.firebase:firebase-bom:32.3.1) | | (Android Bill of Materials) Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a @@ -147,7 +147,7 @@ Firebase Messaging | libfirebase_messaging.a | | com.google.firebase:firebase-messaging | | (Maven package) | | libmessaging_java.jar (Android service) -| | androidx.core:core:1.10.1 (Maven package) +| | androidx.core:core:1.12.0 (Maven package) Firebase Realtime Database | libfirebase_database.a | | libfirebase_auth.a | | libfirebase_app.a @@ -228,49 +228,49 @@ Feature | Required Frameworks and Cocoapods -------------------------- | --------------------------------------- Firebase Analytics | firebase_analytics.xcframework | | firebase.xcframework -| | Firebase/Analytics Cocoapod (10.14.0) +| | Firebase/Analytics Cocoapod (10.15.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.14.0) +| | Firebase/AppCheck Cocoapod (10.15.0) Firebase Authentication | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.15.0) Firebase Dynamic Links | firebase_dynamic_links.xcframework | | firebase.xcframework -| | Firebase/DynamicLinks Cocoapod (10.14.0) +| | Firebase/DynamicLinks Cocoapod (10.15.0) Cloud Firestore | firebase_firestore.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Firestore Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Firestore Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Firebase Functions | firebase_functions.xcframework | | firebase_auth.xcframework (optional) | | firebase.xcframework -| | Firebase/Functions Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Functions Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Google Mobile Ads | firebase_gma.xcframework | | firebase.xcframework -| | Firebase/CoreOnly Cocoapod (10.14.0) -| | Google-Mobile-Ads-SDK Cocoapod (10.9.0) +| | Firebase/CoreOnly Cocoapod (10.15.0) +| | Google-Mobile-Ads-SDK Cocoapod (10.10.0) Firebase Installations | firebase_installations.xcframework | | firebase.xcframework -| | FirebaseInstallations Cocoapod (10.14.0) +| | FirebaseInstallations Cocoapod (10.15.0) Firebase Cloud Messaging | firebase_messaging.xcframework | | firebase.xcframework -| | Firebase/Messaging Cocoapod (10.14.0) +| | Firebase/Messaging Cocoapod (10.15.0) Firebase Realtime Database | firebase_database.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Database Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Database Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Firebase Remote Config | firebase_remote_config.xcframework | | firebase.xcframework -| | Firebase/RemoteConfig Cocoapod (10.14.0) +| | Firebase/RemoteConfig Cocoapod (10.15.0) Firebase Storage | firebase_storage.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Storage Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Storage Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Important: Each version of the Firebase C++ SDK supports a specific version of the Firebase iOS SDK. Please ensure that you reference the Cocoapod versions @@ -290,49 +290,49 @@ Feature | Required Libraries and Cocoapods -------------------------- | ----------------------------------------- Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a -| | Firebase/Analytics Cocoapod (10.14.0) +| | Firebase/Analytics Cocoapod (10.15.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.14.0) +| | Firebase/AppCheck Cocoapod (10.15.0) Firebase Authentication | libfirebase_auth.a | | libfirebase_app.a -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Auth Cocoapod (10.15.0) Firebase Dynamic Links | libfirebase_dynamic_links.a | | libfirebase_app.a -| | Firebase/DynamicLinks Cocoapod (10.14.0) +| | Firebase/DynamicLinks Cocoapod (10.15.0) Cloud Firestore | libfirebase_firestore.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Firestore Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Firestore Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Firebase Functions | libfirebase_functions.a | | libfirebase_app.a | | libfirebase_auth.a (optional) -| | Firebase/Functions Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Functions Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Google Mobile Ads | libfirebase_gma.a | | libfirebase_app.a -| | Firebase/CoreOnly Cocoapod (10.14.0) -| | Google-Mobile-Ads-SDK Cocoapod (10.9.0) +| | Firebase/CoreOnly Cocoapod (10.15.0) +| | Google-Mobile-Ads-SDK Cocoapod (10.10.0) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a -| | FirebaseInstallations Cocoapod (10.14.0) +| | FirebaseInstallations Cocoapod (10.15.0) Firebase Cloud Messaging | libfirebase_messaging.a | | libfirebase_app.a -| | Firebase/CloudMessaging Cocoapod (10.14.0) +| | Firebase/CloudMessaging Cocoapod (10.15.0) Firebase Realtime Database | libfirebase_database.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Database Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Database Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Firebase Remote Config | libfirebase_remote_config.a | | libfirebase_app.a -| | Firebase/RemoteConfig Cocoapod (10.14.0) +| | Firebase/RemoteConfig Cocoapod (10.15.0) Firebase Storage | libfirebase_storage.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Storage Cocoapod (10.14.0) -| | Firebase/Auth Cocoapod (10.14.0) +| | Firebase/Storage Cocoapod (10.15.0) +| | Firebase/Auth Cocoapod (10.15.0) Important: Each version of the Firebase C++ SDK supports a specific version of the Firebase iOS SDK. Please ensure that you reference the Cocoapod versions @@ -627,14 +627,20 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes -### Next Release +### 11.5.0 - Changes + - General (iOS): Update to Firebase Cocoapods version 10.15.0. + - General (Android): Update to Firebase Android BoM version 32.3.1. + - General (Android): Made dynamic code files read only to comply with new + Android 14 security requirements. This fixes a crash at API level 34+. - Analytics (iOS): Added InitiateOnDeviceConversionMeasurementWithPhoneNumber function to facilitate the [on-device conversion measurement](https://support.google.com/google-ads/answer/12119136) API. - Auth: Add Firebase Auth Emulator support. Set the environment variable USE_AUTH_EMULATOR=yes (and optionally AUTH_EMULATOR_PORT, default 9099) to connect to the local Firebase Auth Emulator. + - GMA (iOS): Updated dependency to Google-Mobile-Ads-SDK version 10.10.0. + - GMA (Android): Updated dependency to play-services-ads version 22.3.0. ### 11.4.0 - Changes diff --git a/remote_config/integration_test/Podfile b/remote_config/integration_test/Podfile index 68736f86ec..17ecdff389 100644 --- a/remote_config/integration_test/Podfile +++ b/remote_config/integration_test/Podfile @@ -4,12 +4,12 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/RemoteConfig', '10.14.0' + pod 'Firebase/RemoteConfig', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/RemoteConfig', '10.14.0' + pod 'Firebase/RemoteConfig', '10.15.0' end post_install do |installer| diff --git a/remote_config/remote_config_resources/build.gradle b/remote_config/remote_config_resources/build.gradle index 5a091ace7c..598fffaa07 100644 --- a/remote_config/remote_config_resources/build.gradle +++ b/remote_config/remote_config_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-config' } diff --git a/scripts/gha/print_matrix_configuration.py b/scripts/gha/print_matrix_configuration.py index 1f73fdf9d4..82aaf8ef9b 100644 --- a/scripts/gha/print_matrix_configuration.py +++ b/scripts/gha/print_matrix_configuration.py @@ -174,7 +174,7 @@ "emulator_32bit": {"type": "virtual", "image":"system-images;android-30;google_apis;x86"}, "ios_min": {"type": "ftl", "device": "model=iphone8,version=14.7"}, "ios_target": {"type": "ftl", "device": "model=iphone13pro,version=15.7"}, - "ios_latest": {"type": "ftl", "device": "model=iphone11pro,version=16.5"}, + "ios_latest": {"type": "ftl", "device": "model=iphone11pro,version=16.6"}, "simulator_min": {"type": "virtual", "name":"iPhone 8", "version":"15.2"}, "simulator_target": {"type": "virtual", "name":"iPhone 8", "version":"16.1"}, "simulator_latest": {"type": "virtual", "name":"iPhone 11", "version":"16.1"}, diff --git a/storage/integration_test/Podfile b/storage/integration_test/Podfile index 799c9fd8a8..4429d53b76 100644 --- a/storage/integration_test/Podfile +++ b/storage/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '11.0' - pod 'Firebase/Storage', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Storage', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end target 'integration_test_tvos' do platform :tvos, '12.0' - pod 'Firebase/Storage', '10.14.0' - pod 'Firebase/Auth', '10.14.0' + pod 'Firebase/Storage', '10.15.0' + pod 'Firebase/Auth', '10.15.0' end post_install do |installer| diff --git a/storage/storage_resources/build.gradle b/storage/storage_resources/build.gradle index 17ec453219..dccf04d517 100644 --- a/storage/storage_resources/build.gradle +++ b/storage/storage_resources/build.gradle @@ -49,7 +49,7 @@ android { } dependencies { - implementation platform('com.google.firebase:firebase-bom:32.2.3') + implementation platform('com.google.firebase:firebase-bom:32.3.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-storage' } From 7a68b0d87ff61b7c28113becc0c154486170e375 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 Oct 2023 13:10:19 -0700 Subject: [PATCH 10/13] Merge main into UMP feature branch and update readme (#1458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae98f767c45f0a402fc9492bf6cc2ce55885. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d48d28c52352f5e40640831934ff6921e4e. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Jon Simantov Co-authored-by: almostmatt@google.com * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang * Update merge-to-main script (#1420) * Before creating the merge-main PR, branch it off main, so merge conflicts can be addressed in the branch rather than by committing to main. * Format. * Update release version number for M135, 11.4.0 (#1421) * feat(auth): enable emulator support on desktop (#1423) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change --------- Co-authored-by: Cynthia Jiang * Internal Updates. (#1422) * Add logic to trim webp parameter from native image urls * Add Analytics function for on-device conversion (#1429) * Add Analytics function for phone number conversion * Formatting * Update analytics.h * Update analytics_test.cc * Update mobile dependencies - Tue Aug 29 2023 (#1436) * Update mobile dependencies - Tue Aug 29 2023 ### Android - com.google.android.gms.play_services_ads → 22.3.0 - com.google.firebase.firebase_bom → 32.2.3 ### iOS - Firebase/Analytics → 10.14.0 - Firebase/AppCheck → 10.14.0 - Firebase/Auth → 10.14.0 - Firebase/Core → 10.14.0 - Firebase/CoreOnly → 10.14.0 - Firebase/Crashlytics → 10.14.0 - Firebase/Database → 10.14.0 - Firebase/DynamicLinks → 10.14.0 - Firebase/Firestore → 10.14.0 - Firebase/Functions → 10.14.0 - Firebase/Installations → 10.14.0 - Firebase/Messaging → 10.14.0 - Firebase/RemoteConfig → 10.14.0 - Firebase/Storage → 10.14.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6016988287). * Update query_main to use normalized_order_bys * Update query_main.cc --------- Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: a-maurice * add UseEmulator api to auth (#1437) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` * make json request always do restrict json * add readme info * prepare for review * some minor tweak * code format * update review comments * update the unit test after request json change * remove platform logging v1 code * add useEmulator api * test with emulator * clean up for review * tweak for review * update with comments * put back necessary heartbeat blocks --------- Co-authored-by: Cynthia Jiang * On Android, set dynamic code files to readonly (#1430) * To address an Android 14 security issue, set dex files to readonly. This follows the advice on dynamic code loading here: https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading * Format code. * Reorder exception check so that we cover all the spots. * Add release note. * Update iOS dependencies - Tue Sep 12 2023 (#1443) ### iOS - Firebase/Analytics → 10.15.0 - Firebase/AppCheck → 10.15.0 - Firebase/Auth → 10.15.0 - Firebase/Core → 10.15.0 - Firebase/CoreOnly → 10.15.0 - Firebase/Crashlytics → 10.15.0 - Firebase/Database → 10.15.0 - Firebase/DynamicLinks → 10.15.0 - Firebase/Firestore → 10.15.0 - Firebase/Functions → 10.15.0 - Firebase/Installations → 10.15.0 - Firebase/Messaging → 10.15.0 - Firebase/RemoteConfig → 10.15.0 - Firebase/Storage → 10.15.0 - Google-Mobile-Ads-SDK → 10.10.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6164028143). Co-authored-by: firebase-workflow-trigger-bot * Apply unused variables patch to Flatbuffers on Android as well. (#1444) Already applied on desktop elsewhere. * Fix iOS test version from deprecate 16.5 to 16.6. (#1449) * Update Android dependencies - Mon Sep 18 2023 (#1448) * Update release version to 11.5.0. * Update readme. * Update Android dependencies - Mon Sep 18 2023 ### Android - com.google.android.gms.play_services_ads → 22.4.0 - com.google.firebase.firebase_bom → 32.3.1 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/6226059256). * Add note about GMA Android. * Revert play-services-ads to 22.3.0. --------- Co-authored-by: Jon Simantov Co-authored-by: firebase-workflow-trigger-bot * Add a matrix label to FTL test runs, to make sorting them easier. (#1452) * Add a matrix label to FTL test runs, to make sorting them easier. * Fix label for iOS * OR Query Implementation (#1453) * OR Query Implementation * Pretty * Add includes * Fix from PR feedback * Fix variadic parameters * Add and fix tests * Add/fix method descriptions. * Add/fix constructor and class descriptions. * Add method description to disjunction/conjunction. * Add tests. Revealed bugs to be fixed. * Fix type * Add test * Android implementation * Pretty * Pretty * Pretty * Remove const * Pretty * Fixes from code review * Release notes * Release notes * Fix Android OR Query * Release notes. * Fix release notes. * Format * Internal Updates (#1439) * Internal Updates * Revert firestore to main. * Add additional release note. * Fix bad merge output. --------- Co-authored-by: Tom Andersen Co-authored-by: Matthew Hyndman Co-authored-by: a-maurice Co-authored-by: Saleem Abdulrasool Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot Co-authored-by: Cynthia J Co-authored-by: Cynthia Jiang Co-authored-by: nakirekommula <126601200+nakirekommula@users.noreply.github.com> --- app/CMakeLists.txt | 1 + firestore/CMakeLists.txt | 9 + .../integration_test_internal/CMakeLists.txt | 2 + .../project.pbxproj | 24 + .../src/aggregate_count_test.cc | 16 - .../src/aggregate_query_test.cc | 15 + .../src/filter_test.cc | 550 ++++++++++++++++++ firestore/src/android/filter_android.cc | 222 +++++++ firestore/src/android/filter_android.h | 89 +++ firestore/src/android/firestore_android.cc | 2 + firestore/src/android/query_android.cc | 12 +- firestore/src/android/query_android.h | 8 + firestore/src/common/filter.cc | 174 ++++++ firestore/src/common/query.cc | 11 + firestore/src/common/type_mapping.h | 6 + firestore/src/include/firebase/firestore.h | 1 + .../include/firebase/firestore/field_path.h | 1 + .../src/include/firebase/firestore/filter.h | 411 +++++++++++++ .../src/include/firebase/firestore/query.h | 23 +- firestore/src/main/composite_filter_main.cc | 70 +++ firestore/src/main/composite_filter_main.h | 66 +++ firestore/src/main/converter_main.h | 10 + firestore/src/main/filter_main.cc | 130 +++++ firestore/src/main/filter_main.h | 105 ++++ firestore/src/main/query_main.cc | 28 +- firestore/src/main/query_main.h | 2 + firestore/src/main/unary_filter_main.cc | 70 +++ firestore/src/main/unary_filter_main.h | 70 +++ gma/src/android/gma_android.cc | 19 +- gma/src/common/gma_common.cc | 6 +- gma/src/common/gma_common.h | 4 +- gma/src/common/native_ad.cc | 4 + gma/src/common/native_ad_internal.cc | 7 +- gma/src/common/native_ad_internal.h | 9 +- .../include/firebase/gma/internal/native_ad.h | 3 + gma/src/ios/GADNativeAdCpp.h | 3 + gma/src/ios/native_ad_internal_ios.mm | 12 +- .../gma/internal/cpp/NativeAdHelper.java | 14 +- release_build_files/readme.md | 21 +- 39 files changed, 2171 insertions(+), 59 deletions(-) create mode 100644 firestore/integration_test_internal/src/filter_test.cc create mode 100644 firestore/src/android/filter_android.cc create mode 100644 firestore/src/android/filter_android.h create mode 100644 firestore/src/common/filter.cc create mode 100644 firestore/src/include/firebase/firestore/filter.h create mode 100644 firestore/src/main/composite_filter_main.cc create mode 100644 firestore/src/main/composite_filter_main.h create mode 100644 firestore/src/main/filter_main.cc create mode 100644 firestore/src/main/filter_main.h create mode 100644 firestore/src/main/unary_filter_main.cc create mode 100644 firestore/src/main/unary_filter_main.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index ac52251529..544bf77fd4 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -518,6 +518,7 @@ if (IOS) ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/document_snapshot.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/field_path.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/field_value.h + ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/filter.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/listener_registration.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/load_bundle_task_progress.h ${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/map_field_value.h diff --git a/firestore/CMakeLists.txt b/firestore/CMakeLists.txt index 0cea8d1435..e3a31f3eb8 100644 --- a/firestore/CMakeLists.txt +++ b/firestore/CMakeLists.txt @@ -31,6 +31,7 @@ set(common_SRCS src/common/document_snapshot.cc src/common/exception_common.cc src/common/exception_common.h + src/common/filter.cc src/common/field_path.cc src/common/field_value.cc src/common/firestore.cc @@ -97,6 +98,8 @@ set(android_SRCS src/android/field_path_portable.h src/android/field_value_android.cc src/android/field_value_android.h + src/android/filter_android.cc + src/android/filter_android.h src/android/firestore_android.cc src/android/firestore_android.h src/android/firestore_exceptions_android.h @@ -201,6 +204,8 @@ set(main_SRCS src/main/aggregate_query_snapshot_main.h src/main/collection_reference_main.cc src/main/collection_reference_main.h + src/main/composite_filter_main.cc + src/main/composite_filter_main.h src/main/converter_main.h src/main/document_change_main.cc src/main/document_change_main.h @@ -208,6 +213,8 @@ set(main_SRCS src/main/document_reference_main.h src/main/document_snapshot_main.cc src/main/document_snapshot_main.h + src/main/filter_main.cc + src/main/filter_main.h src/main/field_value_main.cc src/main/field_value_main.h src/main/firestore_main.cc @@ -227,6 +234,8 @@ set(main_SRCS src/main/transaction_main.h src/main/user_data_converter_main.cc src/main/user_data_converter_main.h + src/main/unary_filter_main.cc + src/main/unary_filter_main.h src/main/util_main.h src/main/write_batch_main.cc src/main/write_batch_main.h) diff --git a/firestore/integration_test_internal/CMakeLists.txt b/firestore/integration_test_internal/CMakeLists.txt index 791500961a..8e651e75cd 100644 --- a/firestore/integration_test_internal/CMakeLists.txt +++ b/firestore/integration_test_internal/CMakeLists.txt @@ -91,6 +91,7 @@ set(FIREBASE_INTEGRATION_TEST_PORTABLE_TEST_SRCS # public API are performed. src/integration_test.cc # Internal tests below. + src/aggregate_count_test.cc src/aggregate_query_snapshot_test.cc src/aggregate_query_test.cc src/bundle_test.cc @@ -99,6 +100,7 @@ set(FIREBASE_INTEGRATION_TEST_PORTABLE_TEST_SRCS src/document_change_test.cc src/document_reference_test.cc src/document_snapshot_test.cc + src/filter_test.cc src/field_value_test.cc src/fields_test.cc src/firestore_test.cc diff --git a/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj b/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj index 4fc6d0ca75..415b4bcff8 100644 --- a/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj +++ b/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj @@ -21,6 +21,14 @@ 12CCF1E928FDBD9F00C24941 /* set_options_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12CCF1DF28FDBD9F00C24941 /* set_options_test.cc */; }; 12D513142684C8C200A83FAA /* bundle_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12D513132684C8C200A83FAA /* bundle_test.cc */; }; 12D5131A2684C8D100A83FAA /* bundle_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 12D513182684C8D100A83FAA /* bundle_builder.cc */; }; + 1BAFACA32A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */; }; + 1BAFACA42A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */; }; + 1BAFACA52A449C2B00834979 /* aggregate_count_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */; }; + 1BAFACA62A449C2B00834979 /* aggregate_count_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */; }; + 1BAFACA72A449C2B00834979 /* aggregate_query_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */; }; + 1BAFACA82A449C2B00834979 /* aggregate_query_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */; }; + 1BAFACAA2A449CBD00834979 /* filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA92A449CBD00834979 /* filter_test.cc */; }; + 1BAFACAB2A449CBD00834979 /* filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BAFACA92A449CBD00834979 /* filter_test.cc */; }; 520BC0391C869159008CFBC3 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 520BC0381C869159008CFBC3 /* GoogleService-Info.plist */; }; 5270BB448DF5ECE860FDD68B /* firebase_firestore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAFAF9474EC412ADCC65F2CC /* firebase_firestore.framework */; }; 529226D61C85F68000C89379 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 529226D51C85F68000C89379 /* Foundation.framework */; }; @@ -123,6 +131,10 @@ 12D513182684C8D100A83FAA /* bundle_builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bundle_builder.cc; path = src/util/bundle_builder.cc; sourceTree = ""; }; 12D513192684C8D100A83FAA /* bundle_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bundle_builder.h; path = src/util/bundle_builder.h; sourceTree = ""; }; 1B3D64B35A22073C76B376D5 /* libPods-integration_test_tvos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-integration_test_tvos.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_query_snapshot_test.cc; path = src/aggregate_query_snapshot_test.cc; sourceTree = ""; }; + 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_count_test.cc; path = src/aggregate_count_test.cc; sourceTree = ""; }; + 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aggregate_query_test.cc; path = src/aggregate_query_test.cc; sourceTree = ""; }; + 1BAFACA92A449CBD00834979 /* filter_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = filter_test.cc; path = src/filter_test.cc; sourceTree = ""; }; 3DE393E827F88B06CD3C39CD /* Pods-integration_test_tvos.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-integration_test_tvos.release.xcconfig"; path = "Target Support Files/Pods-integration_test_tvos/Pods-integration_test_tvos.release.xcconfig"; sourceTree = ""; }; 4AAFA3E3DA9641C2E3C46C9D /* Pods_integration_test.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_integration_test.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 520BC0381C869159008CFBC3 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; @@ -281,6 +293,10 @@ 5292271D1C85FB5500C89379 /* src */ = { isa = PBXGroup; children = ( + 1BAFACA92A449CBD00834979 /* filter_test.cc */, + 1BAFACA12A449C2B00834979 /* aggregate_count_test.cc */, + 1BAFACA02A449C2B00834979 /* aggregate_query_snapshot_test.cc */, + 1BAFACA22A449C2B00834979 /* aggregate_query_test.cc */, 12CCF1DF28FDBD9F00C24941 /* set_options_test.cc */, 12CCF1DB28FDBD9E00C24941 /* settings_test.cc */, 12CCF1DC28FDBD9F00C24941 /* source_test.cc */, @@ -576,12 +592,14 @@ D62CCBC022F367140099BE9F /* gmock-all.cc in Sources */, D61CFBC126091C3B0035CB2A /* integration_test.cc in Sources */, D6AAAD532606C22D0025C53B /* includes_test.cc in Sources */, + 1BAFACA52A449C2B00834979 /* aggregate_count_test.cc in Sources */, D6AAAD502606C22D0025C53B /* numeric_transforms_test.cc in Sources */, D6ED33BE2606CD890058CBF9 /* integration_test_util.cc in Sources */, D6C179EA22CB322900C2651A /* ios_firebase_test_framework.mm in Sources */, 12CCF1E228FDBD9F00C24941 /* source_test.cc in Sources */, D6AAAD4C2606C22D0025C53B /* server_timestamp_test.cc in Sources */, D6AAAD4E2606C22D0025C53B /* firestore_test.cc in Sources */, + 1BAFACAA2A449CBD00834979 /* filter_test.cc in Sources */, D6AAAD452606C22D0025C53B /* document_change_test.cc in Sources */, D6AAAD472606C22D0025C53B /* document_snapshot_test.cc in Sources */, D6C179E922CB322900C2651A /* ios_app_framework.mm in Sources */, @@ -591,7 +609,9 @@ EDEEC7632800CD0000EFBAAF /* leveldb_snappy_test.cc in Sources */, 12CCF1E828FDBD9F00C24941 /* set_options_test.cc in Sources */, D6AAAD562606C22D0025C53B /* query_network_test.cc in Sources */, + 1BAFACA72A449C2B00834979 /* aggregate_query_test.cc in Sources */, D6AAAD552606C22D0025C53B /* listener_registration_test.cc in Sources */, + 1BAFACA32A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */, 12D5131A2684C8D100A83FAA /* bundle_builder.cc in Sources */, D6AAAD4A2606C22D0025C53B /* fields_test.cc in Sources */, D6AAAD462606C22D0025C53B /* query_test.cc in Sources */, @@ -610,6 +630,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1BAFACAB2A449CBD00834979 /* filter_test.cc in Sources */, + 1BAFACA62A449C2B00834979 /* aggregate_count_test.cc in Sources */, BC1D6850267B00EB005DC2DA /* app_framework.cc in Sources */, BC1D6853267B00EB005DC2DA /* transaction_extra_test.cc in Sources */, BC1D683E267B00EB005DC2DA /* integration_test_util.cc in Sources */, @@ -623,6 +645,7 @@ BC1D6848267B00EB005DC2DA /* sanity_test.cc in Sources */, 12CCF1E728FDBD9F00C24941 /* write_batch_test.cc in Sources */, 12CCF1E128FDBD9F00C24941 /* settings_test.cc in Sources */, + 1BAFACA82A449C2B00834979 /* aggregate_query_test.cc in Sources */, BC1D6856267B00EE005DC2DA /* ios_app_framework.mm in Sources */, BC1D6843267B00EB005DC2DA /* numeric_transforms_test.cc in Sources */, BC1D6844267B00EB005DC2DA /* array_transform_test.cc in Sources */, @@ -632,6 +655,7 @@ BC1D684E267B00EB005DC2DA /* includes_test.cc in Sources */, BC1D684C267B00EB005DC2DA /* document_change_test.cc in Sources */, BC1D6851267B00EB005DC2DA /* firestore_integration_test.cc in Sources */, + 1BAFACA42A449C2B00834979 /* aggregate_query_snapshot_test.cc in Sources */, BC1D6838267B00EB005DC2DA /* future_test_util.cc in Sources */, 12CCF1E528FDBD9F00C24941 /* validation_test.cc in Sources */, BC1D6839267B00EB005DC2DA /* type_test.cc in Sources */, diff --git a/firestore/integration_test_internal/src/aggregate_count_test.cc b/firestore/integration_test_internal/src/aggregate_count_test.cc index dc58961fc3..7f3f462a1f 100644 --- a/firestore/integration_test_internal/src/aggregate_count_test.cc +++ b/firestore/integration_test_internal/src/aggregate_count_test.cc @@ -28,15 +28,9 @@ #include "firestore_integration_test.h" #include "util/event_accumulator.h" -#if defined(__ANDROID__) -#include "firestore/src/android/query_android.h" -#include "firestore/src/common/wrapper_assertions.h" -#endif // defined(__ANDROID__) - #include "Firestore/core/src/util/firestore_exceptions.h" #include "firebase/firestore/firestore_errors.h" #include "firebase_test_framework.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" namespace firebase { @@ -757,15 +751,5 @@ TEST_F(AggregateCountTest, EXPECT_EQ(aggregate_query2, aggregate_snapshot2.query()); } -#if defined(__ANDROID__) -TEST(QueryTestAndroidStub, Construction) { - testutil::AssertWrapperConstructionContract(); -} - -TEST(QueryTestAndroidStub, Assignment) { - testutil::AssertWrapperAssignmentContract(); -} -#endif // defined(__ANDROID__) - } // namespace firestore } // namespace firebase diff --git a/firestore/integration_test_internal/src/aggregate_query_test.cc b/firestore/integration_test_internal/src/aggregate_query_test.cc index 4a52be9790..4810e5e96f 100644 --- a/firestore/integration_test_internal/src/aggregate_query_test.cc +++ b/firestore/integration_test_internal/src/aggregate_query_test.cc @@ -17,6 +17,11 @@ #include "firebase/firestore.h" #include "firestore_integration_test.h" +#if defined(__ANDROID__) +#include "firestore/src/android/aggregate_query_android.h" +#include "firestore/src/common/wrapper_assertions.h" +#endif // defined(__ANDROID__) + #include "gtest/gtest.h" namespace firebase { @@ -332,6 +337,16 @@ TEST_F(AggregateQueryTest, TestHashCode) { AggregateQueryHash(query1.Count())); } +#if defined(__ANDROID__) +TEST(QueryTestAndroidStub, Construction) { + testutil::AssertWrapperConstructionContract(); +} + +TEST(QueryTestAndroidStub, Assignment) { + testutil::AssertWrapperAssignmentContract(); +} +#endif // defined(__ANDROID__) + } // namespace } // namespace firestore } // namespace firebase diff --git a/firestore/integration_test_internal/src/filter_test.cc b/firestore/integration_test_internal/src/filter_test.cc new file mode 100644 index 0000000000..e3806943d0 --- /dev/null +++ b/firestore/integration_test_internal/src/filter_test.cc @@ -0,0 +1,550 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "firebase/firestore.h" +#include "firestore_integration_test.h" + +namespace firebase { +namespace firestore { +namespace { + +using FilterTest = FirestoreIntegrationTest; + +TEST_F(FilterTest, CopyConstructorReturnsEqualObject) { + const Filter filter1a = Filter::EqualTo("foo", FieldValue::Integer(42)); + const Filter filter2a = Filter::ArrayContainsAny( + "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); + const Filter filter3a = Filter::And(filter1a, filter2a); + + const Filter filter1b(filter1a); + const Filter filter2b(filter2a); + const Filter filter3b(filter3a); + + EXPECT_EQ(filter1a, filter1b); + EXPECT_EQ(filter2a, filter2b); + EXPECT_EQ(filter3a, filter3b); +} + +TEST_F(FilterTest, CopyAssignementReturnsEqualObject) { + const Filter filter1 = Filter::EqualTo("foo", FieldValue::Integer(42)); + const Filter filter2 = Filter::ArrayContainsAny( + "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); + const Filter filter3 = Filter::And(filter1, filter2); + + Filter filter = Filter::And(); + + EXPECT_NE(filter, filter1); + EXPECT_NE(filter, filter2); + EXPECT_NE(filter, filter3); + + filter = filter1; + + EXPECT_EQ(filter, filter1); + EXPECT_NE(filter, filter2); + EXPECT_NE(filter, filter3); + + filter = filter2; + + EXPECT_NE(filter, filter1); + EXPECT_EQ(filter, filter2); + EXPECT_NE(filter, filter3); + + filter = filter3; + + EXPECT_NE(filter, filter1); + EXPECT_NE(filter, filter2); + EXPECT_EQ(filter, filter3); +} + +TEST_F(FilterTest, MoveConstructorReturnsEqualObject) { + Filter filter1a = Filter::EqualTo("foo", FieldValue::Integer(42)); + Filter filter2a = Filter::ArrayContainsAny( + "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); + Filter filter3a = Filter::And(filter1a, filter2a); + + Filter filter1b(std::move(filter1a)); + EXPECT_EQ(filter1b, Filter::EqualTo("foo", FieldValue::Integer(42))); + + Filter filter2b(std::move(filter2a)); + EXPECT_EQ(filter2b, + Filter::ArrayContainsAny( + "bar", {FieldValue::Integer(4), FieldValue::Integer(2)})); + + Filter filter3b(std::move(filter3a)); + EXPECT_EQ(filter3b, Filter::And(filter1b, filter2b)); +} + +TEST_F(FilterTest, MoveAssignmentReturnsEqualObject) { + Filter filter1a = Filter::EqualTo("foo", FieldValue::Integer(42)); + Filter filter2a = Filter::ArrayContainsAny( + "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); + Filter filter3a = Filter::And(filter1a, filter2a); + + Filter filter1b = std::move(filter1a); + EXPECT_EQ(filter1b, Filter::EqualTo("foo", FieldValue::Integer(42))); + + Filter filter2b = std::move(filter2a); + EXPECT_EQ(filter2b, + Filter::ArrayContainsAny( + "bar", {FieldValue::Integer(4), FieldValue::Integer(2)})); + + Filter filter3b = std::move(filter3a); + EXPECT_EQ(filter3b, Filter::And(filter1b, filter2b)); +} + +TEST_F(FilterTest, MoveAssignmentAppliedToSelfReturnsEqualObject) { + Filter filter1 = Filter::EqualTo("foo", FieldValue::Integer(42)); + Filter filter2 = Filter::ArrayContainsAny( + "bar", {FieldValue::Integer(4), FieldValue::Integer(2)}); + Filter filter3 = Filter::And(filter1, filter2); + + filter1 = std::move(filter1); + EXPECT_EQ(filter1, Filter::EqualTo("foo", FieldValue::Integer(42))); + + filter2 = std::move(filter2); + EXPECT_EQ(filter2, Filter::ArrayContainsAny("bar", {FieldValue::Integer(4), + FieldValue::Integer(2)})); + + filter3 = std::move(filter3); + EXPECT_EQ(filter3, Filter::And(filter1, filter2)); +} + +TEST_F(FilterTest, IdenticalFilterShouldBeEqual) { + FieldPath foo_path{std::vector{"foo"}}; + + Filter filter1a = Filter::ArrayContains("foo", FieldValue::Integer(42)); + Filter filter1b = Filter::ArrayContains(foo_path, FieldValue::Integer(42)); + + Filter filter2a = Filter::ArrayContainsAny("foo", {FieldValue::Integer(42)}); + Filter filter2b = + Filter::ArrayContainsAny(foo_path, {FieldValue::Integer(42)}); + + Filter filter3a = Filter::EqualTo("foo", FieldValue::Integer(42)); + Filter filter3b = Filter::EqualTo(foo_path, FieldValue::Integer(42)); + + Filter filter4a = Filter::NotEqualTo("foo", FieldValue::Integer(42)); + Filter filter4b = Filter::NotEqualTo(foo_path, FieldValue::Integer(42)); + + Filter filter5a = Filter::GreaterThan("foo", FieldValue::Integer(42)); + Filter filter5b = Filter::GreaterThan(foo_path, FieldValue::Integer(42)); + + Filter filter6a = + Filter::GreaterThanOrEqualTo("foo", FieldValue::Integer(42)); + Filter filter6b = + Filter::GreaterThanOrEqualTo(foo_path, FieldValue::Integer(42)); + + Filter filter7a = Filter::LessThan("foo", FieldValue::Integer(42)); + Filter filter7b = Filter::LessThan(foo_path, FieldValue::Integer(42)); + + Filter filter8a = Filter::LessThanOrEqualTo("foo", FieldValue::Integer(42)); + Filter filter8b = + Filter::LessThanOrEqualTo(foo_path, FieldValue::Integer(42)); + + Filter filter9a = Filter::In("foo", {FieldValue::Integer(42)}); + Filter filter9b = Filter::In(foo_path, {FieldValue::Integer(42)}); + + Filter filter10a = Filter::NotIn("foo", {FieldValue::Integer(42)}); + Filter filter10b = Filter::NotIn(foo_path, {FieldValue::Integer(42)}); + + Filter filter11a = Filter::And(filter1a, filter2a); + Filter filter11b = Filter::And(filter1b, filter2b); + + Filter filter12a = + Filter::Or(filter3a, filter4a, filter5a, filter6a, filter7a); + Filter filter12b = + Filter::Or(filter3b, filter4b, filter5b, filter6b, filter7b); + + EXPECT_TRUE(filter1a == filter1a); + EXPECT_TRUE(filter2a == filter2a); + EXPECT_TRUE(filter3a == filter3a); + EXPECT_TRUE(filter4a == filter4a); + EXPECT_TRUE(filter5a == filter5a); + EXPECT_TRUE(filter6a == filter6a); + EXPECT_TRUE(filter7a == filter7a); + EXPECT_TRUE(filter8a == filter8a); + EXPECT_TRUE(filter9a == filter9a); + EXPECT_TRUE(filter10a == filter10a); + EXPECT_TRUE(filter11a == filter11a); + EXPECT_TRUE(filter12a == filter12a); + + EXPECT_TRUE(filter1a == filter1b); + EXPECT_TRUE(filter2a == filter2b); + EXPECT_TRUE(filter3a == filter3b); + EXPECT_TRUE(filter4a == filter4b); + EXPECT_TRUE(filter5a == filter5b); + EXPECT_TRUE(filter6a == filter6b); + EXPECT_TRUE(filter7a == filter7b); + EXPECT_TRUE(filter8a == filter8b); + EXPECT_TRUE(filter9a == filter9b); + EXPECT_TRUE(filter10a == filter10b); + EXPECT_TRUE(filter11a == filter11b); + EXPECT_TRUE(filter12a == filter12b); + + EXPECT_FALSE(filter1a != filter1a); + EXPECT_FALSE(filter2a != filter2a); + EXPECT_FALSE(filter3a != filter3a); + EXPECT_FALSE(filter4a != filter4a); + EXPECT_FALSE(filter5a != filter5a); + EXPECT_FALSE(filter6a != filter6a); + EXPECT_FALSE(filter7a != filter7a); + EXPECT_FALSE(filter8a != filter8a); + EXPECT_FALSE(filter9a != filter9a); + EXPECT_FALSE(filter10a != filter10a); + EXPECT_FALSE(filter11a != filter11a); + EXPECT_FALSE(filter12a != filter12a); + + EXPECT_FALSE(filter1a != filter1b); + EXPECT_FALSE(filter2a != filter2b); + EXPECT_FALSE(filter3a != filter3b); + EXPECT_FALSE(filter4a != filter4b); + EXPECT_FALSE(filter5a != filter5b); + EXPECT_FALSE(filter6a != filter6b); + EXPECT_FALSE(filter7a != filter7b); + EXPECT_FALSE(filter8a != filter8b); + EXPECT_FALSE(filter9a != filter9b); + EXPECT_FALSE(filter10a != filter10b); + EXPECT_FALSE(filter11a != filter11b); + EXPECT_FALSE(filter12a != filter12b); + + EXPECT_TRUE(filter1a != filter2a); + EXPECT_TRUE(filter1a != filter3a); + EXPECT_TRUE(filter1a != filter4a); + EXPECT_TRUE(filter1a != filter5a); + EXPECT_TRUE(filter1a != filter6a); + EXPECT_TRUE(filter1a != filter7a); + EXPECT_TRUE(filter1a != filter8a); + EXPECT_TRUE(filter1a != filter9a); + EXPECT_TRUE(filter1a != filter10a); + EXPECT_TRUE(filter1a != filter11a); + EXPECT_TRUE(filter1a != filter12a); + EXPECT_TRUE(filter2a != filter3a); + EXPECT_TRUE(filter2a != filter4a); + EXPECT_TRUE(filter2a != filter5a); + EXPECT_TRUE(filter2a != filter6a); + EXPECT_TRUE(filter2a != filter7a); + EXPECT_TRUE(filter2a != filter8a); + EXPECT_TRUE(filter2a != filter9a); + EXPECT_TRUE(filter2a != filter10a); + EXPECT_TRUE(filter2a != filter11a); + EXPECT_TRUE(filter2a != filter12a); + EXPECT_TRUE(filter3a != filter4a); + EXPECT_TRUE(filter3a != filter5a); + EXPECT_TRUE(filter3a != filter6a); + EXPECT_TRUE(filter3a != filter7a); + EXPECT_TRUE(filter3a != filter8a); + EXPECT_TRUE(filter3a != filter9a); + EXPECT_TRUE(filter3a != filter10a); + EXPECT_TRUE(filter3a != filter11a); + EXPECT_TRUE(filter3a != filter12a); + EXPECT_TRUE(filter4a != filter5a); + EXPECT_TRUE(filter4a != filter6a); + EXPECT_TRUE(filter4a != filter7a); + EXPECT_TRUE(filter4a != filter8a); + EXPECT_TRUE(filter4a != filter9a); + EXPECT_TRUE(filter4a != filter10a); + EXPECT_TRUE(filter4a != filter11a); + EXPECT_TRUE(filter4a != filter12a); + EXPECT_TRUE(filter5a != filter6a); + EXPECT_TRUE(filter5a != filter7a); + EXPECT_TRUE(filter5a != filter8a); + EXPECT_TRUE(filter5a != filter9a); + EXPECT_TRUE(filter5a != filter10a); + EXPECT_TRUE(filter5a != filter11a); + EXPECT_TRUE(filter5a != filter12a); + EXPECT_TRUE(filter6a != filter7a); + EXPECT_TRUE(filter6a != filter8a); + EXPECT_TRUE(filter6a != filter9a); + EXPECT_TRUE(filter6a != filter10a); + EXPECT_TRUE(filter6a != filter11a); + EXPECT_TRUE(filter6a != filter12a); + EXPECT_TRUE(filter7a != filter8a); + EXPECT_TRUE(filter7a != filter9a); + EXPECT_TRUE(filter7a != filter10a); + EXPECT_TRUE(filter7a != filter11a); + EXPECT_TRUE(filter7a != filter12a); + EXPECT_TRUE(filter8a != filter9a); + EXPECT_TRUE(filter8a != filter10a); + EXPECT_TRUE(filter8a != filter11a); + EXPECT_TRUE(filter8a != filter12a); + EXPECT_TRUE(filter9a != filter10a); + EXPECT_TRUE(filter9a != filter11a); + EXPECT_TRUE(filter9a != filter12a); + EXPECT_TRUE(filter10a != filter11a); + EXPECT_TRUE(filter10a != filter12a); + EXPECT_TRUE(filter11a != filter12a); +} + +TEST_F(FilterTest, DifferentValuesAreNotEqual) { + Filter filter1a = Filter::ArrayContains("foo", FieldValue::Integer(24)); + Filter filter1b = Filter::ArrayContains("foo", FieldValue::Integer(42)); + Filter filter1c = Filter::ArrayContains("bar", FieldValue::Integer(42)); + + Filter filter2a = Filter::EqualTo("foo", FieldValue::Integer(24)); + Filter filter2b = Filter::EqualTo("foo", FieldValue::Integer(42)); + Filter filter2c = Filter::EqualTo("bar", FieldValue::Integer(42)); + + Filter filter3a = Filter::NotEqualTo("foo", FieldValue::Integer(24)); + Filter filter3b = Filter::NotEqualTo("foo", FieldValue::Integer(42)); + Filter filter3c = Filter::NotEqualTo("bar", FieldValue::Integer(42)); + + Filter filter4a = Filter::GreaterThan("foo", FieldValue::Integer(24)); + Filter filter4b = Filter::GreaterThan("foo", FieldValue::Integer(42)); + Filter filter4c = Filter::GreaterThan("bar", FieldValue::Integer(42)); + + Filter filter5a = + Filter::GreaterThanOrEqualTo("foo", FieldValue::Integer(24)); + Filter filter5b = + Filter::GreaterThanOrEqualTo("foo", FieldValue::Integer(42)); + Filter filter5c = + Filter::GreaterThanOrEqualTo("bar", FieldValue::Integer(42)); + + Filter filter6a = Filter::LessThan("foo", FieldValue::Integer(24)); + Filter filter6b = Filter::LessThan("foo", FieldValue::Integer(42)); + Filter filter6c = Filter::LessThan("bar", FieldValue::Integer(42)); + + Filter filter7a = Filter::LessThanOrEqualTo("foo", FieldValue::Integer(24)); + Filter filter7b = Filter::LessThanOrEqualTo("foo", FieldValue::Integer(42)); + Filter filter7c = Filter::LessThanOrEqualTo("bar", FieldValue::Integer(42)); + + EXPECT_FALSE(filter1a == filter1b); + EXPECT_FALSE(filter1b == filter1c); + EXPECT_FALSE(filter2a == filter2b); + EXPECT_FALSE(filter2b == filter2c); + EXPECT_FALSE(filter3a == filter3b); + EXPECT_FALSE(filter3b == filter3c); + EXPECT_FALSE(filter4a == filter4b); + EXPECT_FALSE(filter4b == filter4c); + EXPECT_FALSE(filter5a == filter5b); + EXPECT_FALSE(filter5b == filter5c); + EXPECT_FALSE(filter6a == filter6b); + EXPECT_FALSE(filter6b == filter6c); + EXPECT_FALSE(filter7a == filter7b); + EXPECT_FALSE(filter7b == filter7c); + + EXPECT_TRUE(filter1a != filter1b); + EXPECT_TRUE(filter1b != filter1c); + EXPECT_TRUE(filter2a != filter2b); + EXPECT_TRUE(filter2b != filter2c); + EXPECT_TRUE(filter3a != filter3b); + EXPECT_TRUE(filter3b != filter3c); + EXPECT_TRUE(filter4a != filter4b); + EXPECT_TRUE(filter4b != filter4c); + EXPECT_TRUE(filter5a != filter5b); + EXPECT_TRUE(filter5b != filter5c); + EXPECT_TRUE(filter6a != filter6b); + EXPECT_TRUE(filter6b != filter6c); + EXPECT_TRUE(filter7a != filter7b); + EXPECT_TRUE(filter7b != filter7c); +} + +TEST_F(FilterTest, CompositesWithOneFilterAreTheSameAsFilter) { + Filter filter1 = Filter::EqualTo("foo", FieldValue::Integer(42)); + Filter filter2 = Filter::Or(filter1); + Filter filter3 = Filter::And(filter1); + + EXPECT_TRUE(filter1 == filter2); + EXPECT_TRUE(filter1 == filter3); + + EXPECT_FALSE(filter1 != filter2); + EXPECT_FALSE(filter1 != filter3); +} + +TEST_F(FilterTest, EmptyCompositeIsIgnoredByCompositesAndQueries) { + Filter filter1 = Filter::And(); + Filter filter2 = Filter::And(Filter::And(), Filter::And()); + Filter filter3 = Filter::And(Filter::Or(), Filter::Or()); + Filter filter4 = Filter::Or(); + Filter filter5 = Filter::Or(Filter::Or(), Filter::Or()); + Filter filter6 = Filter::Or(Filter::And(), Filter::And()); + + EXPECT_EQ(filter1, filter2); + EXPECT_EQ(filter1, filter3); + EXPECT_EQ(filter4, filter5); + EXPECT_EQ(filter4, filter6); + + CollectionReference collection = Collection(); + + Query query1 = collection.Where(filter1); + Query query2 = collection.Where(filter2); + Query query3 = collection.Where(filter3); + Query query4 = collection.Where(filter4); + Query query5 = collection.Where(filter5); + Query query6 = collection.Where(filter6); + + EXPECT_EQ(collection, query1); + EXPECT_EQ(collection, query2); + EXPECT_EQ(collection, query3); + EXPECT_EQ(collection, query4); + EXPECT_EQ(collection, query5); + EXPECT_EQ(collection, query6); +} + +TEST_F(FilterTest, CompositeComparison) { + Filter filter1 = Filter::ArrayContains("foo", FieldValue::Integer(42)); + Filter filter2 = Filter::EqualTo("foo", FieldValue::Integer(42)); + Filter filter3 = Filter::NotEqualTo("foo", FieldValue::Integer(42)); + Filter filter4 = Filter::GreaterThan("foo", FieldValue::Integer(42)); + + Filter and1 = Filter::And(filter1); + Filter and2 = Filter::And(filter1, filter2); + Filter and3 = Filter::And(filter1, filter2, filter3); + Filter and4 = Filter::And(filter1, filter2, filter3, filter4); + + Filter or1 = Filter::Or(filter1); + Filter or2 = Filter::Or(filter1, filter2); + Filter or3 = Filter::Or(filter1, filter2, filter3); + Filter or4 = Filter::Or(filter1, filter2, filter3, filter4); + + EXPECT_EQ(and1, and1); + EXPECT_EQ(and2, and2); + EXPECT_EQ(and3, and3); + EXPECT_EQ(and4, and4); + + EXPECT_EQ(or1, or1); + EXPECT_EQ(or2, or2); + EXPECT_EQ(or3, or3); + EXPECT_EQ(or4, or4); + + // Is equal because single filter composite is same as filter itself. + EXPECT_EQ(and1, or1); + + EXPECT_NE(and2, or2); + EXPECT_NE(and3, or3); + EXPECT_NE(and4, or4); + + EXPECT_NE(and1, and2); + EXPECT_NE(and1, and3); + EXPECT_NE(and1, and4); + EXPECT_NE(and2, and3); + EXPECT_NE(and2, and4); + EXPECT_NE(and3, and4); + + EXPECT_NE(or1, or2); + EXPECT_NE(or1, or3); + EXPECT_NE(or1, or4); + EXPECT_NE(or2, or3); + EXPECT_NE(or2, or4); + EXPECT_NE(or3, or4); +} + +TEST_F(FilterTest, QueryWhereComposite) { + MapFieldValue doc_aaa = {{"x", FieldValue::String("a")}, + {"y", FieldValue::String("a")}, + {"z", FieldValue::String("a")}}; + MapFieldValue doc_aab = {{"x", FieldValue::String("a")}, + {"y", FieldValue::String("a")}, + {"z", FieldValue::String("b")}}; + MapFieldValue doc_aba = {{"x", FieldValue::String("a")}, + {"y", FieldValue::String("b")}, + {"z", FieldValue::String("a")}}; + MapFieldValue doc_abb = {{"x", FieldValue::String("a")}, + {"y", FieldValue::String("b")}, + {"z", FieldValue::String("b")}}; + MapFieldValue doc_baa = {{"x", FieldValue::String("b")}, + {"y", FieldValue::String("a")}, + {"z", FieldValue::String("a")}}; + MapFieldValue doc_bab = {{"x", FieldValue::String("b")}, + {"y", FieldValue::String("a")}, + {"z", FieldValue::String("b")}}; + MapFieldValue doc_bba = {{"x", FieldValue::String("b")}, + {"y", FieldValue::String("b")}, + {"z", FieldValue::String("a")}}; + MapFieldValue doc_bbb = {{"x", FieldValue::String("b")}, + {"y", FieldValue::String("b")}, + {"z", FieldValue::String("b")}}; + CollectionReference collection = Collection({{"aaa", doc_aaa}, + {"aab", doc_aab}, + {"aba", doc_aba}, + {"abb", doc_abb}, + {"baa", doc_baa}, + {"bab", doc_bab}, + {"bba", doc_bba}, + {"bbb", doc_bbb}}); + + Filter filter_xa = Filter::EqualTo("x", FieldValue::String("a")); + Filter filter_ya = Filter::EqualTo("y", FieldValue::String("a")); + Filter filter_yb = Filter::EqualTo("y", FieldValue::String("b")); + Filter filter_za = Filter::EqualTo("z", FieldValue::String("a")); + + // And(x=a) + QuerySnapshot snapshot1 = + ReadDocuments(collection.Where(Filter::And(filter_xa))); + EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), + QuerySnapshotToValues(snapshot1)); + + // And(x=a, y=b) + QuerySnapshot snapshot2 = + ReadDocuments(collection.Where(Filter::And(filter_xa, filter_yb))); + EXPECT_EQ(std::vector({doc_aba, doc_abb}), + QuerySnapshotToValues(snapshot2)); + + // And(Or(And(x=a)),Or(And(Or())) + QuerySnapshot snapshot3 = ReadDocuments( + collection.Where(Filter::And(Filter::Or(Filter::And(filter_xa)), + Filter::Or(Filter::And(Filter::Or()))))); + EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), + QuerySnapshotToValues(snapshot3)); + + // Or(x=a) + QuerySnapshot snapshot4 = + ReadDocuments(collection.Where(Filter::Or(filter_xa))); + EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), + QuerySnapshotToValues(snapshot4)); + + // Or(x=a, y=b) + QuerySnapshot snapshot5 = + ReadDocuments(collection.Where(Filter::Or(filter_xa, filter_yb))); + EXPECT_EQ(std::vector( + {doc_aaa, doc_aab, doc_aba, doc_abb, doc_bba, doc_bbb}), + QuerySnapshotToValues(snapshot5)); + + // Or(And(Or(x=a)),And(Or(And())) + QuerySnapshot snapshot6 = ReadDocuments( + collection.Where(Filter::Or(Filter::And(Filter::Or(filter_xa)), + Filter::And(Filter::Or(Filter::And()))))); + EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba, doc_abb}), + QuerySnapshotToValues(snapshot6)); + + // And(x=b, Or(y=a, And(y=b, z=a))) + QuerySnapshot snapshot7 = ReadDocuments(collection.Where(Filter::And( + filter_xa, Filter::Or(filter_ya, Filter::And(filter_yb, filter_za))))); + EXPECT_EQ(std::vector({doc_aaa, doc_aab, doc_aba}), + QuerySnapshotToValues(snapshot7)); +} + +TEST_F(FilterTest, QueryEmptyWhereComposite) { + MapFieldValue doc = {{"foo", FieldValue::String("bar")}}; + CollectionReference collection = Collection({{"x", doc}}); + + QuerySnapshot s1 = ReadDocuments(collection.Where(Filter::And())); + EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s1)); + + QuerySnapshot s2 = + ReadDocuments(collection.Where(Filter::And(Filter::Or(), Filter::Or()))); + EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s2)); + + QuerySnapshot s3 = ReadDocuments(collection.Where(Filter::Or())); + EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s3)); + + QuerySnapshot s4 = + ReadDocuments(collection.Where(Filter::Or(Filter::And(), Filter::And()))); + EXPECT_EQ(std::vector({doc}), QuerySnapshotToValues(s4)); +} + +} // namespace + +} // namespace firestore +} // namespace firebase diff --git a/firestore/src/android/filter_android.cc b/firestore/src/android/filter_android.cc new file mode 100644 index 0000000000..70f91d5848 --- /dev/null +++ b/firestore/src/android/filter_android.cc @@ -0,0 +1,222 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "firestore/src/android/filter_android.h" + +#include "firestore/src/android/converter_android.h" +#include "firestore/src/android/field_path_android.h" +#include "firestore/src/android/field_value_android.h" +#include "firestore/src/android/firestore_android.h" + +#include "firestore/src/jni/array.h" +#include "firestore/src/jni/array_list.h" +#include "firestore/src/jni/compare.h" +#include "firestore/src/jni/env.h" +#include "firestore/src/jni/loader.h" + +namespace firebase { +namespace firestore { +namespace { + +using jni::Array; +using jni::ArrayList; +using jni::Env; +using jni::Local; +using jni::Object; +using jni::StaticMethod; + +jclass filter_class = nullptr; +constexpr char kClassName[] = + PROGUARD_KEEP_CLASS "com/google/firebase/firestore/Filter"; +StaticMethod kEqualTo( + "equalTo", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kNotEqualTo( + "notEqualTo", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kLessThan( + "lessThan", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kLessThanOrEqualTo( + "lessThanOrEqualTo", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kGreaterThan( + "greaterThan", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kGreaterThanOrEqualTo( + "greaterThanOrEqualTo", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kArrayContains( + "arrayContains", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kArrayContainsAny( + "arrayContainsAny", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kIn( + "inArray", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kNotIn( + "notInArray", + "(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kAnd("and", + "([Lcom/google/firebase/firestore/Filter;)" + "Lcom/google/firebase/firestore/Filter;"); +StaticMethod kOr("or", + "([Lcom/google/firebase/firestore/Filter;)" + "Lcom/google/firebase/firestore/Filter;"); +} // namespace + +void FilterInternal::Initialize(jni::Loader& loader) { + filter_class = loader.LoadClass(kClassName); + loader.LoadClass(kClassName, kEqualTo, kNotEqualTo, kLessThan, + kLessThanOrEqualTo, kGreaterThan, kGreaterThanOrEqualTo, + kArrayContains, kArrayContainsAny, kIn, kNotIn, kAnd, kOr); +} + +FilterInternal::FilterInternal(const jni::Object& obj, bool is_empty) + : is_empty_(is_empty) { + Env env = GetEnv(); + obj_.reset(env, obj); +} + +Filter FilterInternal::EqualTo(const FieldPath& field, + const FieldValue& value) { + return Where(field, kEqualTo, value); +} + +Filter FilterInternal::NotEqualTo(const FieldPath& field, + const FieldValue& value) { + return Where(field, kNotEqualTo, value); +} + +Filter FilterInternal::LessThan(const FieldPath& field, + const FieldValue& value) { + return Where(field, kLessThan, value); +} + +Filter FilterInternal::LessThanOrEqualTo(const FieldPath& field, + const FieldValue& value) { + return Where(field, kLessThanOrEqualTo, value); +} + +Filter FilterInternal::GreaterThan(const FieldPath& field, + const FieldValue& value) { + return Where(field, kGreaterThan, value); +} + +Filter FilterInternal::GreaterThanOrEqualTo(const FieldPath& field, + const FieldValue& value) { + return Where(field, kGreaterThanOrEqualTo, value); +} + +Filter FilterInternal::ArrayContains(const FieldPath& field, + const FieldValue& value) { + return Where(field, kArrayContains, value); +} + +Filter FilterInternal::ArrayContainsAny(const FieldPath& field, + const std::vector& values) { + return Where(field, kArrayContainsAny, values); +} + +Filter FilterInternal::In(const FieldPath& field, + const std::vector& values) { + return Where(field, kIn, values); +} + +Filter FilterInternal::NotIn(const FieldPath& field, + const std::vector& values) { + return Where(field, kNotIn, values); +} + +Filter FilterInternal::And(const std::vector& filters) { + return Where(kAnd, filters); +} + +Filter FilterInternal::Or(const std::vector& filters) { + return Where(kOr, filters); +} + +Env FilterInternal::GetEnv() { return FirestoreInternal::GetEnv(); } + +Filter FilterInternal::Where(const FieldPath& field, + const StaticMethod& method, + const FieldValue& value) { + Env env = GetEnv(); + Local java_field = FieldPathConverter::Create(env, field); + Local filter = + env.Call(method, java_field, FieldValueInternal::ToJava(value)); + return Filter(new FilterInternal(filter, false)); +} + +Filter FilterInternal::Where(const FieldPath& field, + const jni::StaticMethod& method, + const std::vector& values) { + Env env = GetEnv(); + size_t size = values.size(); + Local java_values = ArrayList::Create(env, size); + for (size_t i = 0; i < size; ++i) { + java_values.Add(env, FieldValueInternal::ToJava(values[i])); + } + + Local java_field = FieldPathConverter::Create(env, field); + Local filter = env.Call(method, java_field, java_values); + return Filter(new FilterInternal(filter, false)); +} + +Filter FilterInternal::Where(const StaticMethod& method, + const std::vector& filters) { + Env env = GetEnv(); + std::vector non_empty_indexes; + size_t filters_size = filters.size(); + for (int i = 0; i < filters_size; ++i) { + if (!filters[i].internal_->IsEmpty()) { + non_empty_indexes.push_back(i); + } + } + size_t non_empty_size = non_empty_indexes.size(); + Local> java_filters = + env.NewArray(non_empty_size, filter_class); + for (int i = 0; i < non_empty_size; ++i) { + java_filters.Set(env, i, filters[non_empty_indexes[i]].internal_->ToJava()); + } + Local filter = env.Call(method, java_filters); + return Filter(new FilterInternal(filter, non_empty_size == 0)); +} + +Local FilterInternal::ToJava() const { + Env env = GetEnv(); + return obj_.get(env); +} + +bool operator==(const FilterInternal& lhs, const FilterInternal& rhs) { + return jni::EqualityCompareJni(lhs, rhs); +} + +} // namespace firestore +} // namespace firebase diff --git a/firestore/src/android/filter_android.h b/firestore/src/android/filter_android.h new file mode 100644 index 0000000000..c180b1650b --- /dev/null +++ b/firestore/src/android/filter_android.h @@ -0,0 +1,89 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_FIRESTORE_SRC_ANDROID_FILTER_ANDROID_H_ +#define FIREBASE_FIRESTORE_SRC_ANDROID_FILTER_ANDROID_H_ + +#include + +#include "firestore/src/android/wrapper.h" +#include "firestore/src/include/firebase/firestore/field_path.h" +#include "firestore/src/include/firebase/firestore/field_value.h" +#include "firestore/src/include/firebase/firestore/filter.h" + +namespace firebase { +namespace firestore { + +class FilterInternal final { + public: + static void Initialize(jni::Loader& loader); + + FilterInternal(const jni::Object& object, bool is_empty); + + static Filter ArrayContains(const FieldPath& field, const FieldValue& value); + static Filter ArrayContainsAny(const FieldPath& field, + const std::vector& values); + static Filter EqualTo(const FieldPath& field, const FieldValue& value); + static Filter NotEqualTo(const FieldPath& field, const FieldValue& value); + static Filter GreaterThan(const FieldPath& field, const FieldValue& value); + static Filter GreaterThanOrEqualTo(const FieldPath& field, + const FieldValue& value); + static Filter LessThan(const FieldPath& field, const FieldValue& value); + static Filter LessThanOrEqualTo(const FieldPath& field, + const FieldValue& value); + static Filter In(const FieldPath& field, + const std::vector& values); + static Filter NotIn(const FieldPath& field, + const std::vector& values); + static Filter Or(const std::vector& filters); + static Filter And(const std::vector& filters); + + jni::Local ToJava() const; + + private: + friend class Filter; + friend class FirestoreInternal; + + FilterInternal* clone() { return new FilterInternal(*this); } + + bool IsEmpty() const { return is_empty_; } + + static jni::Env GetEnv(); + + jni::ArenaRef obj_; + const bool is_empty_; + + // A generalized function for all WhereFoo calls. + static Filter Where(const FieldPath& field, + const jni::StaticMethod& method, + const FieldValue& value); + static Filter Where(const FieldPath& field, + const jni::StaticMethod& method, + const std::vector& values); + static Filter Where(const jni::StaticMethod& method, + const std::vector& filters); +}; + +bool operator==(const FilterInternal& lhs, const FilterInternal& rhs); + +inline bool operator!=(const FilterInternal& lhs, const FilterInternal& rhs) { + return !(lhs == rhs); +} + +} // namespace firestore +} // namespace firebase + +#endif // FIREBASE_FIRESTORE_SRC_ANDROID_FILTER_ANDROID_H_ diff --git a/firestore/src/android/firestore_android.cc b/firestore/src/android/firestore_android.cc index be94023a9c..67937725d5 100644 --- a/firestore/src/android/firestore_android.cc +++ b/firestore/src/android/firestore_android.cc @@ -37,6 +37,7 @@ #include "firestore/src/android/exception_android.h" #include "firestore/src/android/field_path_android.h" #include "firestore/src/android/field_value_android.h" +#include "firestore/src/android/filter_android.h" #include "firestore/src/android/geo_point_android.h" #include "firestore/src/android/jni_runnable_android.h" #include "firestore/src/android/lambda_event_listener.h" @@ -339,6 +340,7 @@ bool FirestoreInternal::Initialize(App* app) { ExceptionInternal::Initialize(loader); FieldPathConverter::Initialize(loader); FieldValueInternal::Initialize(loader); + FilterInternal::Initialize(loader); GeoPointInternal::Initialize(loader); JniRunnableBase::Initialize(loader); ListenerRegistrationInternal::Initialize(loader); diff --git a/firestore/src/android/query_android.cc b/firestore/src/android/query_android.cc index 27a1dd2e38..436e12c0a2 100644 --- a/firestore/src/android/query_android.cc +++ b/firestore/src/android/query_android.cc @@ -25,6 +25,7 @@ #include "firestore/src/android/event_listener_android.h" #include "firestore/src/android/field_path_android.h" #include "firestore/src/android/field_value_android.h" +#include "firestore/src/android/filter_android.h" #include "firestore/src/android/firestore_android.h" #include "firestore/src/android/lambda_event_listener.h" #include "firestore/src/android/listener_registration_android.h" @@ -55,6 +56,9 @@ constexpr char kClassName[] = PROGUARD_KEEP_CLASS "com/google/firebase/firestore/Query"; Method kCount("count", "()Lcom/google/firebase/firestore/AggregateQuery;"); +Method kWhere("where", + "(Lcom/google/firebase/firestore/Filter;)" + "Lcom/google/firebase/firestore/Query;"); Method kEqualTo( "whereEqualTo", "(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)" @@ -144,7 +148,7 @@ void QueryInternal::Initialize(jni::Loader& loader) { kGreaterThan, kGreaterThanOrEqualTo, kArrayContains, kArrayContainsAny, kIn, kNotIn, kOrderBy, kLimit, kLimitToLast, kStartAtSnapshot, kStartAt, kStartAfterSnapshot, kStartAfter, kEndBeforeSnapshot, kEndBefore, - kEndAtSnapshot, kEndAt, kGet, kAddSnapshotListener, kHashCode); + kEndAtSnapshot, kEndAt, kGet, kAddSnapshotListener, kHashCode, kWhere); } Firestore* QueryInternal::firestore() { @@ -158,6 +162,12 @@ AggregateQuery QueryInternal::Count() const { return firestore_->NewAggregateQuery(env, aggregate_query); } +Query QueryInternal::Where(const firebase::firestore::Filter& filter) const { + Env env = GetEnv(); + Local query = env.Call(obj_, kWhere, filter.internal_->ToJava()); + return firestore_->NewQuery(env, query); +} + Query QueryInternal::WhereEqualTo(const FieldPath& field, const FieldValue& value) const { return Where(field, kEqualTo, value); diff --git a/firestore/src/android/query_android.h b/firestore/src/android/query_android.h index abb3dea8e3..a325e561e4 100644 --- a/firestore/src/android/query_android.h +++ b/firestore/src/android/query_android.h @@ -71,6 +71,14 @@ class QueryInternal : public Wrapper { */ virtual AggregateQuery Count() const; + /** + * @brief Creates and returns a new Query with the additional filter. + * + * @param filter The new filter to apply to the existing query. + * @return The created Query. + */ + Query Where(const Filter& filter) const; + /** * @brief Creates and returns a new Query with the additional filter that * documents must contain the specified field and the value should be equal to diff --git a/firestore/src/common/filter.cc b/firestore/src/common/filter.cc new file mode 100644 index 0000000000..77ae208beb --- /dev/null +++ b/firestore/src/common/filter.cc @@ -0,0 +1,174 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "firebase/firestore/filter.h" + +#include "firestore/src/common/cleanup.h" +#include "firestore/src/common/hard_assert_common.h" + +#if defined(__ANDROID__) +#include "firestore/src/android/filter_android.h" +#else +#include "firestore/src/main/filter_main.h" +#endif // defined(__ANDROID__) + +#include "firestore/src/common/util.h" + +namespace firebase { +namespace firestore { + +Filter::Filter(const Filter& other) { internal_ = other.internal_->clone(); } + +Filter::Filter(Filter&& other) noexcept { + std::swap(internal_, other.internal_); +} + +Filter::Filter(FilterInternal* internal) : internal_(internal) { + SIMPLE_HARD_ASSERT(internal != nullptr); +} + +Filter::~Filter() { + delete internal_; + internal_ = nullptr; +} + +Filter& Filter::operator=(const Filter& other) { + if (this == &other) { + return *this; + } + delete internal_; + internal_ = other.internal_->clone(); + return *this; +} + +Filter& Filter::operator=(Filter&& other) noexcept { + if (this == &other) { + return *this; + } + delete internal_; + internal_ = other.internal_; + other.internal_ = nullptr; + return *this; +} + +Filter Filter::ArrayContains(const std::string& field, + const FieldValue& value) { + return ArrayContains(FieldPath::FromDotSeparatedString(field), value); +} + +Filter Filter::ArrayContainsAny(const std::string& field, + const std::vector& values) { + return ArrayContainsAny(FieldPath::FromDotSeparatedString(field), values); +} + +Filter Filter::EqualTo(const std::string& field, + const firebase::firestore::FieldValue& value) { + return EqualTo(FieldPath::FromDotSeparatedString(field), value); +} + +Filter Filter::NotEqualTo(const std::string& field, const FieldValue& value) { + return NotEqualTo(FieldPath::FromDotSeparatedString(field), value); +} + +Filter Filter::GreaterThan(const std::string& field, const FieldValue& value) { + return GreaterThan(FieldPath::FromDotSeparatedString(field), value); +} + +Filter Filter::GreaterThanOrEqualTo(const std::string& field, + const FieldValue& value) { + return GreaterThanOrEqualTo(FieldPath::FromDotSeparatedString(field), value); +} + +Filter Filter::LessThan(const std::string& field, const FieldValue& value) { + return LessThan(FieldPath::FromDotSeparatedString(field), value); +} + +Filter Filter::LessThanOrEqualTo(const std::string& field, + const FieldValue& value) { + return LessThanOrEqualTo(FieldPath::FromDotSeparatedString(field), value); +} + +Filter Filter::In(const std::string& field, + const std::vector& values) { + return In(FieldPath::FromDotSeparatedString(field), values); +} + +Filter Filter::NotIn(const std::string& field, + const std::vector& values) { + return NotIn(FieldPath::FromDotSeparatedString(field), values); +} + +Filter Filter::ArrayContains(const FieldPath& field, const FieldValue& value) { + return FilterInternal::ArrayContains(field, value); +} + +Filter Filter::ArrayContainsAny(const FieldPath& field, + const std::vector& values) { + return FilterInternal::ArrayContainsAny(field, values); +} + +Filter Filter::EqualTo(const FieldPath& field, const FieldValue& value) { + return FilterInternal::EqualTo(field, value); +} + +Filter Filter::NotEqualTo(const FieldPath& field, const FieldValue& value) { + return FilterInternal::NotEqualTo(field, value); +} + +Filter Filter::GreaterThan(const FieldPath& field, const FieldValue& value) { + return FilterInternal::GreaterThan(field, value); +} + +Filter Filter::GreaterThanOrEqualTo(const FieldPath& field, + const FieldValue& value) { + return FilterInternal::GreaterThanOrEqualTo(field, value); +} + +Filter Filter::LessThan(const FieldPath& field, const FieldValue& value) { + return FilterInternal::LessThan(field, value); +} + +Filter Filter::LessThanOrEqualTo(const FieldPath& field, + const FieldValue& value) { + return FilterInternal::LessThanOrEqualTo(field, value); +} + +Filter Filter::In(const FieldPath& field, + const std::vector& values) { + return FilterInternal::In(field, values); +} + +Filter Filter::NotIn(const FieldPath& field, + const std::vector& values) { + return FilterInternal::NotIn(field, values); +} + +Filter Filter::And(const std::vector& filters) { + return FilterInternal::And(filters); +} + +Filter Filter::Or(const std::vector& filters) { + return FilterInternal::Or(filters); +} + +bool operator==(const Filter& lhs, const Filter& rhs) { + return EqualityCompare(lhs.internal_, rhs.internal_); +} + +bool Filter::IsEmpty() const { return internal_->IsEmpty(); } + +} // namespace firestore +} // namespace firebase diff --git a/firestore/src/common/query.cc b/firestore/src/common/query.cc index 4e12cb9041..089fc9375f 100644 --- a/firestore/src/common/query.cc +++ b/firestore/src/common/query.cc @@ -27,6 +27,7 @@ #include "firestore/src/include/firebase/firestore/document_snapshot.h" #include "firestore/src/include/firebase/firestore/field_path.h" #include "firestore/src/include/firebase/firestore/field_value.h" +#include "firestore/src/include/firebase/firestore/filter.h" #include "firestore/src/include/firebase/firestore/listener_registration.h" #include "firestore/src/include/firebase/firestore/query_snapshot.h" #if defined(__ANDROID__) @@ -112,6 +113,16 @@ AggregateQuery Query::Count() const { return internal_->Count(); } +Query Query::Where(const Filter& filter) const { + if (!internal_) return {}; + if (filter.IsEmpty()) { + // Return the existing query if not adding any more filters (e.g. an empty + // composite filter). + return *this; + } + return internal_->Where(filter); +} + Query Query::WhereEqualTo(const std::string& field, const FieldValue& value) const { return WhereEqualTo(FieldPath::FromDotSeparatedString(field), value); diff --git a/firestore/src/common/type_mapping.h b/firestore/src/common/type_mapping.h index 269b92a410..5501181da3 100644 --- a/firestore/src/common/type_mapping.h +++ b/firestore/src/common/type_mapping.h @@ -34,6 +34,8 @@ class DocumentReference; class DocumentReferenceInternal; class DocumentSnapshot; class DocumentSnapshotInternal; +class Filter; +class FilterInternal; class FieldValue; class FieldValueInternal; class Firestore; @@ -83,6 +85,10 @@ struct InternalTypeMap { using type = DocumentSnapshotInternal; }; template <> +struct InternalTypeMap { + using type = FilterInternal; +}; +template <> struct InternalTypeMap { using type = FieldValueInternal; }; diff --git a/firestore/src/include/firebase/firestore.h b/firestore/src/include/firebase/firestore.h index 7cc0274812..c3cf04e07f 100644 --- a/firestore/src/include/firebase/firestore.h +++ b/firestore/src/include/firebase/firestore.h @@ -36,6 +36,7 @@ #include "firebase/firestore/document_snapshot.h" #include "firebase/firestore/field_path.h" #include "firebase/firestore/field_value.h" +#include "firebase/firestore/filter.h" #include "firebase/firestore/firestore_errors.h" #include "firebase/firestore/geo_point.h" #include "firebase/firestore/listener_registration.h" diff --git a/firestore/src/include/firebase/firestore/field_path.h b/firestore/src/include/firebase/firestore/field_path.h index d09dec6411..81c8cb5739 100644 --- a/firestore/src/include/firebase/firestore/field_path.h +++ b/firestore/src/include/firebase/firestore/field_path.h @@ -164,6 +164,7 @@ class FieldPath final { friend bool operator!=(const FieldPath& lhs, const FieldPath& rhs); friend struct std::hash; + friend class Filter; friend class DocumentSnapshot; // For access to `FromDotSeparatedString` friend class Query; friend class QueryInternal; diff --git a/firestore/src/include/firebase/firestore/filter.h b/firestore/src/include/firebase/firestore/filter.h new file mode 100644 index 0000000000..ff1471acc3 --- /dev/null +++ b/firestore/src/include/firebase/firestore/filter.h @@ -0,0 +1,411 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_FIRESTORE_SRC_INCLUDE_FIREBASE_FIRESTORE_FILTER_H_ +#define FIREBASE_FIRESTORE_SRC_INCLUDE_FIREBASE_FIRESTORE_FILTER_H_ + +#include +#include + +#include "firebase/firestore/field_value.h" + +namespace firebase { +namespace firestore { + +class FilterInternal; + +/** + * @brief A Filter represents a restriction on one or more field values and can + * be used to refine the results of a Query. + */ +class Filter { + public: + /** + * @brief Creates a new filter for checking that the given array field + * contains the given value. + * + * @param[in] field The name of the field containing an array to search. + * @param[in] value The value that must be contained in the array. + * + * @return The newly created filter. + */ + static Filter ArrayContains(const std::string& field, + const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given array field + * contains any of the given values. + * + * @param[in] field The name of the field containing an array to search. + * @param[in] values The list of values to match. + * + * @return The newly created filter. + */ + static Filter ArrayContainsAny(const std::string& field, + const std::vector& values); + + /** + * @brief Creates a new filter for checking that the given field is equal to + * the given value. + * + * @param[in] field The name of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter EqualTo(const std::string& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is not equal + * to the given value. + * + * @param[in] field The name of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter NotEqualTo(const std::string& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is greater + * than the given value. + * + * @param[in] field The name of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter GreaterThan(const std::string& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is greater + * than or equal to the given value. + * + * @param[in] field The name of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter GreaterThanOrEqualTo(const std::string& field, + const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is less than + * the given value. + * + * @param[in] field The name of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter LessThan(const std::string& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is less than + * or equal to the given value. + * + * @param[in] field The name of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter LessThanOrEqualTo(const std::string& field, + const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field equals any of + * the given values. + * + * @param[in] field The name of the field to compare. + * @param[in] values The list of values to match. + * + * @return The newly created filter. + */ + static Filter In(const std::string& field, + const std::vector& values); + + /** + * @brief Creates a new filter for checking that the given field does not + * equal any of the given values. + * + * @param[in] field The name of the field to compare. + * @param[in] values The list of values to match. + * + * @return The newly created filter. + */ + static Filter NotIn(const std::string& field, + const std::vector& values); + + /** + * @brief Creates a new filter for checking that the given array field + * contains the given value. + * + * @param[in] field The path of the field containing an array to search. + * @param[in] value The value that must be contained in the array. + * + * @return The newly created filter. + */ + static Filter ArrayContains(const FieldPath& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given array field + * contains any of the given values. + * + * @param[in] field The path of the field containing an array to search. + * @param[in] values The list of values to match. + * + * @return The newly created filter. + */ + static Filter ArrayContainsAny(const FieldPath& field, + const std::vector& values); + + /** + * @brief Creates a new filter for checking that the given field is equal to + * the given value. + * + * @param[in] field The path of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter EqualTo(const FieldPath& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is not equal + * to the given value. + * + * @param[in] field The path of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter NotEqualTo(const FieldPath& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is greater + * than the given value. + * + * @param[in] field The path of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter GreaterThan(const FieldPath& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is greater + * than or equal to the given value. + * + * @param[in] field The path of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter GreaterThanOrEqualTo(const FieldPath& field, + const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is less than + * the given value. + * + * @param[in] field The path of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter LessThan(const FieldPath& field, const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field is less than + * or equal to the given value. + * + * @param[in] field The path of the field to compare. + * @param[in] value The value for comparison + * + * @return The newly created filter. + */ + static Filter LessThanOrEqualTo(const FieldPath& field, + const FieldValue& value); + + /** + * @brief Creates a new filter for checking that the given field equals any of + * the given values. + * + * @param[in] field The path of the field to compare. + * @param[in] values The list of values to match. + * + * @return The newly created filter. + */ + static Filter In(const FieldPath& field, + const std::vector& values); + + /** + * @brief Creates a new filter for checking that the given field does not + * equal any of the given values. + * + * @param[in] field The path of the field to compare. + * @param[in] values The list of values to match. + * + * @return The newly created filter. + */ + static Filter NotIn(const FieldPath& field, + const std::vector& values); + + /** + * @brief Creates a new filter that is a conjunction of the given filters. A + * conjunction filter includes a document if it satisfies all of the given + * filters. + * + * If no filter is given, the composite filter is a no-op, and if only one + * filter is given, the composite filter has the same behavior as the + * underlying filter. + * + * @param[in] filters The filters to perform a conjunction for. + * + * @return The newly created filter. + */ + template + static Filter And(const Filters&... filters) { + return AndInternal(filters...); + } + + /** + * @brief Creates a new filter that is a conjunction of the given filters. A + * conjunction filter includes a document if it satisfies all of the given + * filters. + * + * If no filter is given, the composite filter is a no-op, and if only one + * filter is given, the composite filter has the same behavior as the + * underlying filter. + * + * @param[in] filters The list that contains filters to perform a conjunction + * for. + * + * @return The newly created filter. + */ + static Filter And(const std::vector& filters); + + /** + * @brief Creates a new filter that is a disjunction of the given filters. A + * disjunction filter includes a document if it satisfies any of the + * given filters. + * + * If no filter is given, the composite filter is a no-op, and if only one + * filter is given, the composite filter has the same behavior as the + * underlying filter. + * + * @param[in] filters The filters to perform a disjunction for. + * + * @return The newly created filter. + */ + template + static Filter Or(const Filters&... filters) { + return OrInternal(filters...); + } + + /** + * @brief Creates a new filter that is a disjunction of the given filters. A + * disjunction filter includes a document if it satisfies any of the + * given filters. + * + * If no filter is given, the composite filter is a no-op, and if only one + * filter is given, the composite filter has the same behavior as the + * underlying filter. + * + * @param[in] filters The list that contains filters to perform a disjunction + * for. + * + * @return The newly created filter. + */ + static Filter Or(const std::vector& filters); + + /** + * @brief Copy constructor. + * + * `Filter` is immutable and can be efficiently copied. + * + * @param[in] other `Filter` to copy from. + */ + Filter(const Filter& other); + + /** + * @brief Move constructor. + * + * @param[in] other `Filter` to move data from. + */ + Filter(Filter&& other) noexcept; + + /** + * @brief Copy assignment operator. + * + * `Filter` is immutable and can be efficiently copied. + * + * @param[in] other `Filter` to copy from. + * + * @return Reference to the destination `Filter`. + */ + Filter& operator=(const Filter& other); + + /** + * @brief Move assignment operator. + * + * @param[in] other `Filter` to move data from. + * + * @return Reference to the destination `Filter`. + */ + Filter& operator=(Filter&& other) noexcept; + + ~Filter(); + + private: + friend class Query; + friend class QueryInternal; + friend class FilterInternal; + friend bool operator==(const Filter& lhs, const Filter& rhs); + friend struct ConverterImpl; + + static inline Filter AndInternal(const Filter& filter) { return filter; } + + template + static inline Filter AndInternal(const Filters&... filters) { + return And(std::vector({filters...})); + } + + static inline Filter OrInternal(const Filter& filter) { return filter; } + + template + static inline Filter OrInternal(const Filters&... filters) { + return Or(std::vector({filters...})); + } + + bool IsEmpty() const; + + explicit Filter(FilterInternal* internal); + FilterInternal* internal_ = nullptr; +}; + +/** Checks `lhs` and `rhs` for equality. */ +bool operator==(const Filter& lhs, const Filter& rhs); + +/** Checks `lhs` and `rhs` for inequality. */ +inline bool operator!=(const Filter& lhs, const Filter& rhs) { + return !(lhs == rhs); +} + +} // namespace firestore +} // namespace firebase + +#endif // FIREBASE_FIRESTORE_SRC_INCLUDE_FIREBASE_FIRESTORE_FILTER_H_ diff --git a/firestore/src/include/firebase/firestore/query.h b/firestore/src/include/firebase/firestore/query.h index 0586756854..d696492146 100644 --- a/firestore/src/include/firebase/firestore/query.h +++ b/firestore/src/include/firebase/firestore/query.h @@ -41,6 +41,7 @@ class AggregateQuery; class DocumentSnapshot; template class EventListener; +class Filter; class FieldPath; class FieldValue; class ListenerRegistration; @@ -83,8 +84,7 @@ class Query { /** * @brief Copy constructor. * - * `Query` is immutable and can be efficiently copied (no deep copy is - * performed). + * `Query` is immutable and can be efficiently copied. * * @param[in] other `Query` to copy from. */ @@ -105,8 +105,7 @@ class Query { /** * @brief Copy assignment operator. * - * `Query` is immutable and can be efficiently copied (no deep copy is - * performed). + * `Query` is immutable and can be efficiently copied. * * @param[in] other `Query` to copy from. * @@ -161,6 +160,14 @@ class Query { */ virtual AggregateQuery Count() const; + /** + * @brief Creates and returns a new Query with the additional filter. + * + * @param filter The new filter to apply to the existing query. + * @return The created Query. + */ + virtual Query Where(const Filter& filter) const; + /** * @brief Creates and returns a new Query with the additional filter that * documents must contain the specified field and the value should be equal to @@ -395,7 +402,7 @@ class Query { * A Query can have only one `WhereIn()` filter and it cannot be * combined with `WhereArrayContainsAny()`. * - * @param[in] field The name of the field containing an array to search. + * @param[in] field The name of the field to compare. * @param[in] values The list that contains the values to match. * * @return The created Query. @@ -411,7 +418,7 @@ class Query { * A Query can have only one `WhereIn()` filter and it cannot be * combined with `WhereArrayContainsAny()`. * - * @param[in] field The path of the field containing an array to search. + * @param[in] field The path of the field to compare. * @param[in] values The list that contains the values to match. * * @return The created Query. @@ -433,7 +440,7 @@ class Query { * combined with `WhereArrayContains()`, `WhereArrayContainsAny()`, * `WhereIn()`, or `WhereNotEqualTo()`. * - * @param[in] field The name of the field containing an array to search. + * @param[in] field The name of the field to compare. * @param[in] values The list that contains the values to match. * * @return The created Query. @@ -455,7 +462,7 @@ class Query { * combined with `WhereArrayContains()`, `WhereArrayContainsAny()`, * `WhereIn()`, or `WhereNotEqualTo()`. * - * @param[in] field The path of the field containing an array to search. + * @param[in] field The path of the field to compare. * @param[in] values The list that contains the values to match. * * @return The created Query. diff --git a/firestore/src/main/composite_filter_main.cc b/firestore/src/main/composite_filter_main.cc new file mode 100644 index 0000000000..82666c528b --- /dev/null +++ b/firestore/src/main/composite_filter_main.cc @@ -0,0 +1,70 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined(__ANDROID__) +#error "This header should not be used on Android." +#endif + +#include +#include + +#include "Firestore/core/src/core/composite_filter.h" +#include "absl/algorithm/container.h" +#include "firestore/src/common/util.h" +#include "firestore/src/main/composite_filter_main.h" +#include "firestore/src/main/converter_main.h" + +namespace firebase { +namespace firestore { + +CompositeFilterInternal::CompositeFilterInternal( + core::CompositeFilter::Operator op, std::vector& filters) + : FilterInternal(FilterType::Composite), op_(op) { + for (FilterInternal* filter_internal : filters) { + filters_.emplace_back(std::shared_ptr(filter_internal)); + } +} + +CompositeFilterInternal* CompositeFilterInternal::clone() { + return new CompositeFilterInternal(*this); +} + +bool CompositeFilterInternal::IsEmpty() const { return filters_.empty(); } + +core::Filter CompositeFilterInternal::ToCoreFilter( + const api::Query& query, + const firebase::firestore::UserDataConverter& user_data_converter) const { + std::vector core_filters{}; + for (auto& filter : filters_) { + core_filters.push_back(filter->ToCoreFilter(query, user_data_converter)); + } + return core::CompositeFilter::Create(std::move(core_filters), op_); +} + +bool operator==(const CompositeFilterInternal& lhs, + const CompositeFilterInternal& rhs) { + return lhs.op_ == rhs.op_ && lhs.filters_.size() == rhs.filters_.size() && + std::equal(lhs.filters_.begin(), lhs.filters_.end(), + rhs.filters_.begin(), rhs.filters_.end(), + [](const std::shared_ptr& lhs_filter, + const std::shared_ptr& rhs_filter) { + return EqualityCompare(lhs_filter.get(), + rhs_filter.get()); + }); +} + +} // namespace firestore +} // namespace firebase diff --git a/firestore/src/main/composite_filter_main.h b/firestore/src/main/composite_filter_main.h new file mode 100644 index 0000000000..4eb1ee5af8 --- /dev/null +++ b/firestore/src/main/composite_filter_main.h @@ -0,0 +1,66 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_FIRESTORE_SRC_MAIN_COMPOSITE_FILTER_MAIN_H_ +#define FIREBASE_FIRESTORE_SRC_MAIN_COMPOSITE_FILTER_MAIN_H_ + +#if defined(__ANDROID__) +#error "This header should not be used on Android." +#endif + +#include +#include + +#include "Firestore/core/src/api/query_core.h" +#include "firestore/src/main/filter_main.h" + +namespace firebase { +namespace firestore { + +class CompositeFilterInternal : public FilterInternal { + public: + CompositeFilterInternal(core::CompositeFilter::Operator op, + std::vector& filters); + + core::Filter ToCoreFilter(const api::Query& query, + const firebase::firestore::UserDataConverter& + user_data_converter) const override; + + friend bool operator==(const CompositeFilterInternal& lhs, + const CompositeFilterInternal& rhs); + + protected: + bool IsEmpty() const override; + + private: + CompositeFilterInternal* clone() override; + + const core::CompositeFilter::Operator op_; + std::vector> filters_; +}; + +bool operator==(const CompositeFilterInternal& lhs, + const CompositeFilterInternal& rhs); + +inline bool operator!=(const CompositeFilterInternal& lhs, + const CompositeFilterInternal& rhs) { + return !(lhs == rhs); +} + +} // namespace firestore +} // namespace firebase + +#endif // FIREBASE_FIRESTORE_SRC_MAIN_COMPOSITE_FILTER_MAIN_H_ diff --git a/firestore/src/main/converter_main.h b/firestore/src/main/converter_main.h index 14dac38a59..a4f1146e3c 100644 --- a/firestore/src/main/converter_main.h +++ b/firestore/src/main/converter_main.h @@ -38,6 +38,7 @@ #include "firestore/src/main/aggregate_query_main.h" #include "firestore/src/main/aggregate_query_snapshot_main.h" #include "firestore/src/main/collection_reference_main.h" +#include "firestore/src/main/composite_filter_main.h" #include "firestore/src/main/document_change_main.h" #include "firestore/src/main/document_reference_main.h" #include "firestore/src/main/document_snapshot_main.h" @@ -46,6 +47,7 @@ #include "firestore/src/main/query_main.h" #include "firestore/src/main/query_snapshot_main.h" #include "firestore/src/main/transaction_main.h" +#include "firestore/src/main/unary_filter_main.h" #include "firestore/src/main/write_batch_main.h" #if defined(__ANDROID__) @@ -108,6 +110,14 @@ inline DocumentSnapshot MakePublic(api::DocumentSnapshot&& from) { return ConverterImpl::MakePublicFromCore(std::move(from)); } +inline Filter MakePublic(UnaryFilterInternal&& from) { + return ConverterImpl::MakePublicFromInternal(std::move(from)); +} + +inline Filter MakePublic(CompositeFilterInternal&& from) { + return ConverterImpl::MakePublicFromInternal(std::move(from)); +} + inline FieldValue MakePublic(FieldValueInternal&& from) { return ConverterImpl::MakePublicFromInternal(std::move(from)); } diff --git a/firestore/src/main/filter_main.cc b/firestore/src/main/filter_main.cc new file mode 100644 index 0000000000..bbc3afbcb1 --- /dev/null +++ b/firestore/src/main/filter_main.cc @@ -0,0 +1,130 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "firestore/src/main/composite_filter_main.h" +#include "firestore/src/main/converter_main.h" +#include "firestore/src/main/filter_main.h" +#include "firestore/src/main/unary_filter_main.h" + +namespace firebase { +namespace firestore { + +Filter FilterInternal::ArrayContains(const FieldPath& field, + const FieldValue& value) { + return UnaryFilter(field, FieldFilterOperator::ArrayContains, value); +} + +Filter FilterInternal::ArrayContainsAny(const FieldPath& field, + const std::vector& values) { + return UnaryFilter(field, FieldFilterOperator::ArrayContainsAny, values); +} + +Filter FilterInternal::EqualTo(const FieldPath& field, + const FieldValue& value) { + return UnaryFilter(field, FieldFilterOperator::Equal, value); +} + +Filter FilterInternal::NotEqualTo(const FieldPath& field, + const FieldValue& value) { + return UnaryFilter(field, FieldFilterOperator::NotEqual, value); +} + +Filter FilterInternal::GreaterThan(const FieldPath& field, + const FieldValue& value) { + return UnaryFilter(field, FieldFilterOperator::GreaterThan, value); +} + +Filter FilterInternal::GreaterThanOrEqualTo(const FieldPath& field, + const FieldValue& value) { + return UnaryFilter(field, FieldFilterOperator::GreaterThanOrEqual, value); +} + +Filter FilterInternal::LessThan(const FieldPath& field, + const FieldValue& value) { + return UnaryFilter(field, FieldFilterOperator::LessThan, value); +} + +Filter FilterInternal::LessThanOrEqualTo(const FieldPath& field, + const FieldValue& value) { + return UnaryFilter(field, FieldFilterOperator::LessThanOrEqual, value); +} + +Filter FilterInternal::In(const FieldPath& field, + const std::vector& values) { + return UnaryFilter(field, FieldFilterOperator::In, values); +} + +Filter FilterInternal::NotIn(const FieldPath& field, + const std::vector& values) { + return UnaryFilter(field, FieldFilterOperator::NotIn, values); +} + +Filter FilterInternal::Or(const std::vector& filters) { + return CompositeFilter(CompositeOperator::Or, filters); +} + +Filter FilterInternal::And(const std::vector& filters) { + return CompositeFilter(CompositeOperator::And, filters); +} + +FilterInternal::FilterInternal(FilterInternal::FilterType filter_type) + : filter_type_(filter_type) {} + +Filter FilterInternal::UnaryFilter(const FieldPath& field_path, + FieldFilterOperator op, + const FieldValue& value) { + return MakePublic(UnaryFilterInternal(field_path, op, value)); +} + +Filter FilterInternal::UnaryFilter(const FieldPath& field_path, + FieldFilterOperator op, + const std::vector& values) { + return MakePublic(UnaryFilterInternal(field_path, op, values)); +} + +Filter FilterInternal::CompositeFilter(core::CompositeFilter::Operator op, + const std::vector& filters) { + std::vector nonEmptyFilters{}; + for (const Filter& filter : filters) { + FilterInternal* filterInternal = GetInternal(&filter); + if (!filterInternal->IsEmpty()) { + nonEmptyFilters.push_back(filterInternal->clone()); + } + } + if (nonEmptyFilters.size() == 1) { + return Filter(nonEmptyFilters[0]); + } + return MakePublic(CompositeFilterInternal(op, nonEmptyFilters)); +} + +bool operator==(const FilterInternal& lhs, const FilterInternal& rhs) { + if (lhs.filter_type_ == rhs.filter_type_) { + switch (lhs.filter_type_) { + case FilterInternal::Composite: + return *static_cast(&lhs) == + *static_cast(&rhs); + case FilterInternal::Unary: + return *static_cast(&lhs) == + *static_cast(&rhs); + } + } + return false; +} + +} // namespace firestore +} // namespace firebase diff --git a/firestore/src/main/filter_main.h b/firestore/src/main/filter_main.h new file mode 100644 index 0000000000..fbe1f4b728 --- /dev/null +++ b/firestore/src/main/filter_main.h @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_FIRESTORE_SRC_MAIN_FILTER_MAIN_H_ +#define FIREBASE_FIRESTORE_SRC_MAIN_FILTER_MAIN_H_ + +#if defined(__ANDROID__) +#error "This header should not be used on Android." +#endif + +#include + +#include "Firestore/core/src/api/query_core.h" +#include "Firestore/core/src/core/composite_filter.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/model/field_path.h" +#include "firestore/src/include/firebase/firestore/filter.h" +#include "firestore/src/main/user_data_converter_main.h" + +namespace firebase { +namespace firestore { + +class Filter; + +class FilterInternal { + public: + static Filter ArrayContains(const FieldPath& field, const FieldValue& value); + static Filter ArrayContainsAny(const FieldPath& field, + const std::vector& values); + static Filter EqualTo(const FieldPath& field, const FieldValue& value); + static Filter NotEqualTo(const FieldPath& field, const FieldValue& value); + static Filter GreaterThan(const FieldPath& field, const FieldValue& value); + static Filter GreaterThanOrEqualTo(const FieldPath& field, + const FieldValue& value); + static Filter LessThan(const FieldPath& field, const FieldValue& value); + static Filter LessThanOrEqualTo(const FieldPath& field, + const FieldValue& value); + static Filter In(const FieldPath& field, + const std::vector& values); + static Filter NotIn(const FieldPath& field, + const std::vector& values); + static Filter Or(const std::vector& filters); + static Filter And(const std::vector& filters); + + virtual core::Filter ToCoreFilter( + const api::Query& query, + const firebase::firestore::UserDataConverter& user_data_converter) + const = 0; + + virtual ~FilterInternal() = default; + + friend bool operator==(const FilterInternal& lhs, const FilterInternal& rhs); + + protected: + enum FilterType { Unary, Composite }; + + explicit FilterInternal(FilterType filterType); + + const FilterType filter_type_; + + virtual bool IsEmpty() const = 0; + + private: + friend class Filter; + friend class QueryInternal; + + virtual FilterInternal* clone() = 0; + + using FieldFilterOperator = core::FieldFilter::Operator; + using CompositeOperator = core::CompositeFilter::Operator; + + static Filter UnaryFilter(const FieldPath& field_path, + FieldFilterOperator op, + const FieldValue& value); + static Filter UnaryFilter(const FieldPath& field_path, + FieldFilterOperator op, + const std::vector& values); + + static Filter CompositeFilter(CompositeOperator op, + const std::vector& filters); +}; + +bool operator==(const FilterInternal& lhs, const FilterInternal& rhs); + +inline bool operator!=(const FilterInternal& lhs, const FilterInternal& rhs) { + return !(lhs == rhs); +} + +} // namespace firestore +} // namespace firebase + +#endif // FIREBASE_FIRESTORE_SRC_MAIN_FILTER_MAIN_H_ diff --git a/firestore/src/main/query_main.cc b/firestore/src/main/query_main.cc index ee73ff29ea..a5d371a15e 100644 --- a/firestore/src/main/query_main.cc +++ b/firestore/src/main/query_main.cc @@ -37,6 +37,7 @@ #include "firestore/src/main/aggregate_query_main.h" #include "firestore/src/main/converter_main.h" #include "firestore/src/main/document_snapshot_main.h" +#include "firestore/src/main/filter_main.h" #include "firestore/src/main/listener_main.h" #include "firestore/src/main/promise_main.h" #include "firestore/src/main/set_options_main.h" @@ -98,31 +99,24 @@ Future QueryInternal::Get(Source source) { AggregateQuery QueryInternal::Count() { return MakePublic(query_.Count()); } +Query QueryInternal::Where(const Filter& filter) const { + SIMPLE_HARD_ASSERT(!filter.IsEmpty()); + core::Filter core_filter = + GetInternal(&filter)->ToCoreFilter(query_, user_data_converter_); + api::Query decorated = query_.AddNewFilter(std::move(core_filter)); + return MakePublic(std::move(decorated)); +} + Query QueryInternal::Where(const FieldPath& field_path, Operator op, const FieldValue& value) const { - const model::FieldPath& path = GetInternal(field_path); - Message parsed = - user_data_converter_.ParseQueryValue(value); - auto describer = [&value] { return Describe(value.type()); }; - - api::Query decorated = query_.AddNewFilter( - query_.ParseFieldFilter(path, op, std::move(parsed), describer)); - return MakePublic(std::move(decorated)); + return Where(UnaryFilterInternal::UnaryFilter(field_path, op, value)); } Query QueryInternal::Where(const FieldPath& field_path, Operator op, const std::vector& values) const { - const model::FieldPath& path = GetInternal(field_path); - auto array_value = FieldValue::Array(values); - Message parsed = - user_data_converter_.ParseQueryValue(array_value, true); - auto describer = [&array_value] { return Describe(array_value.type()); }; - - api::Query decorated = query_.AddNewFilter( - query_.ParseFieldFilter(path, op, std::move(parsed), describer)); - return MakePublic(std::move(decorated)); + return Where(UnaryFilterInternal::UnaryFilter(field_path, op, values)); } Query QueryInternal::WithBound(BoundPosition bound_pos, diff --git a/firestore/src/main/query_main.h b/firestore/src/main/query_main.h index 958df81f03..ddf773f846 100644 --- a/firestore/src/main/query_main.h +++ b/firestore/src/main/query_main.h @@ -28,6 +28,7 @@ #include "Firestore/core/src/core/query.h" #include "Firestore/core/src/nanopb/message.h" #include "firestore/src/include/firebase/firestore/field_path.h" +#include "firestore/src/include/firebase/firestore/filter.h" #include "firestore/src/include/firebase/firestore/query.h" #include "firestore/src/main/firestore_main.h" #include "firestore/src/main/promise_factory_main.h" @@ -68,6 +69,7 @@ class QueryInternal { callback); // Delegating methods + Query Where(const Filter& filter) const; Query WhereEqualTo(const FieldPath& field, const FieldValue& value) const { return Where(field, Operator::Equal, value); diff --git a/firestore/src/main/unary_filter_main.cc b/firestore/src/main/unary_filter_main.cc new file mode 100644 index 0000000000..3561ba6f60 --- /dev/null +++ b/firestore/src/main/unary_filter_main.cc @@ -0,0 +1,70 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "firestore/src/main/unary_filter_main.h" + +#include "Firestore/core/src/nanopb/message.h" +#include "firestore/src/main/converter_main.h" + +namespace firebase { +namespace firestore { + +using nanopb::Message; + +UnaryFilterInternal::UnaryFilterInternal(FieldPath field_path, + core::FieldFilter::Operator op, + FieldValue value) + : FilterInternal(FilterType::Unary), + allow_arrays_(false), + path_(std::move(field_path)), + op_(op), + value_(std::move(value)) {} + +UnaryFilterInternal::UnaryFilterInternal(FieldPath field_path, + core::FieldFilter::Operator op, + const std::vector& values) + : FilterInternal(FilterType::Unary), + allow_arrays_(true), + path_(std::move(field_path)), + op_(op), + value_(FieldValue::Array(values)) {} + +UnaryFilterInternal* UnaryFilterInternal::clone() { + return new UnaryFilterInternal(*this); +} + +core::Filter UnaryFilterInternal::ToCoreFilter( + const api::Query& query, + const firebase::firestore::UserDataConverter& user_data_converter) const { + const model::FieldPath& path = GetInternal(path_); + Message parsed = + user_data_converter.ParseQueryValue(value_, allow_arrays_); + auto describer = [this] { return Describe(value_.type()); }; + + return query.ParseFieldFilter(path, op_, std::move(parsed), describer); +} + +bool operator==(const UnaryFilterInternal& lhs, + const UnaryFilterInternal& rhs) { + return lhs.op_ == rhs.op_ && lhs.path_ == rhs.path_ && + lhs.value_ == rhs.value_; +} + +} // namespace firestore +} // namespace firebase diff --git a/firestore/src/main/unary_filter_main.h b/firestore/src/main/unary_filter_main.h new file mode 100644 index 0000000000..e23d0c9481 --- /dev/null +++ b/firestore/src/main/unary_filter_main.h @@ -0,0 +1,70 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIREBASE_FIRESTORE_SRC_MAIN_UNARY_FILTER_MAIN_H_ +#define FIREBASE_FIRESTORE_SRC_MAIN_UNARY_FILTER_MAIN_H_ + +#if defined(__ANDROID__) +#error "This header should not be used on Android." +#endif + +#include + +#include "Firestore/core/src/api/query_core.h" +#include "firestore/src/main/filter_main.h" + +namespace firebase { +namespace firestore { + +class UnaryFilterInternal final : public FilterInternal { + public: + UnaryFilterInternal(FieldPath field_path, + core::FieldFilter::Operator op, + FieldValue value); + UnaryFilterInternal(FieldPath field_path, + core::FieldFilter::Operator op, + const std::vector& values); + + core::Filter ToCoreFilter(const api::Query& query, + const firebase::firestore::UserDataConverter& + user_data_converter) const override; + + friend bool operator==(const UnaryFilterInternal& lhs, + const UnaryFilterInternal& rhs); + + protected: + bool IsEmpty() const override { return false; } + + private: + UnaryFilterInternal* clone() override; + + const bool allow_arrays_ = false; + const FieldPath path_; + const core::FieldFilter::Operator op_; + const FieldValue value_; +}; + +bool operator==(const UnaryFilterInternal& lhs, const UnaryFilterInternal& rhs); + +inline bool operator!=(const UnaryFilterInternal& lhs, + const UnaryFilterInternal& rhs) { + return !(lhs == rhs); +} + +} // namespace firestore +} // namespace firebase + +#endif // FIREBASE_FIRESTORE_SRC_MAIN_UNARY_FILTER_MAIN_H_ diff --git a/gma/src/android/gma_android.cc b/gma/src/android/gma_android.cc index 8ce19c7295..3ec5103f82 100644 --- a/gma/src/android/gma_android.cc +++ b/gma/src/android/gma_android.cc @@ -920,6 +920,7 @@ void JNI_completeLoadedAd(JNIEnv* env, jclass clazz, jlong data_ptr, void JNI_NativeAd_completeLoadedAd(JNIEnv* env, jclass clazz, jlong data_ptr, jlong native_internal_data_ptr, jobject j_icon, jobjectArray j_images, + jobject j_adchoices_icon, jobject j_response_info) { FIREBASE_ASSERT(env); FIREBASE_ASSERT(data_ptr); @@ -938,10 +939,22 @@ void JNI_NativeAd_completeLoadedAd(JNIEnv* env, jclass clazz, jlong data_ptr, // Invoke a friend of NativeAdInternal to update its icon image asset. GmaInternal::InsertNativeInternalImage(native_ad_internal, icon_internal, - true, true); + "icon", true); env->DeleteLocalRef(j_icon); } + // getAdChoicesInfo().getImages() can return an empty list and a valid ad can + // exist without an adchoices icon image. + if (j_adchoices_icon != nullptr) { + NativeAdImageInternal adchoices_icon_internal; + adchoices_icon_internal.native_ad_image = j_adchoices_icon; + + // Invoke a friend of NativeAdInternal to update its icon image asset. + GmaInternal::InsertNativeInternalImage( + native_ad_internal, adchoices_icon_internal, "adchoices_icon", true); + env->DeleteLocalRef(j_adchoices_icon); + } + const size_t len = env->GetArrayLength(j_images); // Loop through images array. for (size_t i = 0; i < len; ++i) { @@ -949,7 +962,7 @@ void JNI_NativeAd_completeLoadedAd(JNIEnv* env, jclass clazz, jlong data_ptr, NativeAdImageInternal image_internal; image_internal.native_ad_image = j_image; GmaInternal::InsertNativeInternalImage(native_ad_internal, image_internal, - false, false); + "image", false); } FutureCallbackData* callback_data = @@ -1240,7 +1253,7 @@ bool RegisterNatives() { {"completeNativeLoadedAd", "(JJLcom/google/android/gms/ads/nativead/NativeAd$Image;[Lcom/google/" "android/gms/ads/nativead/NativeAd$Image;Lcom/google/android/gms/ads/" - "ResponseInfo;)V", + "nativead/NativeAd$Image;Lcom/google/android/gms/ads/ResponseInfo;)V", reinterpret_cast(&JNI_NativeAd_completeLoadedAd)}, {"completeNativeLoadAdError", "(JLcom/google/android/gms/ads/LoadAdError;ILjava/lang/String;)V", diff --git a/gma/src/common/gma_common.cc b/gma/src/common/gma_common.cc index eed08ca387..891086de17 100644 --- a/gma/src/common/gma_common.cc +++ b/gma/src/common/gma_common.cc @@ -123,15 +123,15 @@ void GmaInternal::UpdateAdViewInternalAdSizeDimensions( void GmaInternal::InsertNativeInternalImage( internal::NativeAdInternal* native_ad_internal, - const NativeAdImageInternal& native_image_internal, const bool& is_icon, - const bool& clear_existing_images) { + const NativeAdImageInternal& native_image_internal, + const std::string& image_type, const bool& clear_existing_images) { assert(native_ad_internal); if (clear_existing_images) { native_ad_internal->clear_existing_images(); } NativeAdImage image_asset = NativeAdImage(native_image_internal); - native_ad_internal->insert_image(image_asset, is_icon); + native_ad_internal->insert_image(image_asset, image_type); } // AdInspectorClosedListener diff --git a/gma/src/common/gma_common.h b/gma/src/common/gma_common.h index 38fcf0a185..ad1343ed41 100644 --- a/gma/src/common/gma_common.h +++ b/gma/src/common/gma_common.h @@ -200,8 +200,8 @@ class GmaInternal { // NativeAdInternal. static void InsertNativeInternalImage( internal::NativeAdInternal* native_ad_internal, - const NativeAdImageInternal& native_image_internal, const bool& is_icon, - const bool& clear_existing_images); + const NativeAdImageInternal& native_image_internal, + const std::string& image_type, const bool& clear_existing_images); }; } // namespace gma diff --git a/gma/src/common/native_ad.cc b/gma/src/common/native_ad.cc index fd110f1d70..c479293b41 100644 --- a/gma/src/common/native_ad.cc +++ b/gma/src/common/native_ad.cc @@ -85,6 +85,10 @@ const std::vector& NativeAd::images() const { return internal_->images(); } +const NativeAdImage& NativeAd::adchoices_icon() const { + return internal_->adchoices_icon(); +} + Future NativeAd::RecordImpression(const Variant& impression_data) { if (!impression_data.is_map()) { return CreateAndCompleteFuture( diff --git a/gma/src/common/native_ad_internal.cc b/gma/src/common/native_ad_internal.cc index 84804860d6..c0a568beed 100644 --- a/gma/src/common/native_ad_internal.cc +++ b/gma/src/common/native_ad_internal.cc @@ -62,13 +62,16 @@ Future NativeAdInternal::GetLoadAdLastResult() { } void NativeAdInternal::insert_image(const NativeAdImage& image, - const bool& is_icon) { - if (is_icon) { + const std::string& image_type) { + if (image_type == "icon") { icon_ = image; + } else if (image_type == "adchoices_icon") { + adchoices_icon_ = image; } else { images_.push_back(image); } } + void NativeAdInternal::clear_existing_images() { images_.clear(); } } // namespace internal diff --git a/gma/src/common/native_ad_internal.h b/gma/src/common/native_ad_internal.h index f07843d7a2..2f60433d22 100644 --- a/gma/src/common/native_ad_internal.h +++ b/gma/src/common/native_ad_internal.h @@ -70,6 +70,9 @@ class NativeAdInternal { // Returns the associated image assets of the native ad. const std::vector& images() const { return images_; } + // Returns the associated icon asset of the native ad. + const NativeAdImage& adchoices_icon() const { return adchoices_icon_; } + // Only used by allowlisted ad units. virtual Future RecordImpression(const Variant& impression_data) = 0; @@ -86,7 +89,8 @@ class NativeAdInternal { explicit NativeAdInternal(NativeAd* base); // Invoked after a native ad has been loaded to fill native ad image assets. - void insert_image(const NativeAdImage& ad_image, const bool& is_icon); + void insert_image(const NativeAdImage& ad_image, + const std::string& image_type); // Invoked before filling native ad image assets. void clear_existing_images(); @@ -102,6 +106,9 @@ class NativeAdInternal { // Tracks the native ad image assets. std::vector images_; + + // Tracks the native ad choices icon asset. + NativeAdImage adchoices_icon_; }; } // namespace internal diff --git a/gma/src/include/firebase/gma/internal/native_ad.h b/gma/src/include/firebase/gma/internal/native_ad.h index bc60a6ce68..674cbcac82 100644 --- a/gma/src/include/firebase/gma/internal/native_ad.h +++ b/gma/src/include/firebase/gma/internal/native_ad.h @@ -73,6 +73,9 @@ class NativeAd { /// Returns the associated image assets of the native ad. const std::vector& images() const; + // Returns the associated adchoices icon asset of the native ad. + const NativeAdImage& adchoices_icon() const; + /// Only allowlisted ad units use this api. Future RecordImpression(const Variant& impression_data); diff --git a/gma/src/ios/GADNativeAdCpp.h b/gma/src/ios/GADNativeAdCpp.h index c1e769c725..d1b521f4b7 100644 --- a/gma/src/ios/GADNativeAdCpp.h +++ b/gma/src/ios/GADNativeAdCpp.h @@ -20,6 +20,9 @@ @interface GADNativeAd() +/// AdChoices icon image. +@property(nonatomic, readonly, strong, nullable) GADNativeAdImage *adChoicesIcon; + /// Used only by allowlisted ad units. Provide a dictionary containing click data. - (void)performClickWithData:(nonnull NSDictionary *)clickData; diff --git a/gma/src/ios/native_ad_internal_ios.mm b/gma/src/ios/native_ad_internal_ios.mm index 0aac7ff0e4..70c705e937 100644 --- a/gma/src/ios/native_ad_internal_ios.mm +++ b/gma/src/ios/native_ad_internal_ios.mm @@ -227,7 +227,15 @@ { NativeAdImageInternal icon_internal; icon_internal.native_ad_image = gad_icon; - GmaInternal::InsertNativeInternalImage(this, icon_internal, true, true ); + GmaInternal::InsertNativeInternalImage(this, icon_internal, "icon", true ); + } + + NSObject *gad_choices_icon = ad.adChoicesIcon; + if (gad_choices_icon != nil) + { + NativeAdImageInternal adchoices_icon_internal; + adchoices_icon_internal.native_ad_image = gad_choices_icon; + GmaInternal::InsertNativeInternalImage(this, adchoices_icon_internal, "adchoices_icon", true ); } NSArray *gad_images = ad.images; @@ -235,7 +243,7 @@ { NativeAdImageInternal image_internal; image_internal.native_ad_image = gad_image; - GmaInternal::InsertNativeInternalImage(this, image_internal, false, false ); + GmaInternal::InsertNativeInternalImage(this, image_internal, "image", false ); } if (ad_load_callback_data_ != nil) { diff --git a/gma/src_java/com/google/firebase/gma/internal/cpp/NativeAdHelper.java b/gma/src_java/com/google/firebase/gma/internal/cpp/NativeAdHelper.java index d002cc1723..69fca0eaa9 100644 --- a/gma/src_java/com/google/firebase/gma/internal/cpp/NativeAdHelper.java +++ b/gma/src_java/com/google/firebase/gma/internal/cpp/NativeAdHelper.java @@ -247,8 +247,18 @@ public void onNativeAdLoaded(NativeAd ad) { NativeAd.Image[] imgArray = new NativeAd.Image[imgList.size()]; imgArray = imgList.toArray(imgArray); + NativeAd.Image adChoicesIcon = null; + NativeAd.AdChoicesInfo adChoicesInfo = ad.getAdChoicesInfo(); + if (adChoicesInfo != null) { + List adChoicesImgList = adChoicesInfo.getImages(); + if (!adChoicesImgList.isEmpty()) { + // Gets only the first image to keep the api in sync with its ios counterpart. + adChoicesIcon = adChoicesImgList.get(0); + } + } + completeNativeLoadedAd(mLoadAdCallbackDataPtr, mNativeAdInternalPtr, ad.getIcon(), - imgArray, ad.getResponseInfo()); + imgArray, adChoicesIcon, ad.getResponseInfo()); mLoadAdCallbackDataPtr = CPP_NULLPTR; } } @@ -262,7 +272,7 @@ public static native void completeNativeAdFutureCallback( /** Native callback invoked upon successfully loading an ad. */ public static native void completeNativeLoadedAd(long nativeInternalPtr, long mNativeAdInternalPtr, NativeAd.Image icon, NativeAd.Image[] images, - ResponseInfo responseInfo); + NativeAd.Image adChoicesIcon, ResponseInfo responseInfo); /** * Native callback upon encountering an error loading an Ad Request. Returns Android Google Mobile diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 6e0680c9b8..446b730a13 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -136,6 +136,8 @@ Google Mobile Ads | libfirebase_gma.a | | (Maven package) | | com.google.android.gms:play-services-ads:22.3.0 | | (Maven package) +| | com.google.android.ump:user-messaging-platform:2.1.0 +| | (Maven package) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a | | com.google.firebase:firebase-installations @@ -252,6 +254,7 @@ Google Mobile Ads | firebase_gma.xcframework | | firebase.xcframework | | Firebase/CoreOnly Cocoapod (10.15.0) | | Google-Mobile-Ads-SDK Cocoapod (10.10.0) +| | GoogleUserMessagingPlatform Cocoapod (2.1.0) Firebase Installations | firebase_installations.xcframework | | firebase.xcframework | | FirebaseInstallations Cocoapod (10.15.0) @@ -314,6 +317,7 @@ Google Mobile Ads | libfirebase_gma.a | | libfirebase_app.a | | Firebase/CoreOnly Cocoapod (10.15.0) | | Google-Mobile-Ads-SDK Cocoapod (10.10.0) +| | GoogleUserMessagingPlatform Cocoapod (2.1.0) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a | | FirebaseInstallations Cocoapod (10.15.0) @@ -627,6 +631,21 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### Next Release +- Changes + - Firestore: Add support for disjunctions in queries (OR queries) + ([#1453](https://github.com/firebase/firebase-cpp-sdk/pull/1453)). + - GMA: Added the User Messaging Platform (UMP) SDK, required for obtaining + consent from users before showing ads. See the [Get Started + Guide](https://firebase.google.com/docs/admob/cpp/privacy/) for more + information. + - GMA (iOS): Added a new Cocoapod dependency for the UMP SDK: + GoogleUserMessagingPlatform version 2.1.0. + - GMA (Android): Added a new Maven package dependency for the UMP SDK: + com.google.android.ump:user-messaging-platform version 2.1.0. This + dependency will automatically be included if you include "gma" in the + firebaseCpp.dependencies list in your build.gradle file. + ### 11.5.0 - Changes - General (iOS): Update to Firebase Cocoapods version 10.15.0. @@ -649,8 +668,6 @@ code. - General (iOS): 32-bit iOS builds (i386 and armv7) are no longer supported. - General: Add FirebaseApp.GetApps(), to return the list of `firebase::App` instances. - GMA (Android): Fixed a crash when initializing GMA without a Firebase App. - - Firestore: Add support for disjunctions in queries (OR queries) - ([#1335](https://github.com/firebase/firebase-cpp-sdk/pull/1335)). ### 11.3.0 - Changes From f561ecd6bdd3149e9aa2139e86faea9afe17a6a5 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 Oct 2023 14:06:10 -0700 Subject: [PATCH 11/13] Modify GMA minimum Android SDK to 21. --- gma/integration_test/AndroidManifest.xml | 2 +- gma/integration_test/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gma/integration_test/AndroidManifest.xml b/gma/integration_test/AndroidManifest.xml index c45d3ff5e5..84cd08da84 100644 --- a/gma/integration_test/AndroidManifest.xml +++ b/gma/integration_test/AndroidManifest.xml @@ -22,7 +22,7 @@ - + Date: Thu, 5 Oct 2023 11:05:57 -0700 Subject: [PATCH 12/13] Update UMP reference docs (#1456) * Updated some reference doc text. * Typo fix. --- .../include/firebase/gma/ump/consent_info.h | 33 +++++++++++++++---- gma/src/include/firebase/gma/ump/types.h | 2 +- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/gma/src/include/firebase/gma/ump/consent_info.h b/gma/src/include/firebase/gma/ump/consent_info.h index c092f6f8f1..439a0b7abb 100644 --- a/gma/src/include/firebase/gma/ump/consent_info.h +++ b/gma/src/include/firebase/gma/ump/consent_info.h @@ -39,11 +39,16 @@ namespace internal { class ConsentInfoInternal; } // namespace internal +/// @brief Consent Information class for the User Messaging Platform SDK. +/// +/// The User Messaging Platform (UMP) SDK is Google’s option to handle user +/// privacy and consent in mobile apps. +/// /// This class contains all of the methods necessary for obtaining /// consent from the user. class ConsentInfo { public: - /// Shut down the User Messaging Platform Consent SDK + /// Shut down the User Messaging Platform Consent SDK. ~ConsentInfo(); /// Initializes the User Messaging Platform Consent SDK. @@ -109,6 +114,9 @@ class ConsentInfo { /// @return A pointer to the ConsentInfo instance. Each call to GetInstance() /// will return the same pointer; when you are finished using the SDK, you can /// delete the pointer, and the UMP SDK will shut down. + /// + /// @note Once any overload of ConsentInfo::GetInstance has been called, you + /// can use this method to obtain the same instance again. static ConsentInfo* GetInstance(InitResult* init_result_out = nullptr); #endif // !defined(__ANDROID__) || defined(DOXYGEN) @@ -119,10 +127,10 @@ class ConsentInfo { /// Requests consent information update. Must be called in every app session /// before checking the user’s consent status or loading a consent form. After - /// calling this method, GetConsentStatus() will be updated immediately to - /// hold the consent state from the previous app session, if one - /// exists. GetConsentStatus() may be updated again immediately before the - /// returned future is completed. + /// calling this method, GetConsentStatus() and CanRequestAds() will be + /// updated immediately to hold the consent state from the previous app + /// session, if one exists. GetConsentStatus() and CanRequestAds() may be + /// updated again immediately before the returned future is completed. Future RequestConsentInfoUpdate(const ConsentRequestParameters& params); /// Get the Future from the most recent call to RequestConsentInfoUpdate(). @@ -144,7 +152,11 @@ class ConsentInfo { /// will be dismissed and the Future will be completed after the user selects /// an option. /// - /// GetConsentStatus() is updated when the returned Future is completed. + /// GetConsentStatus() and CanRequestAds() are updated when the returned + /// Future is completed. + /// + /// @param[in] parent A FormParent, which is an Activity object on Android and + /// a UIViewController object on iOS. /// /// @note You must call LoadConsentForm() and wait for it to complete before /// calling this method. @@ -160,7 +172,11 @@ class ConsentInfo { /// (and the form is dismissed), or if the form is not required. The Future /// will be completed with an error if the form fails to load or show. /// - /// GetConsentStatus() will be updated prior to the Future being completed. + /// GetConsentStatus() and CanRequestAds() will be updated prior to the Future + /// being completed. + /// + /// @param[in] parent A FormParent, which is an Activity object on Android and + /// a UIViewController object on iOS. Future LoadAndShowConsentFormIfRequired(FormParent parent); /// Get the Future from the most recent call to @@ -184,6 +200,9 @@ class ConsentInfo { /// presented. The privacy options form is preloaded by the SDK automatically /// when a form becomes available. If no form has been preloaded, the SDK will /// try to load one asynchronously. + /// + /// @param[in] parent A FormParent, which is an Activity object on Android and + /// a UIViewController object on iOS. Future ShowPrivacyOptionsForm(FormParent parent); /// Get the Future from the most recent call to ShowPrivacyOptionsForm(). diff --git a/gma/src/include/firebase/gma/ump/types.h b/gma/src/include/firebase/gma/ump/types.h index af29182d16..0684858582 100644 --- a/gma/src/include/firebase/gma/ump/types.h +++ b/gma/src/include/firebase/gma/ump/types.h @@ -47,7 +47,7 @@ enum ConsentDebugGeography { }; /// Debug settings for `ConsentInfo::RequestConsentInfoUpdate()`. These let you -/// force a speific geographic location. Be sure to include debug device IDs to +/// force a specific geographic location. Be sure to include debug device IDs to /// enable this on hardware. Debug features are always enabled for simulators. struct ConsentDebugSettings { /// Create a default debug setting, with debugging disabled. From e6be82273f713c482178c2a51aa64ca84b383f61 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Thu, 5 Oct 2023 16:44:49 -0700 Subject: [PATCH 13/13] UMP iOS crash fix (#1463) * Add debug log. * Add additional mutex locks. * Update UMP reference docs (#1456) * Updated some reference doc text. * Typo fix. * Add some debug logs for completion handler. * More debugging, and add an Fn slot for the OperationInProgress errors. * Add an instance tag to ensure that callbacks on iOS don't execute on the wrong instance. * Also verify instance before calling the native iOS method. * Format code. * Fix integration test structure. * Remove debug logging. * Fixes and added delay * Format code and comments. * Remove obsolete enum. * Format code. * Refactor OperationInProgress test into two tests. * Add a main queue flush to the GMA test class. * Format. --- gma/integration_test/src/integration_test.cc | 232 +++++++++++++------ gma/src/ios/ump/consent_info_internal_ios.h | 1 + gma/src/ios/ump/consent_info_internal_ios.mm | 106 +++++++-- 3 files changed, 260 insertions(+), 79 deletions(-) diff --git a/gma/integration_test/src/integration_test.cc b/gma/integration_test/src/integration_test.cc index b51a96d3af..f09bf216d7 100644 --- a/gma/integration_test/src/integration_test.cc +++ b/gma/integration_test/src/integration_test.cc @@ -256,6 +256,7 @@ FirebaseGmaTest::~FirebaseGmaTest() {} void FirebaseGmaTest::SetUp() { TEST_DOES_NOT_REQUIRE_USER_INTERACTION; + ProcessEvents(100); // Flush main thread queue. FirebaseTest::SetUp(); // This example uses ad units that are specially configured to return test ads @@ -2484,7 +2485,7 @@ class FirebaseGmaUmpTest : public FirebaseGmaTest { enum ResetOption { kReset, kNoReset }; void InitializeUmp(ResetOption reset = kReset); - void TerminateUmp(); + void TerminateUmp(ResetOption reset = kReset); void SetUp() override; void TearDown() override; @@ -2506,9 +2507,11 @@ void FirebaseGmaUmpTest::InitializeUmp(ResetOption reset) { } } -void FirebaseGmaUmpTest::TerminateUmp() { +void FirebaseGmaUmpTest::TerminateUmp(ResetOption reset) { if (consent_info_) { - consent_info_->Reset(); + if (reset == kReset) { + consent_info_->Reset(); + } delete consent_info_; consent_info_ = nullptr; } @@ -2901,47 +2904,121 @@ TEST_F(FirebaseGmaUmpTest, TestCanRequestAdsEEA) { } TEST_F(FirebaseGmaUmpTest, TestUmpCleanupWithDelay) { + // Ensure that if ConsentInfo is deleted after a delay, Futures are + // properly invalidated. using firebase::gma::ump::ConsentFormStatus; using firebase::gma::ump::ConsentRequestParameters; using firebase::gma::ump::ConsentStatus; ConsentRequestParameters params; params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); + firebase::Future future_request = consent_info_->RequestConsentInfoUpdate(params); firebase::Future future_load = consent_info_->LoadConsentForm(); firebase::Future future_show = consent_info_->ShowConsentForm(app_framework::GetWindowController()); + firebase::Future future_load_and_show = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + firebase::Future future_privacy = consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); ProcessEvents(5000); - delete consent_info_; - consent_info_ = nullptr; + TerminateUmp(kNoReset); EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid); EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid); EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load_and_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_privacy.status(), firebase::kFutureStatusInvalid); } TEST_F(FirebaseGmaUmpTest, TestUmpCleanupRaceCondition) { + // Ensure that if ConsentInfo is deleted immediately, operations + // (and their Futures) are properly invalidated. + using firebase::gma::ump::ConsentFormStatus; using firebase::gma::ump::ConsentRequestParameters; using firebase::gma::ump::ConsentStatus; ConsentRequestParameters params; params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); + firebase::Future future_request = consent_info_->RequestConsentInfoUpdate(params); firebase::Future future_load = consent_info_->LoadConsentForm(); firebase::Future future_show = consent_info_->ShowConsentForm(app_framework::GetWindowController()); + firebase::Future future_load_and_show = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + firebase::Future future_privacy = consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); - delete consent_info_; - consent_info_ = nullptr; + TerminateUmp(kNoReset); EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid); EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid); EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load_and_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_privacy.status(), firebase::kFutureStatusInvalid); + + ProcessEvents(5000); +} + +TEST_F(FirebaseGmaUmpTest, TestUmpCallbacksOnWrongInstance) { + // Ensure that if ConsentInfo is deleted and then recreated, stale + // callbacks don't call into the new instance. + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyNonEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); + + firebase::Future future_request = + consent_info_->RequestConsentInfoUpdate(params); + firebase::Future future_load = consent_info_->LoadConsentForm(); + firebase::Future future_show = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); + firebase::Future future_load_and_show = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + firebase::Future future_privacy = consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); + + TerminateUmp(kNoReset); + + EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load_and_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_privacy.status(), firebase::kFutureStatusInvalid); + + InitializeUmp(kNoReset); + + EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_load_and_show.status(), firebase::kFutureStatusInvalid); + EXPECT_EQ(future_privacy.status(), firebase::kFutureStatusInvalid); + + // Give the operations time to complete. + ProcessEvents(5000); } TEST_F(FirebaseGmaUmpTest, TestUmpMethodsReturnOperationInProgress) { @@ -2952,18 +3029,15 @@ TEST_F(FirebaseGmaUmpTest, TestUmpMethodsReturnOperationInProgress) { using firebase::gma::ump::ConsentStatus; // Check that all of the UMP operations properly return an OperationInProgress - // error if called more than once at the same time. Each step of this test is - // inherently flaky, so add flaky test blocks all over. + // error if called more than once at the same time. ConsentRequestParameters params; params.tag_for_under_age_of_consent = false; params.debug_settings.debug_geography = - ShouldRunUITests() ? firebase::gma::ump::kConsentDebugGeographyEEA - : firebase::gma::ump::kConsentDebugGeographyNonEEA; + firebase::gma::ump::kConsentDebugGeographyNonEEA; params.debug_settings.debug_device_ids = kTestDeviceIDs; params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); - FLAKY_TEST_SECTION_BEGIN(); firebase::Future future_request_1 = consent_info_->RequestConsentInfoUpdate(params); firebase::Future future_request_2 = @@ -2972,62 +3046,88 @@ TEST_F(FirebaseGmaUmpTest, TestUmpMethodsReturnOperationInProgress) { future_request_2, "RequestConsentInfoUpdate second", firebase::gma::ump::kConsentRequestErrorOperationInProgress); WaitForCompletion(future_request_1, "RequestConsentInfoUpdate first"); - FLAKY_TEST_SECTION_END(); - if (ShouldRunUITests()) { - // The below should only be checked if UI tests are enabled, as they - // require some interaction. - FLAKY_TEST_SECTION_BEGIN(); - firebase::Future future_load_1 = consent_info_->LoadConsentForm(); - firebase::Future future_load_2 = consent_info_->LoadConsentForm(); - WaitForCompletion(future_load_2, "LoadConsentForm second", - firebase::gma::ump::kConsentFormErrorOperationInProgress); - WaitForCompletion(future_load_1, "LoadConsentForm first"); - FLAKY_TEST_SECTION_END(); - - FLAKY_TEST_SECTION_BEGIN(); - firebase::Future future_show_1 = - consent_info_->ShowConsentForm(app_framework::GetWindowController()); - firebase::Future future_show_2 = - consent_info_->ShowConsentForm(app_framework::GetWindowController()); - WaitForCompletion(future_show_2, "ShowConsentForm second", - firebase::gma::ump::kConsentFormErrorOperationInProgress); - WaitForCompletion(future_show_1, "ShowConsentForm first"); - FLAKY_TEST_SECTION_END(); - - FLAKY_TEST_SECTION_BEGIN(); - firebase::Future future_privacy_1 = - consent_info_->ShowPrivacyOptionsForm( - app_framework::GetWindowController()); - firebase::Future future_privacy_2 = - consent_info_->ShowPrivacyOptionsForm( - app_framework::GetWindowController()); - WaitForCompletion(future_privacy_2, "ShowPrivacyOptionsForm second", - firebase::gma::ump::kConsentFormErrorOperationInProgress); - WaitForCompletion(future_privacy_1, "ShowPrivacyOptionsForm first"); - FLAKY_TEST_SECTION_END(); + firebase::Future future_load_and_show_1 = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + firebase::Future future_load_and_show_2 = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + WaitForCompletion(future_load_and_show_2, + "LoadAndShowConsentFormIfRequired second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_load_and_show_1, + "LoadAndShowConsentFormIfRequired first"); +} - consent_info_->Reset(); - // Request again so we can test LoadAndShowConsentFormIfRequired. - WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), - "RequestConsentInfoUpdate"); - - FLAKY_TEST_SECTION_BEGIN(); - firebase::Future future_load_and_show_1 = - consent_info_->LoadAndShowConsentFormIfRequired( - app_framework::GetWindowController()); - firebase::Future future_load_and_show_2 = - consent_info_->LoadAndShowConsentFormIfRequired( - app_framework::GetWindowController()); - WaitForCompletion(future_load_and_show_2, - "LoadAndShowConsentFormIfRequired second", - firebase::gma::ump::kConsentFormErrorOperationInProgress); - WaitForCompletion(future_load_and_show_1, - "LoadAndShowConsentFormIfRequired first"); - FLAKY_TEST_SECTION_END(); - } else { - LogInfo("Skipping methods that require user interaction."); - } +TEST_F(FirebaseGmaUmpTest, TestUmpMethodsReturnOperationInProgressWithUI) { + SKIP_TEST_ON_DESKTOP; + TEST_REQUIRES_USER_INTERACTION; + + using firebase::gma::ump::ConsentFormStatus; + using firebase::gma::ump::ConsentRequestParameters; + using firebase::gma::ump::ConsentStatus; + + // Check that all of the UMP operations properly return an OperationInProgress + // error if called more than once at the same time. This test include methods + // with UI interaction. + + ConsentRequestParameters params; + params.tag_for_under_age_of_consent = false; + params.debug_settings.debug_geography = + firebase::gma::ump::kConsentDebugGeographyEEA; + params.debug_settings.debug_device_ids = kTestDeviceIDs; + params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId()); + + firebase::Future future_request_1 = + consent_info_->RequestConsentInfoUpdate(params); + firebase::Future future_request_2 = + consent_info_->RequestConsentInfoUpdate(params); + WaitForCompletion( + future_request_2, "RequestConsentInfoUpdate second", + firebase::gma::ump::kConsentRequestErrorOperationInProgress); + WaitForCompletion(future_request_1, "RequestConsentInfoUpdate first"); + + firebase::Future future_load_1 = consent_info_->LoadConsentForm(); + firebase::Future future_load_2 = consent_info_->LoadConsentForm(); + WaitForCompletion(future_load_2, "LoadConsentForm second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_load_1, "LoadConsentForm first"); + + firebase::Future future_show_1 = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); + firebase::Future future_show_2 = + consent_info_->ShowConsentForm(app_framework::GetWindowController()); + WaitForCompletion(future_show_2, "ShowConsentForm second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_show_1, "ShowConsentForm first"); + + firebase::Future future_privacy_1 = + consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); + firebase::Future future_privacy_2 = + consent_info_->ShowPrivacyOptionsForm( + app_framework::GetWindowController()); + WaitForCompletion(future_privacy_2, "ShowPrivacyOptionsForm second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_privacy_1, "ShowPrivacyOptionsForm first"); + + consent_info_->Reset(); + // Request again so we can test LoadAndShowConsentFormIfRequired. + WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params), + "RequestConsentInfoUpdate"); + + firebase::Future future_load_and_show_1 = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + firebase::Future future_load_and_show_2 = + consent_info_->LoadAndShowConsentFormIfRequired( + app_framework::GetWindowController()); + WaitForCompletion(future_load_and_show_2, + "LoadAndShowConsentFormIfRequired second", + firebase::gma::ump::kConsentFormErrorOperationInProgress); + WaitForCompletion(future_load_and_show_1, + "LoadAndShowConsentFormIfRequired first"); } } // namespace firebase_testapp_automated diff --git a/gma/src/ios/ump/consent_info_internal_ios.h b/gma/src/ios/ump/consent_info_internal_ios.h index 5472c91d4a..6e860edb40 100644 --- a/gma/src/ios/ump/consent_info_internal_ios.h +++ b/gma/src/ios/ump/consent_info_internal_ios.h @@ -52,6 +52,7 @@ class ConsentInfoInternalIos : public ConsentInfoInternal { private: static ConsentInfoInternalIos* s_instance; static firebase::Mutex s_instance_mutex; + static unsigned int s_instance_tag; void SetLoadedForm(UMPConsentForm *form) { loaded_form_ = form; diff --git a/gma/src/ios/ump/consent_info_internal_ios.mm b/gma/src/ios/ump/consent_info_internal_ios.mm index 266f554328..13ef55bcf1 100644 --- a/gma/src/ios/ump/consent_info_internal_ios.mm +++ b/gma/src/ios/ump/consent_info_internal_ios.mm @@ -27,7 +27,7 @@ ConsentInfoInternalIos* ConsentInfoInternalIos::s_instance = nullptr; firebase::Mutex ConsentInfoInternalIos::s_instance_mutex; - +unsigned int ConsentInfoInternalIos::s_instance_tag = 0; // This explicitly implements the constructor for the outer class, // ConsentInfoInternal. @@ -40,6 +40,9 @@ MutexLock lock(s_instance_mutex); FIREBASE_ASSERT(s_instance == nullptr); s_instance = this; + // Increment this with each created instance, to ensure that any leftover + // callbacks don't run if a new instance is created. + s_instance_tag++; } ConsentInfoInternalIos::~ConsentInfoInternalIos() { @@ -99,13 +102,16 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { UMPRequestParameters *ios_parameters = [[UMPRequestParameters alloc] init]; ios_parameters.tagForUnderAgeOfConsent = params.tag_for_under_age_of_consent ? YES : NO; UMPDebugSettings *ios_debug_settings = [[UMPDebugSettings alloc] init]; + bool has_debug_settings = false; switch(params.debug_settings.debug_geography) { case kConsentDebugGeographyEEA: ios_debug_settings.geography = UMPDebugGeographyEEA; + has_debug_settings = true; break; case kConsentDebugGeographyNonEEA: ios_debug_settings.geography = UMPDebugGeographyNotEEA; + has_debug_settings = true; break; case kConsentDebugGeographyDisabled: ios_debug_settings.geography = UMPDebugGeographyDisabled; @@ -114,17 +120,39 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { if (params.debug_settings.debug_device_ids.size() > 0) { ios_debug_settings.testDeviceIdentifiers = firebase::util::StringVectorToNSMutableArray(params.debug_settings.debug_device_ids); + has_debug_settings = true; + } + if (has_debug_settings) { + ios_parameters.debugSettings = ios_debug_settings; + } + + unsigned int callback_instance_tag; + { + MutexLock lock(s_instance_mutex); + callback_instance_tag = s_instance_tag; } - ios_parameters.debugSettings = ios_debug_settings; util::DispatchAsyncSafeMainQueue(^{ + { + MutexLock lock(s_instance_mutex); + if (!s_instance || s_instance_tag != callback_instance_tag) { + // Instance changed or was invalidated, don't call the iOS method any more. + return; + } + } [UMPConsentInformation.sharedInstance requestConsentInfoUpdateWithParameters:ios_parameters completionHandler:^(NSError *_Nullable error){ if (!error) { - CompleteFuture(handle, kConsentRequestSuccess); + MutexLock lock(s_instance_mutex); + if (s_instance && s_instance_tag == callback_instance_tag) { + CompleteFuture(handle, kConsentRequestSuccess); + } } else { - CompleteFuture(handle, CppRequestErrorFromIosRequestError(error.code), error.localizedDescription.UTF8String); + MutexLock lock(s_instance_mutex); + if (s_instance && s_instance_tag == callback_instance_tag) { + CompleteFuture(handle, CppRequestErrorFromIosRequestError(error.code), error.localizedDescription.UTF8String); + } } }]; }); @@ -181,23 +209,36 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadConsentForm); loaded_form_ = nil; + unsigned int callback_instance_tag; + { + MutexLock lock(s_instance_mutex); + callback_instance_tag = s_instance_tag; + } + util::DispatchAsyncSafeMainQueue(^{ + { + MutexLock lock(s_instance_mutex); + if (!s_instance || s_instance_tag != callback_instance_tag) { + // Instance changed or was invalidated, don't call the iOS method any more. + return; + } + } [UMPConsentForm loadWithCompletionHandler:^(UMPConsentForm *_Nullable form, NSError *_Nullable error){ if (form) { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { SetLoadedForm(form); CompleteFuture(handle, kConsentFormSuccess, "Success"); } } else if (error) { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); } } else { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, kConsentFormErrorUnknown, "An unknown error occurred."); } } @@ -221,17 +262,30 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { CompleteFuture(handle, kConsentFormErrorInvalidOperation, "You must call LoadConsentForm() prior to calling ShowConsentForm()."); } else { + unsigned int callback_instance_tag; + { + MutexLock lock(s_instance_mutex); + callback_instance_tag = s_instance_tag; + } + util::DispatchAsyncSafeMainQueue(^{ + { + MutexLock lock(s_instance_mutex); + if (!s_instance || s_instance_tag != callback_instance_tag) { + // Instance changed or was invalidated, don't call the iOS method any more. + return; + } + } [loaded_form_ presentFromViewController:parent completionHandler:^(NSError *_Nullable error){ if (!error) { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, kConsentRequestSuccess); } } else { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); } } @@ -255,17 +309,30 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { SafeFutureHandle handle = CreateFuture(kConsentInfoFnLoadAndShowConsentFormIfRequired); + unsigned int callback_instance_tag; + { + MutexLock lock(s_instance_mutex); + callback_instance_tag = s_instance_tag; + } + util::DispatchAsyncSafeMainQueue(^{ + { + MutexLock lock(s_instance_mutex); + if (!s_instance || s_instance_tag != callback_instance_tag) { + // Instance changed or was invalidated, don't call the iOS method any more. + return; + } + } [UMPConsentForm loadAndPresentIfRequiredFromViewController:parent completionHandler:^(NSError *_Nullable error){ if (!error) { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, kConsentRequestSuccess); } } else { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); } } @@ -303,17 +370,30 @@ static ConsentFormError CppFormErrorFromIosFormError(NSInteger code) { SafeFutureHandle handle = CreateFuture(kConsentInfoFnShowPrivacyOptionsForm); + unsigned int callback_instance_tag; + { + MutexLock lock(s_instance_mutex); + callback_instance_tag = s_instance_tag; + } + util::DispatchAsyncSafeMainQueue(^{ + { + MutexLock lock(s_instance_mutex); + if (!s_instance || s_instance_tag != callback_instance_tag) { + // Instance changed or was invalidated, don't call the iOS method any more. + return; + } + } [UMPConsentForm presentPrivacyOptionsFormFromViewController:parent completionHandler:^(NSError *_Nullable error){ if (!error) { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, kConsentRequestSuccess); } } else { MutexLock lock(s_instance_mutex); - if (s_instance) { + if (s_instance && s_instance_tag == callback_instance_tag) { CompleteFuture(handle, CppFormErrorFromIosFormError(error.code), error.localizedDescription.UTF8String); } }