diff --git a/analytics/integration_test/Podfile b/analytics/integration_test/Podfile index cc2b93c7db..cc5bd5c1b4 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, '13.0' - pod 'Firebase/Analytics', '10.28.1' + pod 'Firebase/Analytics', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Analytics', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Analytics', '11.0.0' end post_install do |installer| diff --git a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj index bac325982d..c9f051f91c 100644 --- a/analytics/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/analytics/integration_test/integration_test.xcodeproj/project.pbxproj @@ -565,7 +565,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -616,7 +616,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/analytics/ios_headers/FIREventNames.h b/analytics/ios_headers/FIREventNames.h index cdab3ebab4..38c09e4c4f 100644 --- a/analytics/ios_headers/FIREventNames.h +++ b/analytics/ios_headers/FIREventNames.h @@ -1,6 +1,6 @@ // Copyright 2024 Google LLC -// Copied from Firebase Analytics iOS SDK 10.28.1. +// Copied from Firebase Analytics iOS SDK 11.0.0. /// @file FIREventNames.h /// diff --git a/analytics/ios_headers/FIRParameterNames.h b/analytics/ios_headers/FIRParameterNames.h index 4f60b2f9dc..8249dc97f3 100644 --- a/analytics/ios_headers/FIRParameterNames.h +++ b/analytics/ios_headers/FIRParameterNames.h @@ -1,6 +1,6 @@ // Copyright 2024 Google LLC -// Copied from Firebase Analytics iOS SDK 10.28.1. +// Copied from Firebase Analytics iOS SDK 11.0.0. /// @file FIRParameterNames.h /// diff --git a/analytics/ios_headers/FIRUserPropertyNames.h b/analytics/ios_headers/FIRUserPropertyNames.h index f7af176e5b..ae5d7595ad 100644 --- a/analytics/ios_headers/FIRUserPropertyNames.h +++ b/analytics/ios_headers/FIRUserPropertyNames.h @@ -1,6 +1,6 @@ // Copyright 2024 Google LLC -// Copied from Firebase Analytics iOS SDK 10.28.1. +// Copied from Firebase Analytics iOS SDK 11.0.0. /// @file FIRUserPropertyNames.h /// diff --git a/app/integration_test/Podfile b/app/integration_test/Podfile index 5be3f21f65..744e0590cd 100644 --- a/app/integration_test/Podfile +++ b/app/integration_test/Podfile @@ -4,7 +4,7 @@ platform :ios, '13.0' use_frameworks! :linkage => :static target 'integration_test' do - pod 'Firebase/Analytics', '10.28.1' + pod 'Firebase/Analytics', '11.0.0' end post_install do |installer| diff --git a/app_check/integration_test/Podfile b/app_check/integration_test/Podfile index d17e04dc72..5e46862ca5 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, '13.0' - pod 'Firebase/AppCheck', '10.28.1' - pod 'Firebase/Database', '10.28.1' - pod 'Firebase/Auth', '10.28.1' - pod 'Firebase/Storage', '10.28.1' - pod 'Firebase/Functions', '10.28.1' + pod 'Firebase/AppCheck', '11.0.0' + pod 'Firebase/Database', '11.0.0' + pod 'Firebase/Auth', '11.0.0' + pod 'Firebase/Storage', '11.0.0' + pod 'Firebase/Functions', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/AppCheck', '10.28.1' - pod 'Firebase/Database', '10.28.1' - pod 'Firebase/Auth', '10.28.1' - pod 'Firebase/Storage', '10.28.1' - pod 'Firebase/Functions', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/AppCheck', '11.0.0' + pod 'Firebase/Database', '11.0.0' + pod 'Firebase/Auth', '11.0.0' + pod 'Firebase/Storage', '11.0.0' + pod 'Firebase/Functions', '11.0.0' end post_install do |installer| diff --git a/app_check/integration_test/integration_test.xcodeproj/project.pbxproj b/app_check/integration_test/integration_test.xcodeproj/project.pbxproj index 3a1e31ed11..3fd980e78d 100644 --- a/app_check/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/app_check/integration_test/integration_test.xcodeproj/project.pbxproj @@ -514,7 +514,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -565,7 +565,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/auth/CMakeLists.txt b/auth/CMakeLists.txt index 5ffbc2ec71..7749c68bc4 100644 --- a/auth/CMakeLists.txt +++ b/auth/CMakeLists.txt @@ -174,6 +174,7 @@ target_include_directories(firebase_auth ${CMAKE_CURRENT_LIST_DIR}/src/include PRIVATE ${FIREBASE_CPP_SDK_ROOT_DIR} + ${FIREBASE_CPP_SDK_ROOT_DIR}/ios_pod/swift_headers ${additional_include_DIR} ) target_compile_definitions(firebase_auth @@ -201,6 +202,7 @@ elseif(IOS) POD_NAMES FirebaseCore FirebaseAuth + FirebaseAuthInterop/FirebaseAuth/Interop ) if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks") set_target_properties(firebase_auth PROPERTIES diff --git a/auth/integration_test/Podfile b/auth/integration_test/Podfile index bd89bb51a5..f3d81ceb4a 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, '13.0' - pod 'Firebase/Auth', '10.28.1' + pod 'Firebase/Auth', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Auth', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Auth', '11.0.0' end post_install do |installer| diff --git a/auth/integration_test/integration_test.xcodeproj/project.pbxproj b/auth/integration_test/integration_test.xcodeproj/project.pbxproj index 6d2510ae09..5781ea7d39 100644 --- a/auth/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/auth/integration_test/integration_test.xcodeproj/project.pbxproj @@ -592,7 +592,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -643,7 +643,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/auth/src/ios/auth_ios.mm b/auth/src/ios/auth_ios.mm index e98fd6aaa7..a0292ba3b8 100644 --- a/auth/src/ios/auth_ios.mm +++ b/auth/src/ios/auth_ios.mm @@ -14,11 +14,13 @@ * limitations under the License. */ -#import "FIRAdditionalUserInfo.h" -#import "FIRAuthDataResult.h" +#import + #import "FIRAuthErrors.h" -#import "FIROAuthCredential.h" #import "FIROptions.h" +#import "FirebaseAuthInterop/FIRAuthInterop.h" +// This needs to be after the FIRAuthInterop import +#import "FirebaseAuth-Swift.h" #include "app/src/app_ios.h" #include "app/src/assert.h" diff --git a/auth/src/ios/common_ios.h b/auth/src/ios/common_ios.h index 0915f514ab..797c73686e 100644 --- a/auth/src/ios/common_ios.h +++ b/auth/src/ios/common_ios.h @@ -18,13 +18,13 @@ #define FIREBASE_AUTH_SRC_IOS_COMMON_IOS_H_ #import +#import #import "FIRAuth.h" -#import "FIRAuthCredential.h" -#import "FIROAuthProvider.h" #import "FIRUser.h" -#import "FIRUserInfo.h" -#import "FIRUserMetadata.h" +#import "FirebaseAuthInterop/FIRAuthInterop.h" +// This needs to be after the FIRAuthInterop import +#import "FirebaseAuth-Swift.h" #include "app/src/log.h" #include "app/src/util_ios.h" diff --git a/auth/src/ios/credential_ios.mm b/auth/src/ios/credential_ios.mm index c40944228d..a308437a17 100644 --- a/auth/src/ios/credential_ios.mm +++ b/auth/src/ios/credential_ios.mm @@ -19,6 +19,7 @@ #include "auth/src/ios/common_ios.h" #import +#import #import "FIREmailAuthProvider.h" #import "FIRFacebookAuthProvider.h" @@ -26,7 +27,9 @@ #import "FIRGameCenterAuthProvider.h" #import "FIRGitHubAuthProvider.h" #import "FIRGoogleAuthProvider.h" -#import "FIROAuthProvider.h" +#import "FirebaseAuthInterop/FIRAuthInterop.h" +// This needs to be after the FIRAuthInterop import +#import "FirebaseAuth-Swift.h" #if FIREBASE_PLATFORM_IOS // PhoneAuth is not supported on non-iOS Apple platforms (eg: tvOS). @@ -442,6 +445,7 @@ explicit PhoneAuthProviderData(FIRPhoneAuthProvider* objc_provider) assert(auth_data); ReferenceCountedFutureImpl& futures = auth_data->future_impl; const auto handle = futures.SafeAlloc(kAuthFn_SignInWithProvider, AuthResult()); +#if FIREBASE_PLATFORM_IOS FIROAuthProvider* ios_provider = (FIROAuthProvider*)[FIROAuthProvider providerWithProviderID:@(provider_data_.provider_id.c_str()) auth:AuthImpl(auth_data)]; @@ -462,6 +466,12 @@ explicit PhoneAuthProviderData(FIRPhoneAuthProvider* objc_provider) AuthResult()); return future; } + +#else // non-iOS Apple platforms (eg: tvOS) + Future future = MakeFuture(&futures, handle); + futures.Complete(handle, kAuthErrorApiNotAvailable, + "OAuth provider sign-in is not supported on non-iOS Apple platforms."); +#endif // FIREBASE_PLATFORM_IOS } Future FederatedOAuthProvider::Link(AuthData* auth_data) { diff --git a/auth/src/ios/user_ios.mm b/auth/src/ios/user_ios.mm index 66af881947..f05bb23b14 100644 --- a/auth/src/ios/user_ios.mm +++ b/auth/src/ios/user_ios.mm @@ -17,10 +17,6 @@ #include "app/src/time.h" #include "auth/src/ios/common_ios.h" -#if FIREBASE_PLATFORM_IOS -#import "FIRPhoneAuthCredential.h" -#endif - namespace firebase { namespace auth { diff --git a/cmake/external/firestore.cmake b/cmake/external/firestore.cmake index 0d432f8d8e..3223822c8f 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.28.1) +set(version CocoaPods-11.0.0) function(GetReleasedDep) message("Getting released firebase-ios-sdk @ ${version}") diff --git a/cmake/toolchains/apple.toolchain.cmake b/cmake/toolchains/apple.toolchain.cmake index 68d38a8133..1549b7662c 100644 --- a/cmake/toolchains/apple.toolchain.cmake +++ b/cmake/toolchains/apple.toolchain.cmake @@ -257,7 +257,7 @@ if(NOT DEFINED DEPLOYMENT_TARGET) set(DEPLOYMENT_TARGET "13.0") else() # Unless specified, SDK version 11.0 is used by default as minimum target version (iOS, tvOS). - set(DEPLOYMENT_TARGET "11.0") + set(DEPLOYMENT_TARGET "13.0") endif() message(STATUS "[DEFAULTS] Using the default min-version since DEPLOYMENT_TARGET not provided!") elseif(DEFINED DEPLOYMENT_TARGET AND PLATFORM STREQUAL "MAC_CATALYST" AND ${DEPLOYMENT_TARGET} VERSION_LESS "13.0") diff --git a/cmake/toolchains/ios.cmake b/cmake/toolchains/ios.cmake index 7cbe5c4a72..dcdf533d7f 100644 --- a/cmake/toolchains/ios.cmake +++ b/cmake/toolchains/ios.cmake @@ -35,7 +35,7 @@ set(CMAKE_OSX_ARCHITECTURES arm64 CACHE STRING "") set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") -set(CMAKE_OSX_DEPLOYMENT_TARGET "8.0" CACHE STRING "") +set(CMAKE_OSX_DEPLOYMENT_TARGET "13.0" CACHE STRING "") # skip TRY_COMPILE checks set(CMAKE_CXX_COMPILER_WORKS TRUE) diff --git a/cmake/toolchains/ios_simulator.cmake b/cmake/toolchains/ios_simulator.cmake index cc3095b551..1336faef89 100644 --- a/cmake/toolchains/ios_simulator.cmake +++ b/cmake/toolchains/ios_simulator.cmake @@ -17,7 +17,7 @@ set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING "") set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") -set(CMAKE_OSX_DEPLOYMENT_TARGET "8.0" CACHE STRING "") +set(CMAKE_OSX_DEPLOYMENT_TARGET "13.0" CACHE STRING "") set(IOS_PLATFORM_LOCATION "iPhoneSimulator.platform") # skip TRY_COMPILE checks diff --git a/database/integration_test/Podfile b/database/integration_test/Podfile index 557e9eaa0c..ca5752145b 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, '13.0' - pod 'Firebase/Database', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + pod 'Firebase/Database', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Database', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Database', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end post_install do |installer| diff --git a/database/integration_test/integration_test.xcodeproj/project.pbxproj b/database/integration_test/integration_test.xcodeproj/project.pbxproj index b5d9bfd544..93dafe662f 100644 --- a/database/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/database/integration_test/integration_test.xcodeproj/project.pbxproj @@ -514,7 +514,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -565,7 +565,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/dynamic_links/integration_test/Podfile b/dynamic_links/integration_test/Podfile index 237e58d4e6..b28257ec21 100644 --- a/dynamic_links/integration_test/Podfile +++ b/dynamic_links/integration_test/Podfile @@ -5,7 +5,7 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '13.0' - pod 'Firebase/DynamicLinks', '10.28.1' + pod 'Firebase/DynamicLinks', '11.0.0' end post_install do |installer| diff --git a/firestore/integration_test/Podfile b/firestore/integration_test/Podfile index fa8f9fe252..b791854bcd 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, '13.0' - pod 'Firebase/Firestore', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + pod 'Firebase/Firestore', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Firestore', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end post_install do |installer| diff --git a/firestore/integration_test/integration_test.xcodeproj/project.pbxproj b/firestore/integration_test/integration_test.xcodeproj/project.pbxproj index c2ab69f010..befed2f456 100644 --- a/firestore/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/firestore/integration_test/integration_test.xcodeproj/project.pbxproj @@ -613,7 +613,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -667,7 +667,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/firestore/integration_test_internal/Podfile b/firestore/integration_test_internal/Podfile index f43b5d970a..a1450d3cd1 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, '13.0' - pod 'Firebase/Firestore', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + pod 'Firebase/Firestore', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Firestore', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Firestore', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end post_install do |installer| diff --git a/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj b/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj index c4238c5c7d..b1df9429a5 100644 --- a/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj +++ b/firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj @@ -948,7 +948,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -1018,7 +1018,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/firestore/src/main/create_app_check_credentials_provider_ios.mm b/firestore/src/main/create_app_check_credentials_provider_ios.mm index 13549a14ac..dfc6d8d6fe 100644 --- a/firestore/src/main/create_app_check_credentials_provider_ios.mm +++ b/firestore/src/main/create_app_check_credentials_provider_ios.mm @@ -17,10 +17,10 @@ #include "firestore/src/main/create_credentials_provider.h" #import "FIRAppInternal.h" -#import "FIRAuthInterop.h" #import "FIRComponent.h" #import "FIRComponentContainer.h" #import "FIRComponentType.h" +#import "FirebaseAuthInterop/FIRAuthInterop.h" #import "FirebaseCore.h" #include "Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.h" diff --git a/firestore/src/main/create_credentials_provider_ios.mm b/firestore/src/main/create_credentials_provider_ios.mm index abbf74c5b2..a6999a3b69 100644 --- a/firestore/src/main/create_credentials_provider_ios.mm +++ b/firestore/src/main/create_credentials_provider_ios.mm @@ -19,10 +19,10 @@ #include #import "FIRAppInternal.h" -#import "FIRAuthInterop.h" #import "FIRComponent.h" #import "FIRComponentContainer.h" #import "FIRComponentType.h" +#import "FirebaseAuthInterop/FIRAuthInterop.h" #import "FirebaseCore.h" #include "Firestore/core/src/credentials/firebase_auth_credentials_provider_apple.h" diff --git a/functions/integration_test/Podfile b/functions/integration_test/Podfile index 9fa495b0d3..31e68d92bf 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, '13.0' - pod 'Firebase/Functions', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + pod 'Firebase/Functions', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Functions', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Functions', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end post_install do |installer| diff --git a/functions/integration_test/integration_test.xcodeproj/project.pbxproj b/functions/integration_test/integration_test.xcodeproj/project.pbxproj index b88ff637fc..f41dfd0e5a 100644 --- a/functions/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/functions/integration_test/integration_test.xcodeproj/project.pbxproj @@ -599,7 +599,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -654,7 +654,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/gma/integration_test/Podfile b/gma/integration_test/Podfile index 3f35ccaa75..9d1b9753fc 100644 --- a/gma/integration_test/Podfile +++ b/gma/integration_test/Podfile @@ -5,7 +5,7 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '13.0' - pod 'Firebase/CoreOnly', '10.28.1' + pod 'Firebase/CoreOnly', '11.0.0' pod 'Google-Mobile-Ads-SDK', '11.2.0' pod 'GoogleUserMessagingPlatform', '2.3.0' end diff --git a/installations/integration_test/Podfile b/installations/integration_test/Podfile index 4b7eda38f0..98a738136b 100644 --- a/installations/integration_test/Podfile +++ b/installations/integration_test/Podfile @@ -5,8 +5,8 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '13.0' - pod 'Firebase/Analytics', '10.28.1' - pod 'Firebase/Installations', '10.28.1' + pod 'Firebase/Analytics', '11.0.0' + pod 'Firebase/Installations', '11.0.0' end post_install do |installer| diff --git a/ios_pod/Podfile b/ios_pod/Podfile index 12540faf0a..ffa3e49260 100644 --- a/ios_pod/Podfile +++ b/ios_pod/Podfile @@ -3,22 +3,22 @@ platform :ios, '13.0' use_frameworks! target 'GetPods' do - pod 'Firebase/Core', '10.28.1' + pod 'Firebase/Core', '11.0.0' pod 'Google-Mobile-Ads-SDK', '11.2.0' pod 'GoogleUserMessagingPlatform', '2.3.0' - pod 'Firebase/Analytics', '10.28.1' - pod 'Firebase/AppCheck', '10.28.1' - pod 'Firebase/Auth', '10.28.1' - pod 'Firebase/Crashlytics', '10.28.1' - pod 'Firebase/Database', '10.28.1' - pod 'Firebase/DynamicLinks', '10.28.1' - pod 'Firebase/Firestore', '10.28.1' - pod 'Firebase/Functions', '10.28.1' - pod 'Firebase/Installations', '10.28.1' - pod 'Firebase/Messaging', '10.28.1' - pod 'Firebase/RemoteConfig', '10.28.1' - pod 'Firebase/Storage', '10.28.1' + pod 'Firebase/Analytics', '11.0.0' + pod 'Firebase/AppCheck', '11.0.0' + pod 'Firebase/Auth', '11.0.0' + pod 'Firebase/Crashlytics', '11.0.0' + pod 'Firebase/Database', '11.0.0' + pod 'Firebase/DynamicLinks', '11.0.0' + pod 'Firebase/Firestore', '11.0.0' + pod 'Firebase/Functions', '11.0.0' + pod 'Firebase/Installations', '11.0.0' + pod 'Firebase/Messaging', '11.0.0' + pod 'Firebase/RemoteConfig', '11.0.0' + pod 'Firebase/Storage', '11.0.0' end diff --git a/ios_pod/swift_headers/FirebaseAnalytics-Swift.h b/ios_pod/swift_headers/FirebaseAnalytics-Swift.h index e8874893c0..cb79f4bb10 100644 --- a/ios_pod/swift_headers/FirebaseAnalytics-Swift.h +++ b/ios_pod/swift_headers/FirebaseAnalytics-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -338,7 +338,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseAuth-Swift.h b/ios_pod/swift_headers/FirebaseAuth-Swift.h new file mode 100644 index 0000000000..4e06d458dc --- /dev/null +++ b/ios_pod/swift_headers/FirebaseAuth-Swift.h @@ -0,0 +1,6060 @@ +#if 0 +#elif defined(__arm64__) && __arm64__ +// Copyright 2024 Google LLC +// Copied from Firebase iOS SDK 11.0.0. + +// Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 +// clang-1500.1.0.2.5) +#ifndef FIREBASEAUTH_SWIFT_H +#define FIREBASEAUTH_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 "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include + +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#endif +#if defined(__cplusplus) +#if defined(__arm64e__) && __has_include() +#include +#else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-macro-identifier" +#ifndef __ptrauth_swift_value_witness_function_pointer +#define __ptrauth_swift_value_witness_function_pointer(x) +#endif +#ifndef __ptrauth_swift_class_method_pointer +#define __ptrauth_swift_class_method_pointer(x) +#endif +#pragma clang diagnostic pop +#endif +#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 !defined(SWIFT_RUNTIME_NAME) +#if __has_attribute(objc_runtime_name) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +#define SWIFT_RUNTIME_NAME(X) +#endif +#endif +#if !defined(SWIFT_COMPILE_NAME) +#if __has_attribute(swift_name) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +#define SWIFT_COMPILE_NAME(X) +#endif +#endif +#if !defined(SWIFT_METHOD_FAMILY) +#if __has_attribute(objc_method_family) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +#define SWIFT_METHOD_FAMILY(X) +#endif +#endif +#if !defined(SWIFT_NOESCAPE) +#if __has_attribute(noescape) +#define SWIFT_NOESCAPE __attribute__((noescape)) +#else +#define SWIFT_NOESCAPE +#endif +#endif +#if !defined(SWIFT_RELEASES_ARGUMENT) +#if __has_attribute(ns_consumed) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +#define SWIFT_RELEASES_ARGUMENT +#endif +#endif +#if !defined(SWIFT_WARN_UNUSED_RESULT) +#if __has_attribute(warn_unused_result) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define SWIFT_WARN_UNUSED_RESULT +#endif +#endif +#if !defined(SWIFT_NORETURN) +#if __has_attribute(noreturn) +#define SWIFT_NORETURN __attribute__((noreturn)) +#else +#define SWIFT_NORETURN +#endif +#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 __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 !defined(SWIFT_DEPRECATED_OBJC) +#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 +#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(SWIFT_INDIRECT_RESULT) +#define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#endif +#if !defined(SWIFT_CONTEXT) +#define SWIFT_CONTEXT __attribute__((swift_context)) +#endif +#if !defined(SWIFT_ERROR_RESULT) +#define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#endif +#if defined(__cplusplus) +#define SWIFT_NOEXCEPT noexcept +#else +#define SWIFT_NOEXCEPT +#endif +#if !defined(SWIFT_C_INLINE_THUNK) +#if __has_attribute(always_inline) +#if __has_attribute(nodebug) +#define SWIFT_C_INLINE_THUNK \ + inline __attribute__((always_inline)) __attribute__((nodebug)) +#else +#define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) +#endif +#else +#define SWIFT_C_INLINE_THUNK inline +#endif +#endif +#if defined(_WIN32) +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +#define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) +#endif +#else +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +#define SWIFT_IMPORT_STDLIB_SYMBOL +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(objc_modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import FirebaseAuthInterop; +@import Foundation; +@import ObjectiveC; +@import UIKit; +#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 = "FirebaseAuth", \ + generated_declaration))), \ + apply_to = \ + any(function, enum, objc_interface, objc_category, objc_protocol)) +#pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +enum FIRActionCodeOperation : NSInteger; +@class NSString; + +/// Manages information regarding action codes. +SWIFT_CLASS_NAMED("ActionCodeInfo") +@interface FIRActionCodeInfo : NSObject +/// The operation being performed. +@property(nonatomic, readonly) enum FIRActionCodeOperation operation; +/// The email address to which the code was sent. The new email address in the +/// case of ActionCodeOperation.recoverEmail. +@property(nonatomic, readonly, copy) NSString *_Nonnull email; +/// The email that is being recovered in the case of +/// ActionCodeOperation.recoverEmail. +@property(nonatomic, readonly, copy) NSString *_Nullable previousEmail; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Operations which can be performed with action codes. +typedef SWIFT_ENUM_NAMED(NSInteger, FIRActionCodeOperation, + "ActionCodeOperation", open){ + /// Action code for unknown operation. + FIRActionCodeOperationUnknown = 0, + /// Action code for password reset operation. + FIRActionCodeOperationPasswordReset = 1, + /// Action code for verify email operation. + FIRActionCodeOperationVerifyEmail = 2, + /// Action code for recover email operation. + FIRActionCodeOperationRecoverEmail = 3, + /// Action code for email link operation. + FIRActionCodeOperationEmailLink = 4, + /// Action code for verifying and changing email. + FIRActionCodeOperationVerifyAndChangeEmail = 5, + /// Action code for reverting second factor addition. + FIRActionCodeOperationRevertSecondFactorAddition = 6, +}; + +@class NSURL; + +/// Used to set and retrieve settings related to handling action codes. +SWIFT_CLASS_NAMED("ActionCodeSettings") +@interface FIRActionCodeSettings : NSObject +/// This URL represents the state/Continue URL in the form of a universal link. +/// This URL can should be constructed as a universal link that would either +/// directly open the app where the action code would be handled or continue to +/// the app after the action code is handled by Firebase. +@property(nonatomic, copy) NSURL *_Nullable URL; +/// Indicates whether the action code link will open the app directly or after +/// being redirected from a Firebase owned web widget. +@property(nonatomic) BOOL handleCodeInApp; +/// The iOS bundle ID, if available. The default value is the current app’s +/// bundle ID. +@property(nonatomic, copy) NSString *_Nullable iOSBundleID; +/// The Android package name, if available. +@property(nonatomic, copy) NSString *_Nullable androidPackageName; +/// The minimum Android version supported, if available. +@property(nonatomic, copy) NSString *_Nullable androidMinimumVersion; +/// Indicates whether the Android app should be installed on a device where it +/// is not available. +@property(nonatomic) BOOL androidInstallIfNotAvailable; +/// The Firebase Dynamic Link domain used for out of band code flow. +@property(nonatomic, copy) NSString *_Nullable dynamicLinkDomain; +/// Sets the iOS bundle ID. +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +/// Sets the Android package name, the flag to indicate whether or not to +/// install the app, and the minimum Android version supported. If +/// installIfNotAvailable is set to true and the link +/// is opened on an android device, it will try to install the app if not +/// already available. Otherwise the web URL is used. \param androidPackageName +/// The Android package name. +/// +/// \param installIfNotAvailable Indicates whether or not the app should be +/// installed if not available. +/// +/// \param minimumVersion The minimum version of Android supported. +/// +- (void)setAndroidPackageName:(NSString *_Nonnull)androidPackageName + installIfNotAvailable:(BOOL)installIfNotAvailable + minimumVersion:(NSString *_Nullable)minimumVersion; +@end + +/// This class will allow developers to easily extract information about out of +/// band links. +SWIFT_CLASS_NAMED("ActionCodeURL") +@interface FIRActionCodeURL : NSObject +/// Returns the API key from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSString *_Nullable APIKey; +/// Returns the mode of oob action. +/// The property will be of ActionCodeOperation type. +/// It will return .unknown if no oob action is provided. +@property(nonatomic, readonly) enum FIRActionCodeOperation operation; +/// Returns the email action code from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSString *_Nullable code; +/// Returns the continue URL from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSURL *_Nullable continueURL; +/// Returns the language code from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSString *_Nullable languageCode; +/// Construct an ActionCodeURL from an out of band link (e.g. email +/// link). \param link The oob link string used to construct the action code +/// URL. +/// +/// +/// returns: +/// The ActionCodeURL object constructed based on the oob link provided. +- (nullable instancetype)actionCodeURLWithLink:(NSString *_Nonnull)link + OBJC_DESIGNATED_INITIALIZER SWIFT_METHOD_FAMILY(init); +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class NSCoder; + +SWIFT_CLASS_NAMED("AdditionalUserInfo") +@interface FIRAdditionalUserInfo : NSObject +/// The provider identifier. +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// Dictionary containing the additional IdP specific information. +@property(nonatomic, readonly, copy) + NSDictionary *_Nullable profile; +/// The name of the user. +@property(nonatomic, readonly, copy) NSString *_Nullable username; +/// Indicates whether or not the current user was signed in for the first time. +@property(nonatomic, readonly) BOOL isNewUser; +/// Indicates whether or not the current user was signed in for the first time. +- (BOOL)newUser SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)aDecoder + OBJC_DESIGNATED_INITIALIZER; +- (void)encodeWithCoder:(NSCoder *_Nonnull)aCoder; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@interface FIRAdditionalUserInfo (SWIFT_EXTENSION (FirebaseAuth)) < + NSSecureCoding> +@end + +@class FIRApp; +@class FIRUser; +@class FIRAuthSettings; +@class FIRAuthDataResult; +@protocol FIRFederatedAuthProvider; +@protocol FIRAuthUIDelegate; +@class FIRAuthCredential; +@protocol NSObject; +@class NSError; +@class NSData; +enum FIRAuthAPNSTokenType : NSInteger; + +/// Manages authentication for Firebase apps. +/// This class is thread-safe. +SWIFT_CLASS_NAMED("Auth") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRAuth + : NSObject +/// Gets the auth object for the default Firebase app. +/// The default Firebase app must have already been configured or an exception +/// will be raised. ++ (FIRAuth *_Nonnull)auth SWIFT_WARN_UNUSED_RESULT; +/// Gets the auth object for a FirebaseApp. +/// \param app The app for which to retrieve the associated Auth +/// instance. +/// +/// +/// returns: +/// The Auth instance associated with the given app. ++ (FIRAuth *_Nonnull)authWithApp:(FIRApp *_Nonnull)app SWIFT_WARN_UNUSED_RESULT; +/// Gets the FirebaseApp object that this auth object is connected +/// to. +@property(nonatomic, readonly, weak) FIRApp *_Nullable app; +/// Synchronously gets the cached current user, or null if there is none. +@property(nonatomic, readonly, strong) FIRUser *_Nullable currentUser; +/// The current user language code. +/// This property can be set to the app’s current language by +/// calling useAppLanguage(). +/// The string used to set this property must be a language code that follows +/// BCP 47. +@property(nonatomic, copy) NSString *_Nullable languageCode; +/// Contains settings related to the auth object. +@property(nonatomic, strong) FIRAuthSettings *_Nullable settings; +/// The current user access group that the Auth instance is using. +/// Default is nil. +@property(nonatomic, readonly, copy) NSString *_Nullable userAccessGroup; +/// Contains shareAuthStateAcrossDevices setting related to the auth object. +/// If userAccessGroup is not set, setting shareAuthStateAcrossDevices will +/// have no effect. You should set shareAuthStateAcrossDevices to its desired +/// state and then set the userAccessGroup after. +@property(nonatomic) BOOL shareAuthStateAcrossDevices; +/// The tenant ID of the auth instance. nil if none is available. +@property(nonatomic, copy) NSString *_Nullable tenantID; +/// The custom authentication domain used to handle all sign-in redirects. +/// End-users will see +/// this domain when signing in. This domain must be allowlisted in the Firebase +/// Console. +@property(nonatomic, copy) NSString *_Nullable customAuthDomain; +/// Sets the currentUser on the receiver to the provided user +/// object. \param user The user object to be set as the current user of the +/// calling Auth instance. +/// +/// \param completion Optionally; a block invoked after the user of the calling +/// Auth instance has been updated or an error was encountered. +/// +- (void)updateCurrentUser:(FIRUser *_Nullable)user + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// [Deprecated] Fetches the list of all sign-in methods previously used for the +/// provided email address. This method returns an empty list when Email +/// Enumeration Protection is enabled, irrespective of the number of +/// authentication methods available for the given email. Possible error codes: +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. \param email The email address for which to obtain a list of +/// sign-in methods. +/// +/// \param completion Optionally; a block which is invoked when the list of sign +/// in methods for the specified email address is ready or an error was +/// encountered. Invoked asynchronously on the main thread in the future. +/// +- (void)fetchSignInMethodsForEmail:(NSString *_Nonnull)email + completion: + (void (^_Nullable)(NSArray *_Nullable, + NSError *_Nullable))completion + SWIFT_DEPRECATED_MSG( + "`fetchSignInMethods` is deprecated and will be removed in a future " + "release. This method returns an empty list when Email Enumeration " + "Protection is enabled."); +/// Signs in using an email address and password. +/// When Email +/// Enumeration Protection is enabled, this method fails with an error in +/// case of an invalid email/password. Possible error codes:
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
+/// \param email The user’s email address. +/// +/// \param password The user’s password. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithEmail:(NSString *_Nonnull)email + password:(NSString *_Nonnull)password + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Signs in using an email address and email sign-in link. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
+/// \param email The user’s email address. +/// +/// \param link The email sign-in link. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithEmail:(NSString *_Nonnull)email + link:(NSString *_Nonnull)link + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Signs in using the provided auth provider instance. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password. +///
  • +///
  • +/// AuthErrorCodeWebNetworkRequestFailed - Indicates that a +/// network request within a SFSafariViewController or WKWebView failed. +///
  • +///
  • +/// AuthErrorCodeWebInternalError - Indicates that an internal +/// error occurred within a SFSafariViewController or WKWebView. +///
  • +///
  • +/// AuthErrorCodeWebSignInUserInteractionFailure - Indicates a +/// general failure during a web sign-in flow. +///
  • +///
  • +/// AuthErrorCodeWebContextAlreadyPresented - Indicates that an +/// attempt was made to present a new web context while one was already +/// being presented. +///
  • +///
  • +/// AuthErrorCodeWebContextCancelled - Indicates that the URL +/// presentation was cancelled prematurely by the user. +///
  • +///
  • +/// AuthErrorCodeAccountExistsWithDifferentCredential - +/// Indicates the email asserted by the credential (e.g. the email in a +/// Facebook access token) is already in use by an existing account, that +/// cannot be authenticated with this sign-in method. Call +/// fetchProvidersForEmail for this user’s email and then prompt them to +/// sign in with any of the sign-in providers returned. This error will only +/// be thrown if the “One account per email address” setting is enabled in +/// the Firebase console, under Auth settings. +///
  • +///
+/// \param provider An instance of an auth provider used to initiate the sign-in +/// flow. +/// +/// \param uiDelegate Optionally an instance of a class conforming to the +/// AuthUIDelegate protocol, this is used for presenting the web context. If +/// nil, a default AuthUIDelegate will be used. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithProvider:(id _Nonnull)provider + UIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion + SWIFT_AVAILABILITY(watchos, unavailable) + SWIFT_AVAILABILITY(macos, unavailable) + SWIFT_AVAILABILITY(tvos, unavailable); +/// Asynchronously signs in to Firebase with the given 3rd-party credentials +/// (e.g. a Facebook login Access Token, a Google ID Token/Access Token pair, +/// etc.) and returns additional identity provider data. Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidCredential - Indicates the supplied +/// credential is invalid. This could happen if it has expired or it is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that accounts +/// with the identity provider represented by the credential are not +/// enabled. Enable them in the Auth section of the Firebase console. +///
  • +///
  • +/// AuthErrorCodeAccountExistsWithDifferentCredential - +/// Indicates the email asserted by the credential (e.g. the email in a +/// Facebook access token) is already in use by an existing account, that +/// cannot be authenticated with this sign-in method. Call +/// fetchProvidersForEmail for this user’s email and then prompt them to +/// sign in with any of the sign-in providers returned. This error will only +/// be thrown if the “One account per email address” setting is enabled in +/// the Firebase console, under Auth settings. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password, if credential is of the type +/// EmailPasswordAuthCredential. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeMissingVerificationID - Indicates that the +/// phone auth credential was created with an empty verification ID. +///
  • +///
  • +/// AuthErrorCodeMissingVerificationCode - Indicates that the +/// phone auth credential was created with an empty verification code. +///
  • +///
  • +/// AuthErrorCodeInvalidVerificationCode - Indicates that the +/// phone auth credential was created with an invalid verification Code. +///
  • +///
  • +/// AuthErrorCodeInvalidVerificationID - Indicates that the +/// phone auth credential was created with an invalid verification ID. +///
  • +///
  • +/// AuthErrorCodeSessionExpired - Indicates that the SMS code +/// has expired. +///
  • +///
+/// \param credential The credential supplied by the IdP. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithCredential:(FIRAuthCredential *_Nonnull)credential + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously creates and becomes an anonymous user. +/// If there is already an anonymous user signed in, that user will be returned +/// instead. If there is any other existing user signed in, that user will be +/// signed out. Possible error codes:
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that anonymous +/// accounts are not enabled. Enable them in the Auth section of the +/// Firebase console. +///
  • +///
+/// \param completion Optionally; a block which is invoked when the sign in +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInAnonymouslyWithCompletion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously creates and becomes an anonymous user. +/// If there is already an anonymous user signed in, that user will be returned +/// instead. If there is any other existing user signed in, that user will be +/// signed out. Possible error codes:
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that anonymous +/// accounts are not enabled. Enable them in the Auth section of the +/// Firebase console. +///
  • +///
+/// +/// returns: +/// The AuthDataResult after the successful signin. +- (void)signInAnonymouslyWithCompletionHandler: + (void (^_Nonnull)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completionHandler + SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); +/// Asynchronously signs in to Firebase with the given Auth token. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidCustomToken - Indicates a validation +/// error with the custom token. +///
  • +///
  • +/// AuthErrorCodeCustomTokenMismatch - Indicates the service +/// account and the API key belong to different projects. +///
  • +///
+/// \param token A self-signed custom auth token. +/// +/// \param completion Optionally; a block which is invoked when the sign in +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithCustomToken:(NSString *_Nonnull)token + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Creates and, on success, signs in a user with the given email address and +/// password. Possible error codes:
    +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeEmailAlreadyInUse - Indicates the email used +/// to attempt sign up already exists. Call fetchProvidersForEmail to check +/// which sign-in mechanisms the user used, and prompt the user to sign in +/// with one of those. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeWeakPassword - Indicates an attempt to set a +/// password that is considered too weak. The +/// NSLocalizedFailureReasonErrorKey field in the NSError.userInfo +/// dictionary object will contain more detailed explanation that can be +/// shown to the user. +///
  • +///
+/// \param email The user’s email address. +/// +/// \param password The user’s desired password. +/// +/// \param completion Optionally; a block which is invoked when the sign up flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)createUserWithEmail:(NSString *_Nonnull)email + password:(NSString *_Nonnull)password + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Resets the password given a code sent to the user outside of the app and a +/// new password for the user. Possible error codes:
    +///
  • +/// AuthErrorCodeWeakPassword - Indicates an attempt to set a +/// password that is considered too weak. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates the +/// administrator disabled sign in with the specified identity provider. +///
  • +///
  • +/// AuthErrorCodeExpiredActionCode - Indicates the OOB code is +/// expired. +///
  • +///
  • +/// AuthErrorCodeInvalidActionCode - Indicates the OOB code is +/// invalid. +///
  • +///
+/// \param code The reset code. +/// +/// \param newPassword The new password. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)confirmPasswordResetWithCode:(NSString *_Nonnull)code + newPassword:(NSString *_Nonnull)newPassword + completion: + (void (^_Nonnull)(NSError *_Nullable))completion; +/// Checks the validity of an out of band code. +/// \param code The out of band code to check validity. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)checkActionCode:(NSString *_Nonnull)code + completion:(void (^_Nonnull)(FIRActionCodeInfo *_Nullable, + NSError *_Nullable))completion; +/// Checks the validity of a verify password reset code. +/// \param code The password reset code to be verified. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)verifyPasswordResetCode:(NSString *_Nonnull)code + completion: + (void (^_Nonnull)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Applies out of band code. +/// This method will not work for out of band codes which require an additional +/// parameter, such as password reset code. \param code The out of band code to +/// be applied. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)applyActionCode:(NSString *_Nonnull)code + completion:(void (^_Nonnull)(NSError *_Nullable))completion; +/// Initiates a password reset for the given email address. +/// This method does not throw an +/// error when there’s no user account with the given email address and Email +/// Enumeration Protection is enabled. Possible error codes:
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
+/// \param email The email address of the user. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)sendPasswordResetWithEmail:(NSString *_Nonnull)email + completion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Initiates a password reset for the given email address and +/// ActionCodeSettings object. This method does not throw an error +/// when there’s no user account with the given email address and Email +/// Enumeration Protection is enabled. Possible error codes:
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeMissingIosBundleID - Indicates that the iOS +/// bundle ID is missing when handleCodeInApp is set to true. +///
  • +///
  • +/// AuthErrorCodeMissingAndroidPackageName - Indicates that the +/// android package name is missing when the androidInstallApp +/// flag is set to true. +///
  • +///
  • +/// AuthErrorCodeUnauthorizedDomain - Indicates that the domain +/// specified in the continue URL is not allowlisted in the Firebase +/// console. +///
  • +///
  • +/// AuthErrorCodeInvalidContinueURI - Indicates that the domain +/// specified in the continue URL is not valid. +///
  • +///
+/// \param email The email address of the user. +/// +/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)sendPasswordResetWithEmail:(NSString *_Nonnull)email + actionCodeSettings: + (FIRActionCodeSettings *_Nullable)actionCodeSettings + completion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Sends a sign in with email link to provided email address. +/// \param email The email address of the user. +/// +/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)sendSignInLinkToEmail:(NSString *_Nonnull)email + actionCodeSettings: + (FIRActionCodeSettings *_Nonnull)actionCodeSettings + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Signs out the current user. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeKeychainError - Indicates an error occurred +/// when accessing the keychain. The +/// NSLocalizedFailureReasonErrorKey field in the +/// userInfo dictionary will contain more information about the +/// error encountered. +///
  • +///
+- (BOOL)signOut:(NSError *_Nullable *_Nullable)error; +/// Checks if link is an email sign-in link. +/// \param link The email sign-in link. +/// +/// +/// returns: +/// true when the link passed matches the expected format of an +/// email sign-in link. +- (BOOL)isSignInWithEmailLink:(NSString *_Nonnull)link SWIFT_WARN_UNUSED_RESULT; +/// Initializes reCAPTCHA using the settings configured for the project or +/// tenant. If you change the tenant ID of the Auth instance, the +/// configuration will be reloaded. +- (void)initializeRecaptchaConfigWithCompletion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Registers a block as an “auth state did change” listener. +/// To be invoked when: +///
    +///
  • +/// The block is registered as a listener, +///
  • +///
  • +/// A user with a different UID from the current user has signed in, or +///
  • +///
  • +/// The current user has signed out. +///
  • +///
+/// The block is invoked immediately after adding it according to its standard +/// invocation semantics, asynchronously on the main thread. Users should pay +/// special attention to making sure the block does not inadvertently retain +/// objects which should not be retained by the long-lived block. The block +/// itself will be retained by Auth until it is unregistered or +/// until the Auth instance is otherwise deallocated. \param +/// listener The block to be invoked. The block is always invoked asynchronously +/// on the main thread, even for it’s initial invocation after having been added +/// as a listener. +/// +/// +/// returns: +/// A handle useful for manually unregistering the block as a listener. +- (id _Nonnull)addAuthStateDidChangeListener: + (void (^_Nonnull)(FIRAuth *_Nonnull, FIRUser *_Nullable))listener + SWIFT_WARN_UNUSED_RESULT; +/// Unregisters a block as an “auth state did change” listener. +/// \param listenerHandle The handle for the listener. +/// +- (void)removeAuthStateDidChangeListener:(id _Nonnull)listenerHandle; +/// Registers a block as an “ID token did change” listener. +/// To be invoked when: +///
    +///
  • +/// The block is registered as a listener, +///
  • +///
  • +/// A user with a different UID from the current user has signed in, +///
  • +///
  • +/// The ID token of the current user has been refreshed, or +///
  • +///
  • +/// The current user has signed out. +///
  • +///
+/// The block is invoked immediately after adding it according to its standard +/// invocation semantics, asynchronously on the main thread. Users should pay +/// special attention to making sure the block does not inadvertently retain +/// objects which should not be retained by the long-lived block. The block +/// itself will be retained by Auth until it is unregistered or +/// until the Auth instance is otherwise deallocated. \param +/// listener The block to be invoked. The block is always invoked asynchronously +/// on the main thread, even for it’s initial invocation after having been added +/// as a listener. +/// +/// +/// returns: +/// A handle useful for manually unregistering the block as a listener. +- (id _Nonnull)addIDTokenDidChangeListener: + (void (^_Nonnull)(FIRAuth *_Nonnull, FIRUser *_Nullable))listener + SWIFT_WARN_UNUSED_RESULT; +/// Unregisters a block as an “ID token did change” listener. +/// \param listenerHandle The handle for the listener. +/// +- (void)removeIDTokenDidChangeListener:(id _Nonnull)listenerHandle; +/// Sets languageCode to the app’s current language. +- (void)useAppLanguage; +/// Configures Firebase Auth to connect to an emulated host instead of the +/// remote backend. +- (void)useEmulatorWithHost:(NSString *_Nonnull)host port:(NSInteger)port; +/// Revoke the users token with authorization code. +/// \param completion (Optional) the block invoked when the request to revoke +/// the token is complete, or fails. Invoked asynchronously on the main thread +/// in the future. +/// +- (void)revokeTokenWithAuthorizationCode:(NSString *_Nonnull)authorizationCode + completion:(void (^_Nullable)(NSError *_Nullable)) + completion; +/// Switch userAccessGroup and current user to the given accessGroup and the +/// user stored in it. +- (BOOL)useUserAccessGroup:(NSString *_Nullable)accessGroup + error:(NSError *_Nullable *_Nullable)error; +/// Get the stored user in the given accessGroup. +/// This API is not supported on tvOS when +/// shareAuthStateAcrossDevices is set to true. and +/// will return nil. Please refer to +/// https://github.com/firebase/firebase-ios-sdk/issues/8878 for details. +- (FIRUser *_Nullable) + getStoredUserForAccessGroup:(NSString *_Nullable)accessGroup + error:(NSError *_Nullable *_Nullable)outError + SWIFT_WARN_UNUSED_RESULT; +/// The APNs token used for phone number authentication. +/// The type of the token (production or sandbox) will be automatically +/// detected based on your provisioning profile. +/// This property is available on iOS only. +/// If swizzling is disabled, the APNs Token must be set for phone number auth +/// to work, by either setting this property or by calling +/// setAPNSToken(_:type:). +@property(nonatomic, readonly, copy) NSData *_Nullable APNSToken; +/// Sets the APNs token along with its type. +/// This method is available on iOS only. +/// If swizzling is disabled, the APNs Token must be set for phone number auth +/// to work, by either setting calling this method or by setting the +/// APNSToken property. +- (void)setAPNSToken:(NSData *_Nonnull)token + type:(enum FIRAuthAPNSTokenType)type; +/// Whether the specific remote notification is handled by Auth . +/// This method is available on iOS only. +/// If swizzling is disabled, related remote notifications must be forwarded to +/// this method for phone number auth to work. \param userInfo A dictionary that +/// contains information related to the notification in question. +/// +/// +/// returns: +/// Whether or the notification is handled. A return value of true +/// means the notification is for Firebase Auth so the caller should ignore the +/// notification from further processing, and false means the +/// notification is for the app (or another library) so the caller should +/// continue handling this notification as usual. +- (BOOL)canHandleNotification:(NSDictionary *_Nonnull)userInfo + SWIFT_WARN_UNUSED_RESULT; +/// Whether the specific URL is handled by Auth . +/// This method is available on iOS only. +/// If swizzling is disabled, URLs received by the application delegate must be +/// forwarded to this method for phone number auth to work. \param url The URL +/// received by the application delegate from any of the openURL method. +/// +/// +/// returns: +/// Whether or the URL is handled. true means the URL is for +/// Firebase Auth so the caller should ignore the URL from further processing, +/// and false means the the URL is for the app (or another library) +/// so the caller should continue handling this URL as usual. +- (BOOL)canHandleURL:(NSURL *_Nonnull)url SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class UIScene; +@class UIOpenURLContext; + +SWIFT_AVAILABILITY(ios, introduced = 13.0) +@interface FIRAuth (SWIFT_EXTENSION (FirebaseAuth)) +- (void)scene:(UIScene *_Nonnull)scene + openURLContexts:(NSSet *_Nonnull)URLContexts; +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, + introduced = 13) SWIFT_AVAILABILITY(ios, + introduced = 13) + @interface FIRAuth(SWIFT_EXTENSION(FirebaseAuth)) +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. This method is not for public use. It is for Firebase clients +/// of AuthInterop. +- (void)getTokenForcingRefresh:(BOOL)forceRefresh + withCallback:(void (^_Nonnull)(NSString *_Nullable, + NSError *_Nullable))callback; +/// Get the current Auth user’s UID. Returns nil if there is no user signed in. +/// This method is not for public use. It is for Firebase clients of +/// AuthInterop. +- (NSString *_Nullable)getUserID SWIFT_WARN_UNUSED_RESULT; +@end + +@class UIApplication; + +SWIFT_AVAILABILITY(ios, introduced = 13.0) +@interface FIRAuth (SWIFT_EXTENSION (FirebaseAuth)) +- (void)application:(UIApplication *_Nonnull)application + didRegisterForRemoteNotificationsWithDeviceToken: + (NSData *_Nonnull)deviceToken; +- (void)application:(UIApplication *_Nonnull)application + didFailToRegisterForRemoteNotificationsWithError:(NSError *_Nonnull)error; +- (void)application:(UIApplication *_Nonnull)application + didReceiveRemoteNotification:(NSDictionary *_Nonnull)userInfo + fetchCompletionHandler: + (void (^_Nonnull)(UIBackgroundFetchResult))completionHandler; +- (BOOL)application:(UIApplication *_Nonnull)application + openURL:(NSURL *_Nonnull)url + options:(NSDictionary *_Nonnull) + options SWIFT_WARN_UNUSED_RESULT; +@end + +/// The APNs token type for the app. +/// This enum is available on iOS, macOS Catalyst, tvOS, and watchOS only. +typedef SWIFT_ENUM_NAMED(NSInteger, FIRAuthAPNSTokenType, "AuthAPNSTokenType", + open){ + /// Unknown token type. + /// The actual token type will be detected from the provisioning profile in + /// the app’s bundle. + FIRAuthAPNSTokenTypeUnknown = 0, + /// Sandbox token type. + FIRAuthAPNSTokenTypeSandbox = 1, + /// Production token type. + FIRAuthAPNSTokenTypeProd = 2, +}; + +/// Public representation of a credential. +SWIFT_CLASS_NAMED("AuthCredential") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthCredential : NSObject +/// The name of the identity provider for the credential. +@property(nonatomic, readonly, copy) NSString *_Nonnull provider; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class FIROAuthCredential; + +/// Helper object that contains the result of a successful sign-in, link and +/// reauthenticate action. It contains references to a User +/// instance and an AdditionalUserInfo instance. +SWIFT_CLASS_NAMED("AuthDataResult") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthDataResult : NSObject +/// The signed in user. +@property(nonatomic, readonly, strong) FIRUser *_Nonnull user; +/// If available, contains the additional IdP specific information about signed +/// in user. +@property(nonatomic, readonly, strong) + FIRAdditionalUserInfo *_Nullable additionalUserInfo; +/// This property will be non-nil after a successful headful-lite sign-in via +/// signIn(with:uiDelegate:completion:). +/// May be used to obtain the accessToken and/or IDToken +/// pertaining to a recently signed-in user. +@property(nonatomic, readonly, strong) FIROAuthCredential *_Nullable credential; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class) BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; ++ (void)setSupportsSecureCoding:(BOOL)value; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthDataResult( + SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// Error codes used by Firebase Auth. +typedef SWIFT_ENUM_NAMED(NSInteger, FIRAuthErrorCode, "AuthErrorCode", open){ + /// Indicates a validation error with the custom token. + FIRAuthErrorCodeInvalidCustomToken = 17000, + /// Indicates the service account and the API key belong to different + /// projects. + FIRAuthErrorCodeCustomTokenMismatch = 17002, + /// Indicates the IDP token or requestUri is invalid. + FIRAuthErrorCodeInvalidCredential = 17004, + /// Indicates the user’s account is disabled on the server. + FIRAuthErrorCodeUserDisabled = 17005, + /// Indicates the administrator disabled sign in with the specified identity + /// provider. + FIRAuthErrorCodeOperationNotAllowed = 17006, + /// Indicates the email used to attempt a sign up is already in use. + FIRAuthErrorCodeEmailAlreadyInUse = 17007, + /// Indicates the email is invalid. + FIRAuthErrorCodeInvalidEmail = 17008, + /// Indicates the user attempted sign in with a wrong password. + FIRAuthErrorCodeWrongPassword = 17009, + /// Indicates that too many requests were made to a server method. + FIRAuthErrorCodeTooManyRequests = 17010, + /// Indicates the user account was not found. + FIRAuthErrorCodeUserNotFound = 17011, + /// Indicates account linking is required. + FIRAuthErrorCodeAccountExistsWithDifferentCredential = 17012, + /// Indicates the user has attempted to change email or password more than 5 + /// minutes after + /// signing in. + FIRAuthErrorCodeRequiresRecentLogin = 17014, + /// Indicates an attempt to link a provider to which the account is already + /// linked. + FIRAuthErrorCodeProviderAlreadyLinked = 17015, + /// Indicates an attempt to unlink a provider that is not linked. + FIRAuthErrorCodeNoSuchProvider = 17016, + /// Indicates user’s saved auth credential is invalid the user needs to sign + /// in again. + FIRAuthErrorCodeInvalidUserToken = 17017, + /// Indicates a network error occurred (such as a timeout interrupted + /// connection or + /// unreachable host). These types of errors are often recoverable with a + /// retry. The + /// NSUnderlyingError field in the + /// NSError.userInfo dictionary will contain the error + /// encountered. + FIRAuthErrorCodeNetworkError = 17020, + /// Indicates the saved token has expired for example the user may have + /// changed account + /// password on another device. The user needs to sign in again on the + /// device that made this + /// request. + FIRAuthErrorCodeUserTokenExpired = 17021, + /// Indicates an invalid API key was supplied in the request. + FIRAuthErrorCodeInvalidAPIKey = 17023, + /// Indicates that an attempt was made to reauthenticate with a user which + /// is not the current + /// user. + FIRAuthErrorCodeUserMismatch = 17024, + /// Indicates an attempt to link with a credential that has already been + /// linked with a + /// different Firebase account. + FIRAuthErrorCodeCredentialAlreadyInUse = 17025, + /// Indicates an attempt to set a password that is considered too weak. + FIRAuthErrorCodeWeakPassword = 17026, + /// Indicates the App is not authorized to use Firebase Authentication with + /// the + /// provided API Key. + FIRAuthErrorCodeAppNotAuthorized = 17028, + /// Indicates the OOB code is expired. + FIRAuthErrorCodeExpiredActionCode = 17029, + /// Indicates the OOB code is invalid. + FIRAuthErrorCodeInvalidActionCode = 17030, + /// Indicates that there are invalid parameters in the payload during a + /// “send password reset email” attempt. + FIRAuthErrorCodeInvalidMessagePayload = 17031, + /// Indicates that the sender email is invalid during a “send password reset + /// email” attempt. + FIRAuthErrorCodeInvalidSender = 17032, + /// Indicates that the recipient email is invalid. + FIRAuthErrorCodeInvalidRecipientEmail = 17033, + /// Indicates that an email address was expected but one was not provided. + FIRAuthErrorCodeMissingEmail = 17034, + /// Indicates that the iOS bundle ID is missing when a iOS App Store ID is + /// provided. + FIRAuthErrorCodeMissingIosBundleID = 17036, + /// Indicates that the android package name is missing when the + /// androidInstallApp flag is set + /// to true. + FIRAuthErrorCodeMissingAndroidPackageName = 17037, + /// Indicates that the domain specified in the continue URL is not + /// allowlisted in the Firebase + /// console. + FIRAuthErrorCodeUnauthorizedDomain = 17038, + /// Indicates that the domain specified in the continue URI is not valid. + FIRAuthErrorCodeInvalidContinueURI = 17039, + /// Indicates that a continue URI was not provided in a request to the + /// backend which requires one. + FIRAuthErrorCodeMissingContinueURI = 17040, + /// Indicates that a phone number was not provided in a call to + /// verifyPhoneNumber:completion:. + FIRAuthErrorCodeMissingPhoneNumber = 17041, + /// Indicates that an invalid phone number was provided in a call to + /// verifyPhoneNumber:completion:. + FIRAuthErrorCodeInvalidPhoneNumber = 17042, + /// Indicates that the phone auth credential was created with an empty + /// verification code. + FIRAuthErrorCodeMissingVerificationCode = 17043, + /// Indicates that an invalid verification code was used in the + /// verifyPhoneNumber request. + FIRAuthErrorCodeInvalidVerificationCode = 17044, + /// Indicates that the phone auth credential was created with an empty + /// verification ID. + FIRAuthErrorCodeMissingVerificationID = 17045, + /// Indicates that an invalid verification ID was used in the + /// verifyPhoneNumber request. + FIRAuthErrorCodeInvalidVerificationID = 17046, + /// Indicates that the APNS device token is missing in the verifyClient + /// request. + FIRAuthErrorCodeMissingAppCredential = 17047, + /// Indicates that an invalid APNS device token was used in the verifyClient + /// request. + FIRAuthErrorCodeInvalidAppCredential = 17048, + /// Indicates that the SMS code has expired. + FIRAuthErrorCodeSessionExpired = 17051, + /// Indicates that the quota of SMS messages for a given project has been + /// exceeded. + FIRAuthErrorCodeQuotaExceeded = 17052, + /// Indicates that the APNs device token could not be obtained. The app may + /// not have set up + /// remote notification correctly or may fail to forward the APNs device + /// token to Auth + /// if app delegate swizzling is disabled. + FIRAuthErrorCodeMissingAppToken = 17053, + /// Indicates that the app fails to forward remote notification to FIRAuth. + FIRAuthErrorCodeNotificationNotForwarded = 17054, + /// Indicates that the app could not be verified by Firebase during phone + /// number authentication. + FIRAuthErrorCodeAppNotVerified = 17055, + /// Indicates that the reCAPTCHA token is not valid. + FIRAuthErrorCodeCaptchaCheckFailed = 17056, + /// Indicates that an attempt was made to present a new web context while + /// one was already being + /// presented. + FIRAuthErrorCodeWebContextAlreadyPresented = 17057, + /// Indicates that the URL presentation was cancelled prematurely by the + /// user. + FIRAuthErrorCodeWebContextCancelled = 17058, + /// Indicates a general failure during the app verification flow. + FIRAuthErrorCodeAppVerificationUserInteractionFailure = 17059, + /// Indicates that the clientID used to invoke a web flow is invalid. + FIRAuthErrorCodeInvalidClientID = 17060, + /// Indicates that a network request within a SFSafariViewController or + /// WKWebView failed. + FIRAuthErrorCodeWebNetworkRequestFailed = 17061, + /// Indicates that an internal error occurred within a + /// SFSafariViewController or WKWebView. + FIRAuthErrorCodeWebInternalError = 17062, + /// Indicates a general failure during a web sign-in flow. + FIRAuthErrorCodeWebSignInUserInteractionFailure = 17063, + /// Indicates that the local player was not authenticated prior to + /// attempting Game Center signin. + FIRAuthErrorCodeLocalPlayerNotAuthenticated = 17066, + /// Indicates that a non-null user was expected as an argument to the + /// operation but a null + /// user was provided. + FIRAuthErrorCodeNullUser = 17067, + /// Indicates that a Firebase Dynamic Link is not activated. + FIRAuthErrorCodeDynamicLinkNotActivated = 17068, + /// Represents the error code for when the given provider id for a web + /// operation is invalid. + FIRAuthErrorCodeInvalidProviderID = 17071, + /// Represents the error code for when an attempt is made to update the + /// current user with a + /// tenantId that differs from the current FirebaseAuth instance’s tenantId. + FIRAuthErrorCodeTenantIDMismatch = 17072, + /// Represents the error code for when a request is made to the backend with + /// an associated tenant + /// ID for an operation that does not support multi-tenancy. + FIRAuthErrorCodeUnsupportedTenantOperation = 17073, + /// Indicates that the Firebase Dynamic Link domain used is either not + /// configured or is + /// unauthorized for the current project. + FIRAuthErrorCodeInvalidDynamicLinkDomain = 17074, + /// Indicates that the credential is rejected because it’s malformed or + /// mismatching. + FIRAuthErrorCodeRejectedCredential = 17075, + /// Indicates that the GameKit framework is not linked prior to attempting + /// Game Center signin. + FIRAuthErrorCodeGameKitNotLinked = 17076, + /// Indicates that the second factor is required for signin. + FIRAuthErrorCodeSecondFactorRequired = 17078, + /// Indicates that the multi factor session is missing. + FIRAuthErrorCodeMissingMultiFactorSession = 17081, + /// Indicates that the multi factor info is missing. + FIRAuthErrorCodeMissingMultiFactorInfo = 17082, + /// Indicates that the multi factor session is invalid. + FIRAuthErrorCodeInvalidMultiFactorSession = 17083, + /// Indicates that the multi factor info is not found. + FIRAuthErrorCodeMultiFactorInfoNotFound = 17084, + /// Indicates that the operation is admin restricted. + FIRAuthErrorCodeAdminRestrictedOperation = 17085, + /// Indicates that the email is required for verification. + FIRAuthErrorCodeUnverifiedEmail = 17086, + /// Indicates that the second factor is already enrolled. + FIRAuthErrorCodeSecondFactorAlreadyEnrolled = 17087, + /// Indicates that the maximum second factor count is exceeded. + FIRAuthErrorCodeMaximumSecondFactorCountExceeded = 17088, + /// Indicates that the first factor is not supported. + FIRAuthErrorCodeUnsupportedFirstFactor = 17089, + /// Indicates that the a verified email is required to changed to. + FIRAuthErrorCodeEmailChangeNeedsVerification = 17090, + /// Indicates that the request does not contain a client identifier. + FIRAuthErrorCodeMissingClientIdentifier = 17093, + /// Indicates that the nonce is missing or invalid. + FIRAuthErrorCodeMissingOrInvalidNonce = 17094, + /// Raised when n Cloud Function returns a blocking error. Will include a + /// message returned from + /// the function. + FIRAuthErrorCodeBlockingCloudFunctionError = 17105, + /// Indicates that reCAPTCHA Enterprise integration is not enabled for this + /// project. + FIRAuthErrorCodeRecaptchaNotEnabled = 17200, + /// Indicates that the reCAPTCHA token is missing from the backend request. + FIRAuthErrorCodeMissingRecaptchaToken = 17201, + /// Indicates that the reCAPTCHA token sent with the backend request is + /// invalid. + FIRAuthErrorCodeInvalidRecaptchaToken = 17202, + /// Indicates that the requested reCAPTCHA action is invalid. + FIRAuthErrorCodeInvalidRecaptchaAction = 17203, + /// Indicates that the client type is missing from the request. + FIRAuthErrorCodeMissingClientType = 17204, + /// Indicates that the reCAPTCHA version is missing from the request. + FIRAuthErrorCodeMissingRecaptchaVersion = 17205, + /// Indicates that the reCAPTCHA version sent to the backend is invalid. + FIRAuthErrorCodeInvalidRecaptchaVersion = 17206, + /// Indicates that the request type sent to the backend is invalid. + FIRAuthErrorCodeInvalidReqType = 17207, + /// Indicates that the reCAPTCHA SDK is not linked to the app. + FIRAuthErrorCodeRecaptchaSDKNotLinked = 17208, + /// Indicates that the reCAPTCHA SDK site key wasn’t found. + FIRAuthErrorCodeRecaptchaSiteKeyMissing = 17209, + /// Indicates that the reCAPTCHA SDK actions class failed to create. + FIRAuthErrorCodeRecaptchaActionCreationFailed = 17210, + /// Indicates an error occurred while attempting to access the keychain. + FIRAuthErrorCodeKeychainError = 17995, + /// Indicates an internal error occurred. + FIRAuthErrorCodeInternalError = 17999, + /// Raised when a JWT fails to parse correctly. May be accompanied by an + /// underlying error + /// describing which step of the JWT parsing process failed. + FIRAuthErrorCodeMalformedJWT = 18000, +}; + +/// Error Codes common to all API Methods: +SWIFT_CLASS_NAMED("AuthErrors") +@interface FIRAuthErrors : NSObject +/// The Firebase Auth error domain. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull domain;) ++ (NSString *_Nonnull)domain SWIFT_WARN_UNUSED_RESULT; +/// The name of the key for the error short string of an error code. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull userInfoNameKey;) ++ (NSString *_Nonnull)userInfoNameKey SWIFT_WARN_UNUSED_RESULT; +/// Error codes for Email operations +/// Errors with one of the following three codes: +///
    +///
  • +/// accountExistsWithDifferentCredential +///
  • +///
  • +/// credentialAlreadyInUse +///
  • +///
  • +/// emailAlreadyInUse` +///
  • +///
+/// may contain an NSError.userInfo dictionary object which +/// contains this key. The value associated with this key is an NSString of the +/// email address of the account that already exists. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull userInfoEmailKey;) ++ (NSString *_Nonnull)userInfoEmailKey SWIFT_WARN_UNUSED_RESULT; +/// The key used to read the updated Auth credential from the userInfo +/// dictionary of the NSError object returned. This is the updated auth +/// credential the developer should use for recovery if applicable. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull userInfoUpdatedCredentialKey;) ++ (NSString *_Nonnull)userInfoUpdatedCredentialKey SWIFT_WARN_UNUSED_RESULT; +/// The key used to read the MFA resolver from the userInfo dictionary of the +/// NSError object returned when 2FA is required for sign-incompletion. +SWIFT_CLASS_PROPERTY( + @property(nonatomic, class, readonly, copy) + NSString *_Nonnull FIRAuthErrorUserInfoMultiFactorResolverKey;) ++ (NSString *_Nonnull) + FIRAuthErrorUserInfoMultiFactorResolverKey SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// Determines settings related to an auth object. +SWIFT_CLASS_NAMED("AuthSettings") +@interface FIRAuthSettings : NSObject +/// Flag to determine whether app verification should be disabled for testing or +/// not. +@property(nonatomic) BOOL appVerificationDisabledForTesting; +/// Flag to determine whether app verification should be disabled for testing or +/// not. +@property(nonatomic) BOOL isAppVerificationDisabledForTesting; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +- (id _Nonnull)copyWithZone:(struct _NSZone *_Nullable)zone + SWIFT_WARN_UNUSED_RESULT; +@end + +@class NSDate; + +/// A data class containing the ID token JWT string and other properties +/// associated with the token including the decoded payload claims. +SWIFT_CLASS_NAMED("AuthTokenResult") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthTokenResult : NSObject +/// Stores the JWT string of the ID token. +@property(nonatomic, copy) NSString *_Nonnull token; +/// Stores the ID token’s expiration date. +@property(nonatomic, copy) NSDate *_Nonnull expirationDate; +/// Stores the ID token’s authentication date. +/// This is the date the user was signed in and NOT the date the token was +/// refreshed. +@property(nonatomic, copy) NSDate *_Nonnull authDate; +/// Stores the date that the ID token was issued. +/// This is the date last refreshed and NOT the last authentication date. +@property(nonatomic, copy) NSDate *_Nonnull issuedAtDate; +/// Stores sign-in provider through which the token was obtained. +@property(nonatomic, copy) NSString *_Nonnull signInProvider; +/// Stores sign-in second factor through which the token was obtained. +@property(nonatomic, copy) NSString *_Nonnull signInSecondFactor; +/// Stores the entire payload of claims found on the ID token. +/// This includes the standard +/// reserved claims as well as custom claims set by the developer via the Admin +/// SDK. +@property(nonatomic, copy) NSDictionary *_Nonnull claims; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthTokenResult( + SWIFT_EXTENSION(FirebaseAuth)) +@end + +@class UIViewController; + +/// A protocol to handle user interface interactions for Firebase Auth. +/// This protocol is available on iOS, macOS Catalyst, and tvOS only. +SWIFT_PROTOCOL_NAMED("AuthUIDelegate") +@protocol FIRAuthUIDelegate +/// If implemented, this method will be invoked when Firebase Auth needs to +/// display a view controller. \param viewControllerToPresent The view +/// controller to be presented. +/// +/// \param flag Decides whether the view controller presentation should be +/// animated. +/// +/// \param completion The block to execute after the presentation finishes. +/// This block has no return value and takes no parameters. +/// +- (void)presentViewController: + (UIViewController *_Nonnull)viewControllerToPresent + animated:(BOOL)flag + completion:(void (^_Nullable)(void))completion; +/// If implemented, this method will be invoked when Firebase Auth needs to +/// display a view controller. \param flag Decides whether removing the view +/// controller should be animated or not. +/// +/// \param completion The block to execute after the presentation finishes. +/// This block has no return value and takes no parameters. +/// +- (void)dismissViewControllerAnimated:(BOOL)flag + completion:(void (^_Nullable)(void))completion; +@end + +/// A concrete implementation of AuthProvider for Email & Password +/// Sign In. +SWIFT_CLASS_NAMED("EmailAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIREmailAuthProvider : NSObject +/// A string constant identifying the email & password identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for an email & password sign in +/// \param email The user’s email address. +/// +/// \param password The user’s password. +/// +/// +/// returns: +/// An AuthCredential containing the email & password credential. ++ (FIRAuthCredential *_Nonnull)credentialWithEmail:(NSString *_Nonnull)email + password:(NSString *_Nonnull)password + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for an email & link sign in. +/// \param email The user’s email address. +/// +/// \param link The email sign-in link. +/// +/// +/// returns: +/// An AuthCredential containing the email & link credential. ++ (FIRAuthCredential *_Nonnull)credentialWithEmail:(NSString *_Nonnull)email + link:(NSString *_Nonnull)link + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// Utility class for constructing Facebook Sign In credentials. +SWIFT_CLASS_NAMED("FacebookAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRFacebookAuthProvider : NSObject +/// A string constant identifying the Facebook identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Facebook sign in. +/// \param accessToken The Access Token from Facebook. +/// +/// +/// returns: +/// An AuthCredential containing the Facebook credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithAccessToken: + (NSString *_Nonnull)accessToken SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Utility type for constructing federated auth provider credentials. +SWIFT_PROTOCOL_NAMED("FederatedAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @protocol FIRFederatedAuthProvider +/// Used to obtain an auth credential via a mobile web flow. +/// This method is available on iOS only. +/// \param uiDelegate An optional UI delegate used to present the mobile web +/// flow. +/// +- (void)getCredentialWithUIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nonnull)( + FIRAuthCredential *_Nullable, + NSError *_Nullable))completionHandler + SWIFT_AVAILABILITY(watchos, introduced = 8) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); +@end + +/// A concrete implementation of AuthProvider for Game Center Sign +/// In. Not available on watchOS. +SWIFT_CLASS_NAMED("GameCenterAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRGameCenterAuthProvider : NSObject +/// A string constant identifying the Game Center identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Game Center sign in. ++ (void)getCredentialWithCompletion: + (void (^_Nonnull)(FIRAuthCredential *_Nullable, + NSError *_Nullable))completion; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Utility class for constructing GitHub Sign In credentials. +SWIFT_CLASS_NAMED("GitHubAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRGitHubAuthProvider : NSObject +/// A string constant identifying the GitHub identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a GitHub sign in. +/// \param token The GitHub OAuth access token. +/// +/// +/// returns: +/// An AuthCredential containing the GitHub credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithToken:(NSString *_Nonnull)token + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Utility class for constructing Google Sign In credentials. +SWIFT_CLASS_NAMED("GoogleAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRGoogleAuthProvider : NSObject +/// A string constant identifying the Google identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Google sign in. +/// \param idToken The ID Token from Google. +/// +/// \param accessToken The Access Token from Google. +/// +/// +/// returns: +/// An AuthCredential containing the Google credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithIDToken:(NSString *_Nonnull)idToken + accessToken: + (NSString *_Nonnull)accessToken + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +@class FIRMultiFactorInfo; +@class FIRMultiFactorSession; +@class FIRMultiFactorAssertion; + +/// The interface defining the multi factor related properties and operations +/// pertaining to a user. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactor") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactor : NSObject +@property(nonatomic, copy) + NSArray *_Nonnull enrolledFactors; +/// Get a session for a second factor enrollment operation. +/// This is used to identify the current user trying to enroll a second factor. +/// \param completion A block with the session identifier for a second factor +/// enrollment operation. +/// +- (void)getSessionWithCompletion: + (void (^_Nullable)(FIRMultiFactorSession *_Nullable, + NSError *_Nullable))completion; +/// Enrolls a second factor as identified by the +/// MultiFactorAssertion parameter for the current user. \param +/// assertion The MultiFactorAssertion. +/// +/// \param displayName An optional display name associated with the multi factor +/// to enroll. +/// +/// \param completion The block invoked when the request is complete, or fails. +/// +- (void)enrollWithAssertion:(FIRMultiFactorAssertion *_Nonnull)assertion + displayName:(NSString *_Nullable)displayName + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Unenroll the given multi factor. +/// \param completion The block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void)unenrollWithInfo:(FIRMultiFactorInfo *_Nonnull)factorInfo + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Unenroll the given multi factor. +/// \param completion The block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void)unenrollWithFactorUID:(NSString *_Nonnull)factorUID + completion:(void (^_Nullable)(NSError *_Nullable))completion; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) SWIFT_AVAILABILITY( + macos, introduced = 10.15) SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactor(SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// The base class for asserting ownership of a second factor. This is +/// equivalent to the AuthCredential class. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorAssertion") +@interface FIRMultiFactorAssertion : NSObject +/// The second factor identifier for this opaque object asserting a second +/// factor. +@property(nonatomic, copy) NSString *_Nonnull factorID; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Safe public structure used to represent a second factor entity from a client +/// perspective. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorInfo") +@interface FIRMultiFactorInfo : NSObject +/// The multi-factor enrollment ID. +@property(nonatomic, readonly, copy) NSString *_Nonnull UID; +/// The user friendly name of the current second factor. +@property(nonatomic, readonly, copy) NSString *_Nullable displayName; +/// The second factor enrollment date. +@property(nonatomic, readonly, copy) NSDate *_Nonnull enrollmentDate; +/// The identifier of the second factor. +@property(nonatomic, readonly, copy) NSString *_Nonnull factorID; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@interface FIRMultiFactorInfo (SWIFT_EXTENSION (FirebaseAuth)) +@end + +/// The subclass of base class MultiFactorAssertion, used to assert +/// ownership of a phone second factor. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorResolver") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactorResolver : NSObject +/// The opaque session identifier for the current sign-in flow. +@property(nonatomic, readonly, strong) FIRMultiFactorSession *_Nonnull session; +/// The list of hints for the second factors needed to complete the sign-in for +/// the current session. +@property(nonatomic, readonly, copy) + NSArray *_Nonnull hints; +/// The Auth reference for the current MultiResolver. +@property(nonatomic, readonly, strong) FIRAuth *_Nonnull auth; +/// A helper function to help users complete sign in with a second factor using +/// a MultiFactorAssertion confirming the user successfully +/// completed the second factor challenge. \param completion The block invoked +/// when the request is complete, or fails. +/// +- (void)resolveSignInWithAssertion:(FIRMultiFactorAssertion *_Nonnull)assertion + completion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Opaque object that identifies the current session to enroll a second factor +/// or to complete sign in when previously enrolled. Identifies the current +/// session to enroll a second factor or to complete sign in when previously +/// enrolled. It contains additional context on the existing user, notably the +/// confirmation that the user passed the first factor challenge. This class is +/// available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorSession") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactorSession : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Internal implementation of AuthCredential for generic +/// credentials. +SWIFT_CLASS_NAMED("OAuthCredential") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIROAuthCredential + : FIRAuthCredential +/// The ID Token associated with this credential. +@property(nonatomic, readonly, copy) NSString *_Nullable IDToken; +/// The access token associated with this credential. +@property(nonatomic, readonly, copy) NSString *_Nullable accessToken; +/// The secret associated with this credential. This will be nil for OAuth 2.0 +/// providers. OAuthCredential already exposes a provider getter. +/// This will help the developer determine whether an access token / secret pair +/// is needed. +@property(nonatomic, readonly, copy) NSString *_Nullable secret; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class) BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; ++ (void)setSupportsSecureCoding:(BOOL)value; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +@end + +@class NSPersonNameComponents; + +/// Utility class for constructing OAuth Sign In credentials. +SWIFT_CLASS_NAMED("OAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIROAuthProvider + : NSObject +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Array used to configure the OAuth scopes. +@property(nonatomic, copy) NSArray *_Nullable scopes; +/// Dictionary used to configure the OAuth custom parameters. +@property(nonatomic, copy) + NSDictionary *_Nullable customParameters; +/// The provider ID indicating the specific OAuth provider this OAuthProvider +/// instance represents. +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// An instance of OAuthProvider corresponding to the given provider ID. +/// \param providerID The provider ID of the IDP for which this auth provider +/// instance will be configured. +/// +/// +/// returns: +/// An instance of OAuthProvider corresponding to the specified provider ID. ++ (FIROAuthProvider *_Nonnull)providerWithProviderID: + (NSString *_Nonnull)providerID SWIFT_WARN_UNUSED_RESULT; +/// An instance of OAuthProvider corresponding to the given provider ID and auth +/// instance. \param providerID The provider ID of the IDP for which this auth +/// provider instance will be configured. +/// +/// \param auth The auth instance to be associated with the OAuthProvider +/// instance. +/// +/// +/// returns: +/// An instance of OAuthProvider corresponding to the specified provider ID. ++ (FIROAuthProvider *_Nonnull)providerWithProviderID: + (NSString *_Nonnull)providerID + auth:(FIRAuth *_Nonnull)auth + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for the OAuth 2 provider identified +/// by provider ID, ID token, and access token. \param providerID The provider +/// ID associated with the Auth credential being created. +/// +/// \param idToken The IDToken associated with the Auth credential being +/// created. +/// +/// \param accessToken The access token associated with the Auth credential be +/// created, if available. +/// +/// +/// returns: +/// An AuthCredential for the specified provider ID, ID token and access token. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + IDToken:(NSString *_Nonnull)idToken + accessToken:(NSString *_Nullable)accessToken + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for the OAuth 2 provider identified +/// by provider ID, ID token, and access token. \param providerID The provider +/// ID associated with the Auth credential being created. +/// +/// \param accessToken The access token associated with the Auth credential be +/// created, if available. +/// +/// +/// returns: +/// An AuthCredential for the specified provider ID, ID token and access token. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + accessToken:(NSString *_Nonnull)accessToken + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for that OAuth 2 provider identified +/// by provider ID, ID token, raw nonce, and access token. \param providerID The +/// provider ID associated with the Auth credential being created. +/// +/// \param idToken The IDToken associated with the Auth credential being +/// created. +/// +/// \param rawNonce The raw nonce associated with the Auth credential being +/// created. +/// +/// \param accessToken The access token associated with the Auth credential be +/// created. +/// +/// +/// returns: +/// An AuthCredential for the specified provider ID, ID token and access token. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + IDToken:(NSString *_Nonnull)idToken + rawNonce:(NSString *_Nonnull)rawNonce + accessToken:(NSString *_Nonnull)accessToken + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for that OAuth 2 provider identified +/// by providerID using an ID token and raw nonce. \param providerID The +/// provider ID associated with the Auth credential being created. +/// +/// \param idToken The IDToken associated with the Auth credential being +/// created. +/// +/// \param rawNonce The raw nonce associated with the Auth credential being +/// created. +/// +/// +/// returns: +/// An AuthCredential. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + IDToken:(NSString *_Nonnull)idToken + rawNonce:(NSString *_Nonnull)rawNonce + SWIFT_WARN_UNUSED_RESULT; +/// Used to obtain an auth credential via a mobile web flow. +/// This method is available on iOS only. +/// \param uiDelegate An optional UI delegate used to present the mobile web +/// flow. +/// +- (void)getCredentialWithUIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nonnull)( + FIRAuthCredential *_Nullable, + NSError *_Nullable))completionHandler + SWIFT_AVAILABILITY(watchos, introduced = 8) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); +/// Creates an AuthCredential for the Sign in with Apple OAuth 2 +/// provider identified by ID token, raw nonce, and full name.This method is +/// specific to the Sign in with Apple OAuth 2 provider as this provider +/// requires the full name to be passed explicitly. \param idToken The IDToken +/// associated with the Sign in with Apple Auth credential being created. +/// +/// \param rawNonce The raw nonce associated with the Sign in with Apple Auth +/// credential being created. +/// +/// \param fullName The full name associated with the Sign in with Apple Auth +/// credential being created. +/// +/// +/// returns: +/// An AuthCredential. ++ (FIROAuthCredential *_Nonnull) + appleCredentialWithIDToken:(NSString *_Nonnull)idToken + rawNonce:(NSString *_Nullable)rawNonce + fullName:(NSPersonNameComponents *_Nullable)fullName + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Implementation of AuthCredential for Phone Auth credentials. +/// This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneAuthCredential") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneAuthCredential + : FIRAuthCredential +SWIFT_CLASS_PROPERTY(@property(nonatomic, class) BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; ++ (void)setSupportsSecureCoding:(BOOL)value; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +@end + +@class FIRPhoneMultiFactorInfo; + +/// A concrete implementation of AuthProvider for phone auth +/// providers. This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneAuthProvider : NSObject +/// A string constant identifying the phone identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Returns an instance of PhoneAuthProvider for the default +/// Auth object. ++ (FIRPhoneAuthProvider *_Nonnull)provider SWIFT_WARN_UNUSED_RESULT; +/// Returns an instance of PhoneAuthProvider for the provided +/// Auth object. \param auth The auth object to associate with the +/// phone auth provider instance. +/// ++ (FIRPhoneAuthProvider *_Nonnull)providerWithAuth:(FIRAuth *_Nonnull)auth + SWIFT_WARN_UNUSED_RESULT; +/// Starts the phone number authentication flow by sending a verification code +/// to the specified phone number. Possible error codes:
    +///
  • +/// AuthErrorCodeCaptchaCheckFailed - Indicates that the +/// reCAPTCHA token obtained by the Firebase Auth is invalid or has expired. +///
  • +///
  • +/// AuthErrorCodeQuotaExceeded - Indicates that the phone +/// verification quota for this project has been exceeded. +///
  • +///
  • +/// AuthErrorCodeInvalidPhoneNumber - Indicates that the phone +/// number provided is invalid. +///
  • +///
  • +/// AuthErrorCodeMissingPhoneNumber - Indicates that a phone +/// number was not provided. +///
  • +///
+/// \param phoneNumber The phone number to be verified. +/// +/// \param uiDelegate An object used to present the SFSafariViewController. The +/// object is retained by this method until the completion block is executed. +/// +/// \param completion The callback to be invoked when the verification flow is +/// finished. +/// +- (void)verifyPhoneNumber:(NSString *_Nonnull)phoneNumber + UIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Verify ownership of the second factor phone number by the current user. +/// \param phoneNumber The phone number to be verified. +/// +/// \param uiDelegate An object used to present the SFSafariViewController. The +/// object is retained by this method until the completion block is executed. +/// +/// \param multiFactorSession A session to identify the MFA flow. For +/// enrollment, this identifies the user trying to enroll. For sign-in, this +/// identifies that the user already passed the first factor challenge. +/// +/// \param completion The callback to be invoked when the verification flow is +/// finished. +/// +- (void)verifyPhoneNumber:(NSString *_Nonnull)phoneNumber + UIDelegate:(id _Nullable)uiDelegate + multiFactorSession:(FIRMultiFactorSession *_Nullable)multiFactorSession + completion:(void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Verify ownership of the second factor phone number by the current user. +/// \param multiFactorInfo The phone multi factor whose number need to be +/// verified. +/// +/// \param uiDelegate An object used to present the SFSafariViewController. The +/// object is retained by this method until the completion block is executed. +/// +/// \param multiFactorSession A session to identify the MFA flow. For +/// enrollment, this identifies the user trying to enroll. For sign-in, this +/// identifies that the user already passed the first factor challenge. +/// +/// \param completion The callback to be invoked when the verification flow is +/// finished. +/// +- (void) + verifyPhoneNumberWithMultiFactorInfo: + (FIRPhoneMultiFactorInfo *_Nonnull)multiFactorInfo + UIDelegate: + (id _Nullable)uiDelegate + multiFactorSession: + (FIRMultiFactorSession *_Nullable)multiFactorSession + completion:(void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable)) + completion; +/// Creates an AuthCredential for the phone number provider +/// identified by the verification ID and verification code. \param +/// verificationID The verification ID obtained from invoking +/// verifyPhoneNumber:completion: +/// +/// \param verificationCode The verification code obtained from the user. +/// +/// +/// returns: +/// The corresponding phone auth credential for the verification ID and +/// verification code provided. +- (FIRPhoneAuthCredential *_Nonnull) + credentialWithVerificationID:(NSString *_Nonnull)verificationID + verificationCode:(NSString *_Nonnull)verificationCode + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// The subclass of base class FIRMultiFactorAssertion, used to assert ownership +/// of a phone second factor. This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneMultiFactorAssertion") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneMultiFactorAssertion + : FIRMultiFactorAssertion +@end + +/// The data structure used to help initialize an assertion for a second factor +/// entity to the Firebase Auth/CICP server. Depending on the type of second +/// factor, this will help generate the assertion. This class is available on +/// iOS only. +SWIFT_CLASS_NAMED("PhoneMultiFactorGenerator") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneMultiFactorGenerator : NSObject +/// Initializes the MFA assertion to confirm ownership of the phone second +/// factor. Note that this API is used for both enrolling and signing in with a +/// phone second factor. \param phoneAuthCredential The phone auth credential +/// used for multi factor flows. +/// ++ (FIRPhoneMultiFactorAssertion *_Nonnull)assertionWithCredential: + (FIRPhoneAuthCredential *_Nonnull)phoneAuthCredential + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// Extends the MultiFactorInfo class for phone number second factors. +/// The identifier of this second factor is “phone”. +/// This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneMultiFactorInfo") +@interface FIRPhoneMultiFactorInfo : FIRMultiFactorInfo +/// The string identifier for using phone as a second factor. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull FIRPhoneMultiFactorID;) ++ (NSString *_Nonnull)FIRPhoneMultiFactorID SWIFT_WARN_UNUSED_RESULT; +/// The string identifier for using TOTP as a second factor. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull FIRTOTPMultiFactorID;) ++ (NSString *_Nonnull)FIRTOTPMultiFactorID SWIFT_WARN_UNUSED_RESULT; +/// This is the phone number associated with the current second factor. +@property(nonatomic, copy) NSString *_Nonnull phoneNumber; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +@end + +/// The subclass of base class MultiFactorAssertion, used to assert ownership of +/// a TOTP (Time-based One Time Password) second factor. This class is available +/// on iOS only. +SWIFT_CLASS_NAMED("TOTPMultiFactorAssertion") +@interface FIRTOTPMultiFactorAssertion : FIRMultiFactorAssertion +@end + +@class FIRTOTPSecret; + +/// The data structure used to help initialize an assertion for a second factor +/// entity to the Firebase Auth/CICP server. Depending on the type of second +/// factor, this will help generate the assertion. This class is available on +/// iOS only. +SWIFT_CLASS_NAMED("TOTPMultiFactorGenerator") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRTOTPMultiFactorGenerator : NSObject +/// Creates a TOTP secret as part of enrolling a TOTP second factor. Used for +/// generating a QR code URL or inputting into a TOTP app. This method uses the +/// auth instance corresponding to the user in the multiFactorSession. \param +/// session The multiFactorSession instance. +/// +/// \param completion Completion block +/// ++ (void)generateSecretWithMultiFactorSession: + (FIRMultiFactorSession *_Nonnull)session + completion:(void (^_Nonnull)( + FIRTOTPSecret *_Nullable, + NSError *_Nullable))completion; +/// Initializes the MFA assertion to confirm ownership of the TOTP second +/// factor. This assertion is used to complete enrollment of TOTP as a second +/// factor. \param secret The TOTP secret. +/// +/// \param oneTimePassword One time password string. +/// +/// +/// returns: +/// The MFA assertion. ++ (FIRTOTPMultiFactorAssertion *_Nonnull) + assertionForEnrollmentWithSecret:(FIRTOTPSecret *_Nonnull)secret + oneTimePassword:(NSString *_Nonnull)oneTimePassword + SWIFT_WARN_UNUSED_RESULT; +/// Initializes the MFA assertion to confirm ownership of the TOTP second +/// factor. This assertion is used to complete signIn with TOTP as a second +/// factor. \param enrollmentID The ID that identifies the enrolled TOTP second +/// factor. +/// +/// \param oneTimePassword one time password string. +/// +/// +/// returns: +/// The MFA assertion. ++ (FIRTOTPMultiFactorAssertion *_Nonnull) + assertionForSignInWithEnrollmentID:(NSString *_Nonnull)enrollmentID + oneTimePassword:(NSString *_Nonnull)oneTimePassword + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// The subclass of base class MultiFactorAssertion, used to assert ownership of +/// a TOTP (Time-based One Time Password) second factor. This class is available +/// on iOS only. +SWIFT_CLASS_NAMED("TOTPSecret") +@interface FIRTOTPSecret : NSObject +/// Returns the shared secret key/seed used to generate time-based one-time +/// passwords. +- (NSString *_Nonnull)sharedSecretKey SWIFT_WARN_UNUSED_RESULT; +/// Returns a QRCode URL as described in +/// https://github.com/google/google-authenticator/wiki/Key-Uri-Format. +/// This can be displayed to the user as a QRCode to be scanned into a TOTP app +/// like Google Authenticator. \param accountName The name of the account/app. +/// +/// \param issuer Issuer of the TOTP(likely the app name). +/// +/// +/// returns: +/// A QRCode URL string. +- (NSString *_Nonnull) + generateQRCodeURLWithAccountName:(NSString *_Nonnull)accountName + issuer:(NSString *_Nonnull)issuer + SWIFT_WARN_UNUSED_RESULT; +/// Opens the specified QR Code URL in a password manager like iCloud Keychain. +/// See more details +/// here +- (void)openInOTPAppWithQRCodeURL:(NSString *_Nonnull)qrCodeURL; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Utility class for constructing Twitter Sign In credentials. +SWIFT_CLASS_NAMED("TwitterAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRTwitterAuthProvider : NSObject +/// A string constant identifying the Twitter identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Twitter sign in. +/// \param token The Twitter OAuth token. +/// +/// \param secret The Twitter OAuth secret. +/// +/// +/// returns: +/// An AuthCredential containing the Twitter credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithToken:(NSString *_Nonnull)token + secret:(NSString *_Nonnull)secret + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Represents user data returned from an identity provider. +SWIFT_PROTOCOL_NAMED("UserInfo") +@protocol FIRUserInfo +/// The provider identifier. +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// The provider’s user ID for the user. +@property(nonatomic, readonly, copy) NSString *_Nonnull uid; +/// The name of the user. +@property(nonatomic, readonly, copy) NSString *_Nullable displayName; +/// The URL of the user’s profile photo. +@property(nonatomic, readonly, copy) NSURL *_Nullable photoURL; +/// The user’s email address. +@property(nonatomic, readonly, copy) NSString *_Nullable email; +/// A phone number associated with the user. +/// This property is only available for users authenticated via phone number +/// auth. +@property(nonatomic, readonly, copy) NSString *_Nullable phoneNumber; +@end + +@class FIRUserMetadata; +@class FIRUserProfileChangeRequest; + +/// Represents a user. +/// Firebase Auth does not attempt to validate users +/// when loading them from the keychain. Invalidated users (such as those +/// whose passwords have been changed on another client) are automatically +/// logged out when an auth-dependent operation is attempted or when the +/// ID token is automatically refreshed. +/// This class is thread-safe. +SWIFT_CLASS_NAMED("User") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRUser + : NSObject +/// Indicates the user represents an anonymous user. +@property(nonatomic, readonly) BOOL isAnonymous; +/// Indicates the user represents an anonymous user. +- (BOOL)anonymous SWIFT_WARN_UNUSED_RESULT; +/// Indicates the email address associated with this user has been verified. +@property(nonatomic, readonly) BOOL isEmailVerified; +/// Indicates the email address associated with this user has been verified. +- (BOOL)emailVerified SWIFT_WARN_UNUSED_RESULT; +/// Profile data for each identity provider, if any. +/// This data is cached on sign-in and updated when linking or unlinking. +@property(nonatomic, readonly, copy) + NSArray > *_Nonnull providerData; +/// Metadata associated with the Firebase user in question. +@property(nonatomic, readonly, strong) FIRUserMetadata *_Nonnull metadata; +/// The tenant ID of the current user. nil if none is available. +@property(nonatomic, readonly, copy) NSString *_Nullable tenantID; +/// Multi factor object associated with the user. +/// This property is available on iOS only. +@property(nonatomic, readonly, strong) FIRMultiFactor *_Nonnull multiFactor; +/// [Deprecated] Updates the email address for the user. +/// On success, the cached user profile data is updated. Returns an error when +/// Email +/// Enumeration Protection is enabled. May fail if there is already an +/// account with this email address that was created using email and password +/// authentication. Invoked asynchronously on the main thread in the future. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeEmailAlreadyInUse - Indicates the email is +/// already in use by another account. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating a user’s email +/// is a security sensitive operation that requires a recent login from the +/// user. This error indicates the user has not signed in recently enough. +/// To resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param email The email address for the user. +/// +/// \param completion Optionally; the block invoked when the user profile change +/// has finished. +/// +- (void)updateEmail:(NSString *_Nonnull)email + completion:(void (^_Nullable)(NSError *_Nullable))completion + SWIFT_DEPRECATED_MSG( + "`updateEmail` is deprecated and will be removed in a future release. " + "Use sendEmailVerification(beforeUpdatingEmail:) instead."); +/// Updates the password for the user. On success, the cached user profile data +/// is updated. Invoked asynchronously on the main thread in the future. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates the +/// administrator disabled sign in with the specified identity provider. +///
  • +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating a user’s +/// password is a security sensitive operation that requires a recent login +/// from the user. This error indicates the user has not signed in recently +/// enough. To resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
  • +/// AuthErrorCodeWeakPassword - Indicates an attempt to set a +/// password that is considered too weak. The +/// NSLocalizedFailureReasonErrorKey field in the +/// userInfo dictionary object will contain more detailed +/// explanation that can be shown to the user. +///
  • +///
+/// \param password The new password for the user. +/// +/// \param completion Optionally; the block invoked when the user profile change +/// has finished. +/// +- (void)updatePassword:(NSString *_Nonnull)password + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Updates the phone number for the user. On success, the cached user profile +/// data is updated. Invoked asynchronously on the main thread in the future. +/// This method is available on iOS only. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating a user’s phone +/// number is a security sensitive operation that requires a recent login +/// from the user. This error indicates the user has not signed in recently +/// enough. To resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param credential The new phone number credential corresponding to the +/// phone number to be added to the Firebase account, if a phone number is +/// already linked to the account this new phone number will replace it. +/// +/// \param completion Optionally; the block invoked when the user profile change +/// has finished. +/// +- (void)updatePhoneNumberCredential:(FIRPhoneAuthCredential *_Nonnull)credential + completion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Creates an object which may be used to change the user’s profile data. +/// Set the properties of the returned object, then call +/// UserProfileChangeRequest.commitChanges() to perform the updates +/// atomically. +/// +/// returns: +/// An object which may be used to change the user’s profile data atomically. +- (FIRUserProfileChangeRequest *_Nonnull) + profileChangeRequest SWIFT_WARN_UNUSED_RESULT; +/// A refresh token; useful for obtaining new access tokens independently. +/// This property should only be used for advanced scenarios, and is not +/// typically needed. +@property(nonatomic, readonly, copy) NSString *_Nullable refreshToken; +/// Reloads the user’s profile data from the server. +/// May fail with an AuthErrorCodeRequiresRecentLogin error code. +/// In this case you should call reauthenticate(with:) before +/// re-invoking updateEmail(to:). \param completion Optionally; the +/// block invoked when the reload has finished. Invoked asynchronously on the +/// main thread in the future. +/// +- (void)reloadWithCompletion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Renews the user’s authentication tokens by validating a fresh set of +/// credentials supplied by the user and returns additional identity provider +/// data. If the user associated with the supplied credential is different from +/// the current user, or if the validation of the supplied credentials fails; an +/// error is returned and the current user remains signed in. Possible error +/// codes:
    +///
  • +/// AuthErrorCodeInvalidCredential - Indicates the supplied +/// credential is invalid. This could happen if it has expired or it is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that accounts +/// with the identity provider represented by the credential are not +/// enabled. Enable them in the Auth section of the Firebase console. +///
  • +///
  • +/// AuthErrorCodeEmailAlreadyInUse - Indicates the email +/// asserted by the credential (e.g. the email in a Facebook access token) +/// is already in use by an existing account, that cannot be authenticated +/// with this method. This error will only be thrown if the “One account per +/// email address” setting is enabled in the Firebase console, under Auth +/// settings. Please note that the error code raised in this specific +/// situation may not be the same on Web and Android. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// reauthentication with an incorrect password, if credential is of the +/// type EmailPasswordAuthCredential. +///
  • +///
  • +/// AuthErrorCodeUserMismatch - Indicates that an attempt was +/// made to reauthenticate with a user which is not the current user. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
+/// \param credential A user-supplied credential, which will be validated by the +/// server. This can be a successful third-party identity provider sign-in, or +/// an email address and password. +/// +/// \param completion Optionally; the block invoked when the re-authentication +/// operation has finished. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)reauthenticateWithCredential:(FIRAuthCredential *_Nonnull)credential + completion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Renews the user’s authentication using the provided auth provider instance. +/// This method is available on iOS only. +/// \param provider An instance of an auth provider used to initiate the +/// reauthenticate flow. +/// +/// \param uiDelegate Optionally an instance of a class conforming to the +/// AuthUIDelegate protocol, used for presenting the web context. +/// If nil, a default AuthUIDelegate will be used. +/// +/// \param completion Optionally; a block which is invoked when the +/// reauthenticate flow finishes, or is canceled. Invoked asynchronously on the +/// main thread in the future. +/// +- (void)reauthenticateWithProvider: + (id _Nonnull)provider + UIDelegate:(id _Nullable)uiDelegate + completion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. \param completion Optionally; the block invoked when the token +/// is available. Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenWithCompletion: + (void (^_Nullable)(NSString *_Nullable, NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. The authentication token will be refreshed (by making a network +/// request) if it has expired, or if forceRefresh is +/// true. \param forceRefresh Forces a token refresh. Useful if the +/// token becomes invalid for some reason other than an expiration. +/// +/// \param completion Optionally; the block invoked when the token is available. +/// Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenForcingRefresh:(BOOL)forceRefresh + completion: + (void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. \param completion Optionally; the block invoked when the token +/// is available. Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenResultWithCompletion: + (void (^_Nullable)(FIRAuthTokenResult *_Nullable, + NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. The authentication token will be refreshed (by making a network +/// request) if it has expired, or if forcingRefresh is +/// true. \param forcingRefresh Forces a token refresh. Useful if +/// the token becomes invalid for some reason other than an expiration. +/// +/// \param completion Optionally; the block invoked when the token is available. +/// Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenResultForcingRefresh:(BOOL)forcingRefresh + completion:(void (^_Nullable)( + FIRAuthTokenResult *_Nullable, + NSError *_Nullable))completion; +/// Associates a user account from a third-party identity provider with this +/// user and returns additional identity provider data. Invoked asynchronously +/// on the main thread in the future. Possible error codes:
    +///
  • +/// AuthErrorCodeProviderAlreadyLinked - Indicates an attempt +/// to link a provider of a type already linked to this account. +///
  • +///
  • +/// AuthErrorCodeCredentialAlreadyInUse - Indicates an attempt +/// to link with a credential that has already been linked with a different +/// Firebase account. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that accounts +/// with the identity provider represented by the credential are not +/// enabled. Enable them in the Auth section of the Firebase console. +///
  • +///
+/// This method may also return error codes associated with +/// updateEmail(to:) and updatePassword(to:) on +/// User. \param credential The credential for the identity +/// provider. +/// +/// \param completion Optionally; the block invoked when the unlinking is +/// complete, or fails. +/// +- (void)linkWithCredential:(FIRAuthCredential *_Nonnull)credential + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Link the user with the provided auth provider instance. +/// This method is available on iOSonly. +/// \param provider An instance of an auth provider used to initiate the link +/// flow. +/// +/// \param uiDelegate Optionally an instance of a class conforming to the +/// AuthUIDelegate protocol used for presenting the web context. If +/// nil, a default AuthUIDelegate will be used. +/// +/// \param completion Optionally; a block which is invoked when the link flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)linkWithProvider:(id _Nonnull)provider + UIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Disassociates a user account from a third-party identity provider with this +/// user. Invoked asynchronously on the main thread in the future. Possible +/// error codes:
    +///
  • +/// AuthErrorCodeNoSuchProvider - Indicates an attempt to +/// unlink a provider that is not linked to the account. +///
  • +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating email is a +/// security sensitive operation that requires a recent login from the user. +/// This error indicates the user has not signed in recently enough. To +/// resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param provider The provider ID of the provider to unlink. +/// +/// \param completion Optionally; the block invoked when the unlinking is +/// complete, or fails. +/// +- (void)unlinkFromProvider:(NSString *_Nonnull)provider + completion:(void (^_Nullable)(FIRUser *_Nullable, + NSError *_Nullable))completion; +/// Initiates email verification for the user. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeUserNotFound - Indicates the user account was +/// not found. +///
  • +///
+/// \param completion Optionally; the block invoked when the request to send an +/// email verification is complete, or fails. Invoked asynchronously on the main +/// thread in the future. +/// +- (void)sendEmailVerificationWithCompletion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Initiates email verification for the user. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeUserNotFound - Indicates the user account was +/// not found. +///
  • +///
+/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; the block invoked when the request to send an +/// email verification is complete, or fails. Invoked asynchronously on the main +/// thread in the future. +/// +- (void)sendEmailVerificationWithActionCodeSettings: + (FIRActionCodeSettings *_Nullable)actionCodeSettings + completion: + (void (^_Nullable)( + NSError *_Nullable))completion; +/// Deletes the user account (also signs out the user, if this was the current +/// user). Possible error codes:
    +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating email is a +/// security sensitive operation that requires a recent login from the user. +/// This error indicates the user has not signed in recently enough. To +/// resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param completion Optionally; the block invoked when the request to delete +/// the account is complete, or fails. Invoked asynchronously on the main thread +/// in the future. +/// +- (void)deleteWithCompletion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Send an email to verify the ownership of the account then update to the new +/// email. \param email The email to be updated to. +/// +/// \param completion Optionally; the block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void)sendEmailVerificationBeforeUpdatingEmail:(NSString *_Nonnull)email + completion: + (void (^_Nullable)( + NSError *_Nullable))completion; +/// Send an email to verify the ownership of the account then update to the new +/// email. \param email The email to be updated to. +/// +/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; the block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void) + sendEmailVerificationBeforeUpdatingEmail:(NSString *_Nonnull)email + actionCodeSettings:(FIRActionCodeSettings *_Nullable) + actionCodeSettings + completion:(void (^_Nullable)( + NSError *_Nullable))completion; +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// The provider’s user ID for the user. +@property(nonatomic, copy) NSString *_Nonnull uid; +/// The name of the user. +@property(nonatomic, copy) NSString *_Nullable displayName; +/// The URL of the user’s profile photo. +@property(nonatomic, copy) NSURL *_Nullable photoURL; +/// The user’s email address. +@property(nonatomic, copy) NSString *_Nullable email; +/// A phone number associated with the user. +/// This property is only available for users authenticated via phone number +/// auth. +@property(nonatomic, copy) NSString *_Nullable phoneNumber; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, + introduced = 13) SWIFT_AVAILABILITY(ios, + introduced = 13) + @interface FIRUser(SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// A data class representing the metadata corresponding to a Firebase user. +SWIFT_CLASS_NAMED("UserMetadata") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRUserMetadata : NSObject +/// Stores the last sign in date for the corresponding Firebase user. +@property(nonatomic, readonly, copy) NSDate *_Nullable lastSignInDate; +/// Stores the creation date for the corresponding Firebase user. +@property(nonatomic, readonly, copy) NSDate *_Nullable creationDate; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRUserMetadata( + SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// Represents an object capable of updating a user’s profile data. +/// Properties are marked as being part of a profile update when they are set. +/// Setting a property value to nil is not the same as leaving the property +/// unassigned. +SWIFT_CLASS_NAMED("UserProfileChangeRequest") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRUserProfileChangeRequest : NSObject +/// The name of the user. +@property(nonatomic, copy) NSString *_Nullable displayName; +/// The URL of the user’s profile photo. +@property(nonatomic, copy) NSURL *_Nullable photoURL; +/// Commits any pending changes. +/// Invoked asynchronously on the main thread in the future. +/// This method should only be called once.Once called, property values should +/// not be changed. \param completion Optionally; the block invoked when the +/// user profile change has been applied. +/// +- (void)commitChangesWithCompletion: + (void (^_Nullable)(NSError *_Nullable))completion; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +#endif +#if __has_attribute(external_source_symbol) +#pragma clang attribute pop +#endif +#if defined(__cplusplus) +#endif +#pragma clang diagnostic pop +#endif + +#elif defined(__x86_64__) && __x86_64__ +// Copyright 2024 Google LLC +// Copied from Firebase iOS SDK 11.0.0. + +// Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 +// clang-1500.1.0.2.5) +#ifndef FIREBASEAUTH_SWIFT_H +#define FIREBASEAUTH_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 "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include + +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#endif +#if defined(__cplusplus) +#if defined(__arm64e__) && __has_include() +#include +#else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-macro-identifier" +#ifndef __ptrauth_swift_value_witness_function_pointer +#define __ptrauth_swift_value_witness_function_pointer(x) +#endif +#ifndef __ptrauth_swift_class_method_pointer +#define __ptrauth_swift_class_method_pointer(x) +#endif +#pragma clang diagnostic pop +#endif +#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 !defined(SWIFT_RUNTIME_NAME) +#if __has_attribute(objc_runtime_name) +#define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +#define SWIFT_RUNTIME_NAME(X) +#endif +#endif +#if !defined(SWIFT_COMPILE_NAME) +#if __has_attribute(swift_name) +#define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +#define SWIFT_COMPILE_NAME(X) +#endif +#endif +#if !defined(SWIFT_METHOD_FAMILY) +#if __has_attribute(objc_method_family) +#define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +#define SWIFT_METHOD_FAMILY(X) +#endif +#endif +#if !defined(SWIFT_NOESCAPE) +#if __has_attribute(noescape) +#define SWIFT_NOESCAPE __attribute__((noescape)) +#else +#define SWIFT_NOESCAPE +#endif +#endif +#if !defined(SWIFT_RELEASES_ARGUMENT) +#if __has_attribute(ns_consumed) +#define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +#define SWIFT_RELEASES_ARGUMENT +#endif +#endif +#if !defined(SWIFT_WARN_UNUSED_RESULT) +#if __has_attribute(warn_unused_result) +#define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define SWIFT_WARN_UNUSED_RESULT +#endif +#endif +#if !defined(SWIFT_NORETURN) +#if __has_attribute(noreturn) +#define SWIFT_NORETURN __attribute__((noreturn)) +#else +#define SWIFT_NORETURN +#endif +#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 __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 !defined(SWIFT_DEPRECATED_OBJC) +#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 +#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(SWIFT_INDIRECT_RESULT) +#define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#endif +#if !defined(SWIFT_CONTEXT) +#define SWIFT_CONTEXT __attribute__((swift_context)) +#endif +#if !defined(SWIFT_ERROR_RESULT) +#define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#endif +#if defined(__cplusplus) +#define SWIFT_NOEXCEPT noexcept +#else +#define SWIFT_NOEXCEPT +#endif +#if !defined(SWIFT_C_INLINE_THUNK) +#if __has_attribute(always_inline) +#if __has_attribute(nodebug) +#define SWIFT_C_INLINE_THUNK \ + inline __attribute__((always_inline)) __attribute__((nodebug)) +#else +#define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) +#endif +#else +#define SWIFT_C_INLINE_THUNK inline +#endif +#endif +#if defined(_WIN32) +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +#define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) +#endif +#else +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +#define SWIFT_IMPORT_STDLIB_SYMBOL +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(objc_modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import FirebaseAuthInterop; +@import Foundation; +@import ObjectiveC; +@import UIKit; +#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 = "FirebaseAuth", \ + generated_declaration))), \ + apply_to = \ + any(function, enum, objc_interface, objc_category, objc_protocol)) +#pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +enum FIRActionCodeOperation : NSInteger; +@class NSString; + +/// Manages information regarding action codes. +SWIFT_CLASS_NAMED("ActionCodeInfo") +@interface FIRActionCodeInfo : NSObject +/// The operation being performed. +@property(nonatomic, readonly) enum FIRActionCodeOperation operation; +/// The email address to which the code was sent. The new email address in the +/// case of ActionCodeOperation.recoverEmail. +@property(nonatomic, readonly, copy) NSString *_Nonnull email; +/// The email that is being recovered in the case of +/// ActionCodeOperation.recoverEmail. +@property(nonatomic, readonly, copy) NSString *_Nullable previousEmail; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Operations which can be performed with action codes. +typedef SWIFT_ENUM_NAMED(NSInteger, FIRActionCodeOperation, + "ActionCodeOperation", open){ + /// Action code for unknown operation. + FIRActionCodeOperationUnknown = 0, + /// Action code for password reset operation. + FIRActionCodeOperationPasswordReset = 1, + /// Action code for verify email operation. + FIRActionCodeOperationVerifyEmail = 2, + /// Action code for recover email operation. + FIRActionCodeOperationRecoverEmail = 3, + /// Action code for email link operation. + FIRActionCodeOperationEmailLink = 4, + /// Action code for verifying and changing email. + FIRActionCodeOperationVerifyAndChangeEmail = 5, + /// Action code for reverting second factor addition. + FIRActionCodeOperationRevertSecondFactorAddition = 6, +}; + +@class NSURL; + +/// Used to set and retrieve settings related to handling action codes. +SWIFT_CLASS_NAMED("ActionCodeSettings") +@interface FIRActionCodeSettings : NSObject +/// This URL represents the state/Continue URL in the form of a universal link. +/// This URL can should be constructed as a universal link that would either +/// directly open the app where the action code would be handled or continue to +/// the app after the action code is handled by Firebase. +@property(nonatomic, copy) NSURL *_Nullable URL; +/// Indicates whether the action code link will open the app directly or after +/// being redirected from a Firebase owned web widget. +@property(nonatomic) BOOL handleCodeInApp; +/// The iOS bundle ID, if available. The default value is the current app’s +/// bundle ID. +@property(nonatomic, copy) NSString *_Nullable iOSBundleID; +/// The Android package name, if available. +@property(nonatomic, copy) NSString *_Nullable androidPackageName; +/// The minimum Android version supported, if available. +@property(nonatomic, copy) NSString *_Nullable androidMinimumVersion; +/// Indicates whether the Android app should be installed on a device where it +/// is not available. +@property(nonatomic) BOOL androidInstallIfNotAvailable; +/// The Firebase Dynamic Link domain used for out of band code flow. +@property(nonatomic, copy) NSString *_Nullable dynamicLinkDomain; +/// Sets the iOS bundle ID. +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +/// Sets the Android package name, the flag to indicate whether or not to +/// install the app, and the minimum Android version supported. If +/// installIfNotAvailable is set to true and the link +/// is opened on an android device, it will try to install the app if not +/// already available. Otherwise the web URL is used. \param androidPackageName +/// The Android package name. +/// +/// \param installIfNotAvailable Indicates whether or not the app should be +/// installed if not available. +/// +/// \param minimumVersion The minimum version of Android supported. +/// +- (void)setAndroidPackageName:(NSString *_Nonnull)androidPackageName + installIfNotAvailable:(BOOL)installIfNotAvailable + minimumVersion:(NSString *_Nullable)minimumVersion; +@end + +/// This class will allow developers to easily extract information about out of +/// band links. +SWIFT_CLASS_NAMED("ActionCodeURL") +@interface FIRActionCodeURL : NSObject +/// Returns the API key from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSString *_Nullable APIKey; +/// Returns the mode of oob action. +/// The property will be of ActionCodeOperation type. +/// It will return .unknown if no oob action is provided. +@property(nonatomic, readonly) enum FIRActionCodeOperation operation; +/// Returns the email action code from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSString *_Nullable code; +/// Returns the continue URL from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSURL *_Nullable continueURL; +/// Returns the language code from the link. nil, if not provided. +@property(nonatomic, readonly, copy) NSString *_Nullable languageCode; +/// Construct an ActionCodeURL from an out of band link (e.g. email +/// link). \param link The oob link string used to construct the action code +/// URL. +/// +/// +/// returns: +/// The ActionCodeURL object constructed based on the oob link provided. +- (nullable instancetype)actionCodeURLWithLink:(NSString *_Nonnull)link + OBJC_DESIGNATED_INITIALIZER SWIFT_METHOD_FAMILY(init); +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class NSCoder; + +SWIFT_CLASS_NAMED("AdditionalUserInfo") +@interface FIRAdditionalUserInfo : NSObject +/// The provider identifier. +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// Dictionary containing the additional IdP specific information. +@property(nonatomic, readonly, copy) + NSDictionary *_Nullable profile; +/// The name of the user. +@property(nonatomic, readonly, copy) NSString *_Nullable username; +/// Indicates whether or not the current user was signed in for the first time. +@property(nonatomic, readonly) BOOL isNewUser; +/// Indicates whether or not the current user was signed in for the first time. +- (BOOL)newUser SWIFT_WARN_UNUSED_RESULT; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)aDecoder + OBJC_DESIGNATED_INITIALIZER; +- (void)encodeWithCoder:(NSCoder *_Nonnull)aCoder; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@interface FIRAdditionalUserInfo (SWIFT_EXTENSION (FirebaseAuth)) < + NSSecureCoding> +@end + +@class FIRApp; +@class FIRUser; +@class FIRAuthSettings; +@class FIRAuthDataResult; +@protocol FIRFederatedAuthProvider; +@protocol FIRAuthUIDelegate; +@class FIRAuthCredential; +@protocol NSObject; +@class NSError; +@class NSData; +enum FIRAuthAPNSTokenType : NSInteger; + +/// Manages authentication for Firebase apps. +/// This class is thread-safe. +SWIFT_CLASS_NAMED("Auth") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRAuth + : NSObject +/// Gets the auth object for the default Firebase app. +/// The default Firebase app must have already been configured or an exception +/// will be raised. ++ (FIRAuth *_Nonnull)auth SWIFT_WARN_UNUSED_RESULT; +/// Gets the auth object for a FirebaseApp. +/// \param app The app for which to retrieve the associated Auth +/// instance. +/// +/// +/// returns: +/// The Auth instance associated with the given app. ++ (FIRAuth *_Nonnull)authWithApp:(FIRApp *_Nonnull)app SWIFT_WARN_UNUSED_RESULT; +/// Gets the FirebaseApp object that this auth object is connected +/// to. +@property(nonatomic, readonly, weak) FIRApp *_Nullable app; +/// Synchronously gets the cached current user, or null if there is none. +@property(nonatomic, readonly, strong) FIRUser *_Nullable currentUser; +/// The current user language code. +/// This property can be set to the app’s current language by +/// calling useAppLanguage(). +/// The string used to set this property must be a language code that follows +/// BCP 47. +@property(nonatomic, copy) NSString *_Nullable languageCode; +/// Contains settings related to the auth object. +@property(nonatomic, strong) FIRAuthSettings *_Nullable settings; +/// The current user access group that the Auth instance is using. +/// Default is nil. +@property(nonatomic, readonly, copy) NSString *_Nullable userAccessGroup; +/// Contains shareAuthStateAcrossDevices setting related to the auth object. +/// If userAccessGroup is not set, setting shareAuthStateAcrossDevices will +/// have no effect. You should set shareAuthStateAcrossDevices to its desired +/// state and then set the userAccessGroup after. +@property(nonatomic) BOOL shareAuthStateAcrossDevices; +/// The tenant ID of the auth instance. nil if none is available. +@property(nonatomic, copy) NSString *_Nullable tenantID; +/// The custom authentication domain used to handle all sign-in redirects. +/// End-users will see +/// this domain when signing in. This domain must be allowlisted in the Firebase +/// Console. +@property(nonatomic, copy) NSString *_Nullable customAuthDomain; +/// Sets the currentUser on the receiver to the provided user +/// object. \param user The user object to be set as the current user of the +/// calling Auth instance. +/// +/// \param completion Optionally; a block invoked after the user of the calling +/// Auth instance has been updated or an error was encountered. +/// +- (void)updateCurrentUser:(FIRUser *_Nullable)user + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// [Deprecated] Fetches the list of all sign-in methods previously used for the +/// provided email address. This method returns an empty list when Email +/// Enumeration Protection is enabled, irrespective of the number of +/// authentication methods available for the given email. Possible error codes: +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. \param email The email address for which to obtain a list of +/// sign-in methods. +/// +/// \param completion Optionally; a block which is invoked when the list of sign +/// in methods for the specified email address is ready or an error was +/// encountered. Invoked asynchronously on the main thread in the future. +/// +- (void)fetchSignInMethodsForEmail:(NSString *_Nonnull)email + completion: + (void (^_Nullable)(NSArray *_Nullable, + NSError *_Nullable))completion + SWIFT_DEPRECATED_MSG( + "`fetchSignInMethods` is deprecated and will be removed in a future " + "release. This method returns an empty list when Email Enumeration " + "Protection is enabled."); +/// Signs in using an email address and password. +/// When Email +/// Enumeration Protection is enabled, this method fails with an error in +/// case of an invalid email/password. Possible error codes:
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
+/// \param email The user’s email address. +/// +/// \param password The user’s password. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithEmail:(NSString *_Nonnull)email + password:(NSString *_Nonnull)password + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Signs in using an email address and email sign-in link. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
+/// \param email The user’s email address. +/// +/// \param link The email sign-in link. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithEmail:(NSString *_Nonnull)email + link:(NSString *_Nonnull)link + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Signs in using the provided auth provider instance. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password. +///
  • +///
  • +/// AuthErrorCodeWebNetworkRequestFailed - Indicates that a +/// network request within a SFSafariViewController or WKWebView failed. +///
  • +///
  • +/// AuthErrorCodeWebInternalError - Indicates that an internal +/// error occurred within a SFSafariViewController or WKWebView. +///
  • +///
  • +/// AuthErrorCodeWebSignInUserInteractionFailure - Indicates a +/// general failure during a web sign-in flow. +///
  • +///
  • +/// AuthErrorCodeWebContextAlreadyPresented - Indicates that an +/// attempt was made to present a new web context while one was already +/// being presented. +///
  • +///
  • +/// AuthErrorCodeWebContextCancelled - Indicates that the URL +/// presentation was cancelled prematurely by the user. +///
  • +///
  • +/// AuthErrorCodeAccountExistsWithDifferentCredential - +/// Indicates the email asserted by the credential (e.g. the email in a +/// Facebook access token) is already in use by an existing account, that +/// cannot be authenticated with this sign-in method. Call +/// fetchProvidersForEmail for this user’s email and then prompt them to +/// sign in with any of the sign-in providers returned. This error will only +/// be thrown if the “One account per email address” setting is enabled in +/// the Firebase console, under Auth settings. +///
  • +///
+/// \param provider An instance of an auth provider used to initiate the sign-in +/// flow. +/// +/// \param uiDelegate Optionally an instance of a class conforming to the +/// AuthUIDelegate protocol, this is used for presenting the web context. If +/// nil, a default AuthUIDelegate will be used. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithProvider:(id _Nonnull)provider + UIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion + SWIFT_AVAILABILITY(watchos, unavailable) + SWIFT_AVAILABILITY(macos, unavailable) + SWIFT_AVAILABILITY(tvos, unavailable); +/// Asynchronously signs in to Firebase with the given 3rd-party credentials +/// (e.g. a Facebook login Access Token, a Google ID Token/Access Token pair, +/// etc.) and returns additional identity provider data. Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidCredential - Indicates the supplied +/// credential is invalid. This could happen if it has expired or it is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that accounts +/// with the identity provider represented by the credential are not +/// enabled. Enable them in the Auth section of the Firebase console. +///
  • +///
  • +/// AuthErrorCodeAccountExistsWithDifferentCredential - +/// Indicates the email asserted by the credential (e.g. the email in a +/// Facebook access token) is already in use by an existing account, that +/// cannot be authenticated with this sign-in method. Call +/// fetchProvidersForEmail for this user’s email and then prompt them to +/// sign in with any of the sign-in providers returned. This error will only +/// be thrown if the “One account per email address” setting is enabled in +/// the Firebase console, under Auth settings. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// sign in with an incorrect password, if credential is of the type +/// EmailPasswordAuthCredential. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeMissingVerificationID - Indicates that the +/// phone auth credential was created with an empty verification ID. +///
  • +///
  • +/// AuthErrorCodeMissingVerificationCode - Indicates that the +/// phone auth credential was created with an empty verification code. +///
  • +///
  • +/// AuthErrorCodeInvalidVerificationCode - Indicates that the +/// phone auth credential was created with an invalid verification Code. +///
  • +///
  • +/// AuthErrorCodeInvalidVerificationID - Indicates that the +/// phone auth credential was created with an invalid verification ID. +///
  • +///
  • +/// AuthErrorCodeSessionExpired - Indicates that the SMS code +/// has expired. +///
  • +///
+/// \param credential The credential supplied by the IdP. +/// +/// \param completion Optionally; a block which is invoked when the sign in flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithCredential:(FIRAuthCredential *_Nonnull)credential + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously creates and becomes an anonymous user. +/// If there is already an anonymous user signed in, that user will be returned +/// instead. If there is any other existing user signed in, that user will be +/// signed out. Possible error codes:
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that anonymous +/// accounts are not enabled. Enable them in the Auth section of the +/// Firebase console. +///
  • +///
+/// \param completion Optionally; a block which is invoked when the sign in +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInAnonymouslyWithCompletion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Asynchronously creates and becomes an anonymous user. +/// If there is already an anonymous user signed in, that user will be returned +/// instead. If there is any other existing user signed in, that user will be +/// signed out. Possible error codes:
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that anonymous +/// accounts are not enabled. Enable them in the Auth section of the +/// Firebase console. +///
  • +///
+/// +/// returns: +/// The AuthDataResult after the successful signin. +- (void)signInAnonymouslyWithCompletionHandler: + (void (^_Nonnull)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completionHandler + SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); +/// Asynchronously signs in to Firebase with the given Auth token. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidCustomToken - Indicates a validation +/// error with the custom token. +///
  • +///
  • +/// AuthErrorCodeCustomTokenMismatch - Indicates the service +/// account and the API key belong to different projects. +///
  • +///
+/// \param token A self-signed custom auth token. +/// +/// \param completion Optionally; a block which is invoked when the sign in +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)signInWithCustomToken:(NSString *_Nonnull)token + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Creates and, on success, signs in a user with the given email address and +/// password. Possible error codes:
    +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeEmailAlreadyInUse - Indicates the email used +/// to attempt sign up already exists. Call fetchProvidersForEmail to check +/// which sign-in mechanisms the user used, and prompt the user to sign in +/// with one of those. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that email and +/// password accounts are not enabled. Enable them in the Auth section of +/// the Firebase console. +///
  • +///
  • +/// AuthErrorCodeWeakPassword - Indicates an attempt to set a +/// password that is considered too weak. The +/// NSLocalizedFailureReasonErrorKey field in the NSError.userInfo +/// dictionary object will contain more detailed explanation that can be +/// shown to the user. +///
  • +///
+/// \param email The user’s email address. +/// +/// \param password The user’s desired password. +/// +/// \param completion Optionally; a block which is invoked when the sign up flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)createUserWithEmail:(NSString *_Nonnull)email + password:(NSString *_Nonnull)password + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Resets the password given a code sent to the user outside of the app and a +/// new password for the user. Possible error codes:
    +///
  • +/// AuthErrorCodeWeakPassword - Indicates an attempt to set a +/// password that is considered too weak. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates the +/// administrator disabled sign in with the specified identity provider. +///
  • +///
  • +/// AuthErrorCodeExpiredActionCode - Indicates the OOB code is +/// expired. +///
  • +///
  • +/// AuthErrorCodeInvalidActionCode - Indicates the OOB code is +/// invalid. +///
  • +///
+/// \param code The reset code. +/// +/// \param newPassword The new password. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)confirmPasswordResetWithCode:(NSString *_Nonnull)code + newPassword:(NSString *_Nonnull)newPassword + completion: + (void (^_Nonnull)(NSError *_Nullable))completion; +/// Checks the validity of an out of band code. +/// \param code The out of band code to check validity. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)checkActionCode:(NSString *_Nonnull)code + completion:(void (^_Nonnull)(FIRActionCodeInfo *_Nullable, + NSError *_Nullable))completion; +/// Checks the validity of a verify password reset code. +/// \param code The password reset code to be verified. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)verifyPasswordResetCode:(NSString *_Nonnull)code + completion: + (void (^_Nonnull)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Applies out of band code. +/// This method will not work for out of band codes which require an additional +/// parameter, such as password reset code. \param code The out of band code to +/// be applied. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)applyActionCode:(NSString *_Nonnull)code + completion:(void (^_Nonnull)(NSError *_Nullable))completion; +/// Initiates a password reset for the given email address. +/// This method does not throw an +/// error when there’s no user account with the given email address and Email +/// Enumeration Protection is enabled. Possible error codes:
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
+/// \param email The email address of the user. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)sendPasswordResetWithEmail:(NSString *_Nonnull)email + completion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Initiates a password reset for the given email address and +/// ActionCodeSettings object. This method does not throw an error +/// when there’s no user account with the given email address and Email +/// Enumeration Protection is enabled. Possible error codes:
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeMissingIosBundleID - Indicates that the iOS +/// bundle ID is missing when handleCodeInApp is set to true. +///
  • +///
  • +/// AuthErrorCodeMissingAndroidPackageName - Indicates that the +/// android package name is missing when the androidInstallApp +/// flag is set to true. +///
  • +///
  • +/// AuthErrorCodeUnauthorizedDomain - Indicates that the domain +/// specified in the continue URL is not allowlisted in the Firebase +/// console. +///
  • +///
  • +/// AuthErrorCodeInvalidContinueURI - Indicates that the domain +/// specified in the continue URL is not valid. +///
  • +///
+/// \param email The email address of the user. +/// +/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)sendPasswordResetWithEmail:(NSString *_Nonnull)email + actionCodeSettings: + (FIRActionCodeSettings *_Nullable)actionCodeSettings + completion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Sends a sign in with email link to provided email address. +/// \param email The email address of the user. +/// +/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; a block which is invoked when the request +/// finishes. Invoked asynchronously on the main thread in the future. +/// +- (void)sendSignInLinkToEmail:(NSString *_Nonnull)email + actionCodeSettings: + (FIRActionCodeSettings *_Nonnull)actionCodeSettings + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Signs out the current user. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeKeychainError - Indicates an error occurred +/// when accessing the keychain. The +/// NSLocalizedFailureReasonErrorKey field in the +/// userInfo dictionary will contain more information about the +/// error encountered. +///
  • +///
+- (BOOL)signOut:(NSError *_Nullable *_Nullable)error; +/// Checks if link is an email sign-in link. +/// \param link The email sign-in link. +/// +/// +/// returns: +/// true when the link passed matches the expected format of an +/// email sign-in link. +- (BOOL)isSignInWithEmailLink:(NSString *_Nonnull)link SWIFT_WARN_UNUSED_RESULT; +/// Initializes reCAPTCHA using the settings configured for the project or +/// tenant. If you change the tenant ID of the Auth instance, the +/// configuration will be reloaded. +- (void)initializeRecaptchaConfigWithCompletion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Registers a block as an “auth state did change” listener. +/// To be invoked when: +///
    +///
  • +/// The block is registered as a listener, +///
  • +///
  • +/// A user with a different UID from the current user has signed in, or +///
  • +///
  • +/// The current user has signed out. +///
  • +///
+/// The block is invoked immediately after adding it according to its standard +/// invocation semantics, asynchronously on the main thread. Users should pay +/// special attention to making sure the block does not inadvertently retain +/// objects which should not be retained by the long-lived block. The block +/// itself will be retained by Auth until it is unregistered or +/// until the Auth instance is otherwise deallocated. \param +/// listener The block to be invoked. The block is always invoked asynchronously +/// on the main thread, even for it’s initial invocation after having been added +/// as a listener. +/// +/// +/// returns: +/// A handle useful for manually unregistering the block as a listener. +- (id _Nonnull)addAuthStateDidChangeListener: + (void (^_Nonnull)(FIRAuth *_Nonnull, FIRUser *_Nullable))listener + SWIFT_WARN_UNUSED_RESULT; +/// Unregisters a block as an “auth state did change” listener. +/// \param listenerHandle The handle for the listener. +/// +- (void)removeAuthStateDidChangeListener:(id _Nonnull)listenerHandle; +/// Registers a block as an “ID token did change” listener. +/// To be invoked when: +///
    +///
  • +/// The block is registered as a listener, +///
  • +///
  • +/// A user with a different UID from the current user has signed in, +///
  • +///
  • +/// The ID token of the current user has been refreshed, or +///
  • +///
  • +/// The current user has signed out. +///
  • +///
+/// The block is invoked immediately after adding it according to its standard +/// invocation semantics, asynchronously on the main thread. Users should pay +/// special attention to making sure the block does not inadvertently retain +/// objects which should not be retained by the long-lived block. The block +/// itself will be retained by Auth until it is unregistered or +/// until the Auth instance is otherwise deallocated. \param +/// listener The block to be invoked. The block is always invoked asynchronously +/// on the main thread, even for it’s initial invocation after having been added +/// as a listener. +/// +/// +/// returns: +/// A handle useful for manually unregistering the block as a listener. +- (id _Nonnull)addIDTokenDidChangeListener: + (void (^_Nonnull)(FIRAuth *_Nonnull, FIRUser *_Nullable))listener + SWIFT_WARN_UNUSED_RESULT; +/// Unregisters a block as an “ID token did change” listener. +/// \param listenerHandle The handle for the listener. +/// +- (void)removeIDTokenDidChangeListener:(id _Nonnull)listenerHandle; +/// Sets languageCode to the app’s current language. +- (void)useAppLanguage; +/// Configures Firebase Auth to connect to an emulated host instead of the +/// remote backend. +- (void)useEmulatorWithHost:(NSString *_Nonnull)host port:(NSInteger)port; +/// Revoke the users token with authorization code. +/// \param completion (Optional) the block invoked when the request to revoke +/// the token is complete, or fails. Invoked asynchronously on the main thread +/// in the future. +/// +- (void)revokeTokenWithAuthorizationCode:(NSString *_Nonnull)authorizationCode + completion:(void (^_Nullable)(NSError *_Nullable)) + completion; +/// Switch userAccessGroup and current user to the given accessGroup and the +/// user stored in it. +- (BOOL)useUserAccessGroup:(NSString *_Nullable)accessGroup + error:(NSError *_Nullable *_Nullable)error; +/// Get the stored user in the given accessGroup. +/// This API is not supported on tvOS when +/// shareAuthStateAcrossDevices is set to true. and +/// will return nil. Please refer to +/// https://github.com/firebase/firebase-ios-sdk/issues/8878 for details. +- (FIRUser *_Nullable) + getStoredUserForAccessGroup:(NSString *_Nullable)accessGroup + error:(NSError *_Nullable *_Nullable)outError + SWIFT_WARN_UNUSED_RESULT; +/// The APNs token used for phone number authentication. +/// The type of the token (production or sandbox) will be automatically +/// detected based on your provisioning profile. +/// This property is available on iOS only. +/// If swizzling is disabled, the APNs Token must be set for phone number auth +/// to work, by either setting this property or by calling +/// setAPNSToken(_:type:). +@property(nonatomic, readonly, copy) NSData *_Nullable APNSToken; +/// Sets the APNs token along with its type. +/// This method is available on iOS only. +/// If swizzling is disabled, the APNs Token must be set for phone number auth +/// to work, by either setting calling this method or by setting the +/// APNSToken property. +- (void)setAPNSToken:(NSData *_Nonnull)token + type:(enum FIRAuthAPNSTokenType)type; +/// Whether the specific remote notification is handled by Auth . +/// This method is available on iOS only. +/// If swizzling is disabled, related remote notifications must be forwarded to +/// this method for phone number auth to work. \param userInfo A dictionary that +/// contains information related to the notification in question. +/// +/// +/// returns: +/// Whether or the notification is handled. A return value of true +/// means the notification is for Firebase Auth so the caller should ignore the +/// notification from further processing, and false means the +/// notification is for the app (or another library) so the caller should +/// continue handling this notification as usual. +- (BOOL)canHandleNotification:(NSDictionary *_Nonnull)userInfo + SWIFT_WARN_UNUSED_RESULT; +/// Whether the specific URL is handled by Auth . +/// This method is available on iOS only. +/// If swizzling is disabled, URLs received by the application delegate must be +/// forwarded to this method for phone number auth to work. \param url The URL +/// received by the application delegate from any of the openURL method. +/// +/// +/// returns: +/// Whether or the URL is handled. true means the URL is for +/// Firebase Auth so the caller should ignore the URL from further processing, +/// and false means the the URL is for the app (or another library) +/// so the caller should continue handling this URL as usual. +- (BOOL)canHandleURL:(NSURL *_Nonnull)url SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class UIScene; +@class UIOpenURLContext; + +SWIFT_AVAILABILITY(ios, introduced = 13.0) +@interface FIRAuth (SWIFT_EXTENSION (FirebaseAuth)) +- (void)scene:(UIScene *_Nonnull)scene + openURLContexts:(NSSet *_Nonnull)URLContexts; +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, + introduced = 13) SWIFT_AVAILABILITY(ios, + introduced = 13) + @interface FIRAuth(SWIFT_EXTENSION(FirebaseAuth)) +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. This method is not for public use. It is for Firebase clients +/// of AuthInterop. +- (void)getTokenForcingRefresh:(BOOL)forceRefresh + withCallback:(void (^_Nonnull)(NSString *_Nullable, + NSError *_Nullable))callback; +/// Get the current Auth user’s UID. Returns nil if there is no user signed in. +/// This method is not for public use. It is for Firebase clients of +/// AuthInterop. +- (NSString *_Nullable)getUserID SWIFT_WARN_UNUSED_RESULT; +@end + +@class UIApplication; + +SWIFT_AVAILABILITY(ios, introduced = 13.0) +@interface FIRAuth (SWIFT_EXTENSION (FirebaseAuth)) +- (void)application:(UIApplication *_Nonnull)application + didRegisterForRemoteNotificationsWithDeviceToken: + (NSData *_Nonnull)deviceToken; +- (void)application:(UIApplication *_Nonnull)application + didFailToRegisterForRemoteNotificationsWithError:(NSError *_Nonnull)error; +- (void)application:(UIApplication *_Nonnull)application + didReceiveRemoteNotification:(NSDictionary *_Nonnull)userInfo + fetchCompletionHandler: + (void (^_Nonnull)(UIBackgroundFetchResult))completionHandler; +- (BOOL)application:(UIApplication *_Nonnull)application + openURL:(NSURL *_Nonnull)url + options:(NSDictionary *_Nonnull) + options SWIFT_WARN_UNUSED_RESULT; +@end + +/// The APNs token type for the app. +/// This enum is available on iOS, macOS Catalyst, tvOS, and watchOS only. +typedef SWIFT_ENUM_NAMED(NSInteger, FIRAuthAPNSTokenType, "AuthAPNSTokenType", + open){ + /// Unknown token type. + /// The actual token type will be detected from the provisioning profile in + /// the app’s bundle. + FIRAuthAPNSTokenTypeUnknown = 0, + /// Sandbox token type. + FIRAuthAPNSTokenTypeSandbox = 1, + /// Production token type. + FIRAuthAPNSTokenTypeProd = 2, +}; + +/// Public representation of a credential. +SWIFT_CLASS_NAMED("AuthCredential") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthCredential : NSObject +/// The name of the identity provider for the credential. +@property(nonatomic, readonly, copy) NSString *_Nonnull provider; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class FIROAuthCredential; + +/// Helper object that contains the result of a successful sign-in, link and +/// reauthenticate action. It contains references to a User +/// instance and an AdditionalUserInfo instance. +SWIFT_CLASS_NAMED("AuthDataResult") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthDataResult : NSObject +/// The signed in user. +@property(nonatomic, readonly, strong) FIRUser *_Nonnull user; +/// If available, contains the additional IdP specific information about signed +/// in user. +@property(nonatomic, readonly, strong) + FIRAdditionalUserInfo *_Nullable additionalUserInfo; +/// This property will be non-nil after a successful headful-lite sign-in via +/// signIn(with:uiDelegate:completion:). +/// May be used to obtain the accessToken and/or IDToken +/// pertaining to a recently signed-in user. +@property(nonatomic, readonly, strong) FIROAuthCredential *_Nullable credential; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class) BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; ++ (void)setSupportsSecureCoding:(BOOL)value; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthDataResult( + SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// Error codes used by Firebase Auth. +typedef SWIFT_ENUM_NAMED(NSInteger, FIRAuthErrorCode, "AuthErrorCode", open){ + /// Indicates a validation error with the custom token. + FIRAuthErrorCodeInvalidCustomToken = 17000, + /// Indicates the service account and the API key belong to different + /// projects. + FIRAuthErrorCodeCustomTokenMismatch = 17002, + /// Indicates the IDP token or requestUri is invalid. + FIRAuthErrorCodeInvalidCredential = 17004, + /// Indicates the user’s account is disabled on the server. + FIRAuthErrorCodeUserDisabled = 17005, + /// Indicates the administrator disabled sign in with the specified identity + /// provider. + FIRAuthErrorCodeOperationNotAllowed = 17006, + /// Indicates the email used to attempt a sign up is already in use. + FIRAuthErrorCodeEmailAlreadyInUse = 17007, + /// Indicates the email is invalid. + FIRAuthErrorCodeInvalidEmail = 17008, + /// Indicates the user attempted sign in with a wrong password. + FIRAuthErrorCodeWrongPassword = 17009, + /// Indicates that too many requests were made to a server method. + FIRAuthErrorCodeTooManyRequests = 17010, + /// Indicates the user account was not found. + FIRAuthErrorCodeUserNotFound = 17011, + /// Indicates account linking is required. + FIRAuthErrorCodeAccountExistsWithDifferentCredential = 17012, + /// Indicates the user has attempted to change email or password more than 5 + /// minutes after + /// signing in. + FIRAuthErrorCodeRequiresRecentLogin = 17014, + /// Indicates an attempt to link a provider to which the account is already + /// linked. + FIRAuthErrorCodeProviderAlreadyLinked = 17015, + /// Indicates an attempt to unlink a provider that is not linked. + FIRAuthErrorCodeNoSuchProvider = 17016, + /// Indicates user’s saved auth credential is invalid the user needs to sign + /// in again. + FIRAuthErrorCodeInvalidUserToken = 17017, + /// Indicates a network error occurred (such as a timeout interrupted + /// connection or + /// unreachable host). These types of errors are often recoverable with a + /// retry. The + /// NSUnderlyingError field in the + /// NSError.userInfo dictionary will contain the error + /// encountered. + FIRAuthErrorCodeNetworkError = 17020, + /// Indicates the saved token has expired for example the user may have + /// changed account + /// password on another device. The user needs to sign in again on the + /// device that made this + /// request. + FIRAuthErrorCodeUserTokenExpired = 17021, + /// Indicates an invalid API key was supplied in the request. + FIRAuthErrorCodeInvalidAPIKey = 17023, + /// Indicates that an attempt was made to reauthenticate with a user which + /// is not the current + /// user. + FIRAuthErrorCodeUserMismatch = 17024, + /// Indicates an attempt to link with a credential that has already been + /// linked with a + /// different Firebase account. + FIRAuthErrorCodeCredentialAlreadyInUse = 17025, + /// Indicates an attempt to set a password that is considered too weak. + FIRAuthErrorCodeWeakPassword = 17026, + /// Indicates the App is not authorized to use Firebase Authentication with + /// the + /// provided API Key. + FIRAuthErrorCodeAppNotAuthorized = 17028, + /// Indicates the OOB code is expired. + FIRAuthErrorCodeExpiredActionCode = 17029, + /// Indicates the OOB code is invalid. + FIRAuthErrorCodeInvalidActionCode = 17030, + /// Indicates that there are invalid parameters in the payload during a + /// “send password reset email” attempt. + FIRAuthErrorCodeInvalidMessagePayload = 17031, + /// Indicates that the sender email is invalid during a “send password reset + /// email” attempt. + FIRAuthErrorCodeInvalidSender = 17032, + /// Indicates that the recipient email is invalid. + FIRAuthErrorCodeInvalidRecipientEmail = 17033, + /// Indicates that an email address was expected but one was not provided. + FIRAuthErrorCodeMissingEmail = 17034, + /// Indicates that the iOS bundle ID is missing when a iOS App Store ID is + /// provided. + FIRAuthErrorCodeMissingIosBundleID = 17036, + /// Indicates that the android package name is missing when the + /// androidInstallApp flag is set + /// to true. + FIRAuthErrorCodeMissingAndroidPackageName = 17037, + /// Indicates that the domain specified in the continue URL is not + /// allowlisted in the Firebase + /// console. + FIRAuthErrorCodeUnauthorizedDomain = 17038, + /// Indicates that the domain specified in the continue URI is not valid. + FIRAuthErrorCodeInvalidContinueURI = 17039, + /// Indicates that a continue URI was not provided in a request to the + /// backend which requires one. + FIRAuthErrorCodeMissingContinueURI = 17040, + /// Indicates that a phone number was not provided in a call to + /// verifyPhoneNumber:completion:. + FIRAuthErrorCodeMissingPhoneNumber = 17041, + /// Indicates that an invalid phone number was provided in a call to + /// verifyPhoneNumber:completion:. + FIRAuthErrorCodeInvalidPhoneNumber = 17042, + /// Indicates that the phone auth credential was created with an empty + /// verification code. + FIRAuthErrorCodeMissingVerificationCode = 17043, + /// Indicates that an invalid verification code was used in the + /// verifyPhoneNumber request. + FIRAuthErrorCodeInvalidVerificationCode = 17044, + /// Indicates that the phone auth credential was created with an empty + /// verification ID. + FIRAuthErrorCodeMissingVerificationID = 17045, + /// Indicates that an invalid verification ID was used in the + /// verifyPhoneNumber request. + FIRAuthErrorCodeInvalidVerificationID = 17046, + /// Indicates that the APNS device token is missing in the verifyClient + /// request. + FIRAuthErrorCodeMissingAppCredential = 17047, + /// Indicates that an invalid APNS device token was used in the verifyClient + /// request. + FIRAuthErrorCodeInvalidAppCredential = 17048, + /// Indicates that the SMS code has expired. + FIRAuthErrorCodeSessionExpired = 17051, + /// Indicates that the quota of SMS messages for a given project has been + /// exceeded. + FIRAuthErrorCodeQuotaExceeded = 17052, + /// Indicates that the APNs device token could not be obtained. The app may + /// not have set up + /// remote notification correctly or may fail to forward the APNs device + /// token to Auth + /// if app delegate swizzling is disabled. + FIRAuthErrorCodeMissingAppToken = 17053, + /// Indicates that the app fails to forward remote notification to FIRAuth. + FIRAuthErrorCodeNotificationNotForwarded = 17054, + /// Indicates that the app could not be verified by Firebase during phone + /// number authentication. + FIRAuthErrorCodeAppNotVerified = 17055, + /// Indicates that the reCAPTCHA token is not valid. + FIRAuthErrorCodeCaptchaCheckFailed = 17056, + /// Indicates that an attempt was made to present a new web context while + /// one was already being + /// presented. + FIRAuthErrorCodeWebContextAlreadyPresented = 17057, + /// Indicates that the URL presentation was cancelled prematurely by the + /// user. + FIRAuthErrorCodeWebContextCancelled = 17058, + /// Indicates a general failure during the app verification flow. + FIRAuthErrorCodeAppVerificationUserInteractionFailure = 17059, + /// Indicates that the clientID used to invoke a web flow is invalid. + FIRAuthErrorCodeInvalidClientID = 17060, + /// Indicates that a network request within a SFSafariViewController or + /// WKWebView failed. + FIRAuthErrorCodeWebNetworkRequestFailed = 17061, + /// Indicates that an internal error occurred within a + /// SFSafariViewController or WKWebView. + FIRAuthErrorCodeWebInternalError = 17062, + /// Indicates a general failure during a web sign-in flow. + FIRAuthErrorCodeWebSignInUserInteractionFailure = 17063, + /// Indicates that the local player was not authenticated prior to + /// attempting Game Center signin. + FIRAuthErrorCodeLocalPlayerNotAuthenticated = 17066, + /// Indicates that a non-null user was expected as an argument to the + /// operation but a null + /// user was provided. + FIRAuthErrorCodeNullUser = 17067, + /// Indicates that a Firebase Dynamic Link is not activated. + FIRAuthErrorCodeDynamicLinkNotActivated = 17068, + /// Represents the error code for when the given provider id for a web + /// operation is invalid. + FIRAuthErrorCodeInvalidProviderID = 17071, + /// Represents the error code for when an attempt is made to update the + /// current user with a + /// tenantId that differs from the current FirebaseAuth instance’s tenantId. + FIRAuthErrorCodeTenantIDMismatch = 17072, + /// Represents the error code for when a request is made to the backend with + /// an associated tenant + /// ID for an operation that does not support multi-tenancy. + FIRAuthErrorCodeUnsupportedTenantOperation = 17073, + /// Indicates that the Firebase Dynamic Link domain used is either not + /// configured or is + /// unauthorized for the current project. + FIRAuthErrorCodeInvalidDynamicLinkDomain = 17074, + /// Indicates that the credential is rejected because it’s malformed or + /// mismatching. + FIRAuthErrorCodeRejectedCredential = 17075, + /// Indicates that the GameKit framework is not linked prior to attempting + /// Game Center signin. + FIRAuthErrorCodeGameKitNotLinked = 17076, + /// Indicates that the second factor is required for signin. + FIRAuthErrorCodeSecondFactorRequired = 17078, + /// Indicates that the multi factor session is missing. + FIRAuthErrorCodeMissingMultiFactorSession = 17081, + /// Indicates that the multi factor info is missing. + FIRAuthErrorCodeMissingMultiFactorInfo = 17082, + /// Indicates that the multi factor session is invalid. + FIRAuthErrorCodeInvalidMultiFactorSession = 17083, + /// Indicates that the multi factor info is not found. + FIRAuthErrorCodeMultiFactorInfoNotFound = 17084, + /// Indicates that the operation is admin restricted. + FIRAuthErrorCodeAdminRestrictedOperation = 17085, + /// Indicates that the email is required for verification. + FIRAuthErrorCodeUnverifiedEmail = 17086, + /// Indicates that the second factor is already enrolled. + FIRAuthErrorCodeSecondFactorAlreadyEnrolled = 17087, + /// Indicates that the maximum second factor count is exceeded. + FIRAuthErrorCodeMaximumSecondFactorCountExceeded = 17088, + /// Indicates that the first factor is not supported. + FIRAuthErrorCodeUnsupportedFirstFactor = 17089, + /// Indicates that the a verified email is required to changed to. + FIRAuthErrorCodeEmailChangeNeedsVerification = 17090, + /// Indicates that the request does not contain a client identifier. + FIRAuthErrorCodeMissingClientIdentifier = 17093, + /// Indicates that the nonce is missing or invalid. + FIRAuthErrorCodeMissingOrInvalidNonce = 17094, + /// Raised when n Cloud Function returns a blocking error. Will include a + /// message returned from + /// the function. + FIRAuthErrorCodeBlockingCloudFunctionError = 17105, + /// Indicates that reCAPTCHA Enterprise integration is not enabled for this + /// project. + FIRAuthErrorCodeRecaptchaNotEnabled = 17200, + /// Indicates that the reCAPTCHA token is missing from the backend request. + FIRAuthErrorCodeMissingRecaptchaToken = 17201, + /// Indicates that the reCAPTCHA token sent with the backend request is + /// invalid. + FIRAuthErrorCodeInvalidRecaptchaToken = 17202, + /// Indicates that the requested reCAPTCHA action is invalid. + FIRAuthErrorCodeInvalidRecaptchaAction = 17203, + /// Indicates that the client type is missing from the request. + FIRAuthErrorCodeMissingClientType = 17204, + /// Indicates that the reCAPTCHA version is missing from the request. + FIRAuthErrorCodeMissingRecaptchaVersion = 17205, + /// Indicates that the reCAPTCHA version sent to the backend is invalid. + FIRAuthErrorCodeInvalidRecaptchaVersion = 17206, + /// Indicates that the request type sent to the backend is invalid. + FIRAuthErrorCodeInvalidReqType = 17207, + /// Indicates that the reCAPTCHA SDK is not linked to the app. + FIRAuthErrorCodeRecaptchaSDKNotLinked = 17208, + /// Indicates that the reCAPTCHA SDK site key wasn’t found. + FIRAuthErrorCodeRecaptchaSiteKeyMissing = 17209, + /// Indicates that the reCAPTCHA SDK actions class failed to create. + FIRAuthErrorCodeRecaptchaActionCreationFailed = 17210, + /// Indicates an error occurred while attempting to access the keychain. + FIRAuthErrorCodeKeychainError = 17995, + /// Indicates an internal error occurred. + FIRAuthErrorCodeInternalError = 17999, + /// Raised when a JWT fails to parse correctly. May be accompanied by an + /// underlying error + /// describing which step of the JWT parsing process failed. + FIRAuthErrorCodeMalformedJWT = 18000, +}; + +/// Error Codes common to all API Methods: +SWIFT_CLASS_NAMED("AuthErrors") +@interface FIRAuthErrors : NSObject +/// The Firebase Auth error domain. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull domain;) ++ (NSString *_Nonnull)domain SWIFT_WARN_UNUSED_RESULT; +/// The name of the key for the error short string of an error code. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull userInfoNameKey;) ++ (NSString *_Nonnull)userInfoNameKey SWIFT_WARN_UNUSED_RESULT; +/// Error codes for Email operations +/// Errors with one of the following three codes: +///
    +///
  • +/// accountExistsWithDifferentCredential +///
  • +///
  • +/// credentialAlreadyInUse +///
  • +///
  • +/// emailAlreadyInUse` +///
  • +///
+/// may contain an NSError.userInfo dictionary object which +/// contains this key. The value associated with this key is an NSString of the +/// email address of the account that already exists. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull userInfoEmailKey;) ++ (NSString *_Nonnull)userInfoEmailKey SWIFT_WARN_UNUSED_RESULT; +/// The key used to read the updated Auth credential from the userInfo +/// dictionary of the NSError object returned. This is the updated auth +/// credential the developer should use for recovery if applicable. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull userInfoUpdatedCredentialKey;) ++ (NSString *_Nonnull)userInfoUpdatedCredentialKey SWIFT_WARN_UNUSED_RESULT; +/// The key used to read the MFA resolver from the userInfo dictionary of the +/// NSError object returned when 2FA is required for sign-incompletion. +SWIFT_CLASS_PROPERTY( + @property(nonatomic, class, readonly, copy) + NSString *_Nonnull FIRAuthErrorUserInfoMultiFactorResolverKey;) ++ (NSString *_Nonnull) + FIRAuthErrorUserInfoMultiFactorResolverKey SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// Determines settings related to an auth object. +SWIFT_CLASS_NAMED("AuthSettings") +@interface FIRAuthSettings : NSObject +/// Flag to determine whether app verification should be disabled for testing or +/// not. +@property(nonatomic) BOOL appVerificationDisabledForTesting; +/// Flag to determine whether app verification should be disabled for testing or +/// not. +@property(nonatomic) BOOL isAppVerificationDisabledForTesting; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +- (id _Nonnull)copyWithZone:(struct _NSZone *_Nullable)zone + SWIFT_WARN_UNUSED_RESULT; +@end + +@class NSDate; + +/// A data class containing the ID token JWT string and other properties +/// associated with the token including the decoded payload claims. +SWIFT_CLASS_NAMED("AuthTokenResult") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthTokenResult : NSObject +/// Stores the JWT string of the ID token. +@property(nonatomic, copy) NSString *_Nonnull token; +/// Stores the ID token’s expiration date. +@property(nonatomic, copy) NSDate *_Nonnull expirationDate; +/// Stores the ID token’s authentication date. +/// This is the date the user was signed in and NOT the date the token was +/// refreshed. +@property(nonatomic, copy) NSDate *_Nonnull authDate; +/// Stores the date that the ID token was issued. +/// This is the date last refreshed and NOT the last authentication date. +@property(nonatomic, copy) NSDate *_Nonnull issuedAtDate; +/// Stores sign-in provider through which the token was obtained. +@property(nonatomic, copy) NSString *_Nonnull signInProvider; +/// Stores sign-in second factor through which the token was obtained. +@property(nonatomic, copy) NSString *_Nonnull signInSecondFactor; +/// Stores the entire payload of claims found on the ID token. +/// This includes the standard +/// reserved claims as well as custom claims set by the developer via the Admin +/// SDK. +@property(nonatomic, copy) NSDictionary *_Nonnull claims; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRAuthTokenResult( + SWIFT_EXTENSION(FirebaseAuth)) +@end + +@class UIViewController; + +/// A protocol to handle user interface interactions for Firebase Auth. +/// This protocol is available on iOS, macOS Catalyst, and tvOS only. +SWIFT_PROTOCOL_NAMED("AuthUIDelegate") +@protocol FIRAuthUIDelegate +/// If implemented, this method will be invoked when Firebase Auth needs to +/// display a view controller. \param viewControllerToPresent The view +/// controller to be presented. +/// +/// \param flag Decides whether the view controller presentation should be +/// animated. +/// +/// \param completion The block to execute after the presentation finishes. +/// This block has no return value and takes no parameters. +/// +- (void)presentViewController: + (UIViewController *_Nonnull)viewControllerToPresent + animated:(BOOL)flag + completion:(void (^_Nullable)(void))completion; +/// If implemented, this method will be invoked when Firebase Auth needs to +/// display a view controller. \param flag Decides whether removing the view +/// controller should be animated or not. +/// +/// \param completion The block to execute after the presentation finishes. +/// This block has no return value and takes no parameters. +/// +- (void)dismissViewControllerAnimated:(BOOL)flag + completion:(void (^_Nullable)(void))completion; +@end + +/// A concrete implementation of AuthProvider for Email & Password +/// Sign In. +SWIFT_CLASS_NAMED("EmailAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIREmailAuthProvider : NSObject +/// A string constant identifying the email & password identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for an email & password sign in +/// \param email The user’s email address. +/// +/// \param password The user’s password. +/// +/// +/// returns: +/// An AuthCredential containing the email & password credential. ++ (FIRAuthCredential *_Nonnull)credentialWithEmail:(NSString *_Nonnull)email + password:(NSString *_Nonnull)password + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for an email & link sign in. +/// \param email The user’s email address. +/// +/// \param link The email sign-in link. +/// +/// +/// returns: +/// An AuthCredential containing the email & link credential. ++ (FIRAuthCredential *_Nonnull)credentialWithEmail:(NSString *_Nonnull)email + link:(NSString *_Nonnull)link + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// Utility class for constructing Facebook Sign In credentials. +SWIFT_CLASS_NAMED("FacebookAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRFacebookAuthProvider : NSObject +/// A string constant identifying the Facebook identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Facebook sign in. +/// \param accessToken The Access Token from Facebook. +/// +/// +/// returns: +/// An AuthCredential containing the Facebook credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithAccessToken: + (NSString *_Nonnull)accessToken SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Utility type for constructing federated auth provider credentials. +SWIFT_PROTOCOL_NAMED("FederatedAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @protocol FIRFederatedAuthProvider +/// Used to obtain an auth credential via a mobile web flow. +/// This method is available on iOS only. +/// \param uiDelegate An optional UI delegate used to present the mobile web +/// flow. +/// +- (void)getCredentialWithUIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nonnull)( + FIRAuthCredential *_Nullable, + NSError *_Nullable))completionHandler + SWIFT_AVAILABILITY(watchos, introduced = 8) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); +@end + +/// A concrete implementation of AuthProvider for Game Center Sign +/// In. Not available on watchOS. +SWIFT_CLASS_NAMED("GameCenterAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRGameCenterAuthProvider : NSObject +/// A string constant identifying the Game Center identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Game Center sign in. ++ (void)getCredentialWithCompletion: + (void (^_Nonnull)(FIRAuthCredential *_Nullable, + NSError *_Nullable))completion; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Utility class for constructing GitHub Sign In credentials. +SWIFT_CLASS_NAMED("GitHubAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRGitHubAuthProvider : NSObject +/// A string constant identifying the GitHub identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a GitHub sign in. +/// \param token The GitHub OAuth access token. +/// +/// +/// returns: +/// An AuthCredential containing the GitHub credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithToken:(NSString *_Nonnull)token + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Utility class for constructing Google Sign In credentials. +SWIFT_CLASS_NAMED("GoogleAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRGoogleAuthProvider : NSObject +/// A string constant identifying the Google identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Google sign in. +/// \param idToken The ID Token from Google. +/// +/// \param accessToken The Access Token from Google. +/// +/// +/// returns: +/// An AuthCredential containing the Google credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithIDToken:(NSString *_Nonnull)idToken + accessToken: + (NSString *_Nonnull)accessToken + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +@class FIRMultiFactorInfo; +@class FIRMultiFactorSession; +@class FIRMultiFactorAssertion; + +/// The interface defining the multi factor related properties and operations +/// pertaining to a user. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactor") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactor : NSObject +@property(nonatomic, copy) + NSArray *_Nonnull enrolledFactors; +/// Get a session for a second factor enrollment operation. +/// This is used to identify the current user trying to enroll a second factor. +/// \param completion A block with the session identifier for a second factor +/// enrollment operation. +/// +- (void)getSessionWithCompletion: + (void (^_Nullable)(FIRMultiFactorSession *_Nullable, + NSError *_Nullable))completion; +/// Enrolls a second factor as identified by the +/// MultiFactorAssertion parameter for the current user. \param +/// assertion The MultiFactorAssertion. +/// +/// \param displayName An optional display name associated with the multi factor +/// to enroll. +/// +/// \param completion The block invoked when the request is complete, or fails. +/// +- (void)enrollWithAssertion:(FIRMultiFactorAssertion *_Nonnull)assertion + displayName:(NSString *_Nullable)displayName + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Unenroll the given multi factor. +/// \param completion The block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void)unenrollWithInfo:(FIRMultiFactorInfo *_Nonnull)factorInfo + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Unenroll the given multi factor. +/// \param completion The block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void)unenrollWithFactorUID:(NSString *_Nonnull)factorUID + completion:(void (^_Nullable)(NSError *_Nullable))completion; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) SWIFT_AVAILABILITY( + macos, introduced = 10.15) SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactor(SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// The base class for asserting ownership of a second factor. This is +/// equivalent to the AuthCredential class. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorAssertion") +@interface FIRMultiFactorAssertion : NSObject +/// The second factor identifier for this opaque object asserting a second +/// factor. +@property(nonatomic, copy) NSString *_Nonnull factorID; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Safe public structure used to represent a second factor entity from a client +/// perspective. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorInfo") +@interface FIRMultiFactorInfo : NSObject +/// The multi-factor enrollment ID. +@property(nonatomic, readonly, copy) NSString *_Nonnull UID; +/// The user friendly name of the current second factor. +@property(nonatomic, readonly, copy) NSString *_Nullable displayName; +/// The second factor enrollment date. +@property(nonatomic, readonly, copy) NSDate *_Nonnull enrollmentDate; +/// The identifier of the second factor. +@property(nonatomic, readonly, copy) NSString *_Nonnull factorID; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@interface FIRMultiFactorInfo (SWIFT_EXTENSION (FirebaseAuth)) +@end + +/// The subclass of base class MultiFactorAssertion, used to assert +/// ownership of a phone second factor. This class is available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorResolver") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactorResolver : NSObject +/// The opaque session identifier for the current sign-in flow. +@property(nonatomic, readonly, strong) FIRMultiFactorSession *_Nonnull session; +/// The list of hints for the second factors needed to complete the sign-in for +/// the current session. +@property(nonatomic, readonly, copy) + NSArray *_Nonnull hints; +/// The Auth reference for the current MultiResolver. +@property(nonatomic, readonly, strong) FIRAuth *_Nonnull auth; +/// A helper function to help users complete sign in with a second factor using +/// a MultiFactorAssertion confirming the user successfully +/// completed the second factor challenge. \param completion The block invoked +/// when the request is complete, or fails. +/// +- (void)resolveSignInWithAssertion:(FIRMultiFactorAssertion *_Nonnull)assertion + completion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Opaque object that identifies the current session to enroll a second factor +/// or to complete sign in when previously enrolled. Identifies the current +/// session to enroll a second factor or to complete sign in when previously +/// enrolled. It contains additional context on the existing user, notably the +/// confirmation that the user passed the first factor challenge. This class is +/// available on iOS only. +SWIFT_CLASS_NAMED("MultiFactorSession") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRMultiFactorSession : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Internal implementation of AuthCredential for generic +/// credentials. +SWIFT_CLASS_NAMED("OAuthCredential") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIROAuthCredential + : FIRAuthCredential +/// The ID Token associated with this credential. +@property(nonatomic, readonly, copy) NSString *_Nullable IDToken; +/// The access token associated with this credential. +@property(nonatomic, readonly, copy) NSString *_Nullable accessToken; +/// The secret associated with this credential. This will be nil for OAuth 2.0 +/// providers. OAuthCredential already exposes a provider getter. +/// This will help the developer determine whether an access token / secret pair +/// is needed. +@property(nonatomic, readonly, copy) NSString *_Nullable secret; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class) BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; ++ (void)setSupportsSecureCoding:(BOOL)value; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +@end + +@class NSPersonNameComponents; + +/// Utility class for constructing OAuth Sign In credentials. +SWIFT_CLASS_NAMED("OAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIROAuthProvider + : NSObject +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Array used to configure the OAuth scopes. +@property(nonatomic, copy) NSArray *_Nullable scopes; +/// Dictionary used to configure the OAuth custom parameters. +@property(nonatomic, copy) + NSDictionary *_Nullable customParameters; +/// The provider ID indicating the specific OAuth provider this OAuthProvider +/// instance represents. +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// An instance of OAuthProvider corresponding to the given provider ID. +/// \param providerID The provider ID of the IDP for which this auth provider +/// instance will be configured. +/// +/// +/// returns: +/// An instance of OAuthProvider corresponding to the specified provider ID. ++ (FIROAuthProvider *_Nonnull)providerWithProviderID: + (NSString *_Nonnull)providerID SWIFT_WARN_UNUSED_RESULT; +/// An instance of OAuthProvider corresponding to the given provider ID and auth +/// instance. \param providerID The provider ID of the IDP for which this auth +/// provider instance will be configured. +/// +/// \param auth The auth instance to be associated with the OAuthProvider +/// instance. +/// +/// +/// returns: +/// An instance of OAuthProvider corresponding to the specified provider ID. ++ (FIROAuthProvider *_Nonnull)providerWithProviderID: + (NSString *_Nonnull)providerID + auth:(FIRAuth *_Nonnull)auth + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for the OAuth 2 provider identified +/// by provider ID, ID token, and access token. \param providerID The provider +/// ID associated with the Auth credential being created. +/// +/// \param idToken The IDToken associated with the Auth credential being +/// created. +/// +/// \param accessToken The access token associated with the Auth credential be +/// created, if available. +/// +/// +/// returns: +/// An AuthCredential for the specified provider ID, ID token and access token. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + IDToken:(NSString *_Nonnull)idToken + accessToken:(NSString *_Nullable)accessToken + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for the OAuth 2 provider identified +/// by provider ID, ID token, and access token. \param providerID The provider +/// ID associated with the Auth credential being created. +/// +/// \param accessToken The access token associated with the Auth credential be +/// created, if available. +/// +/// +/// returns: +/// An AuthCredential for the specified provider ID, ID token and access token. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + accessToken:(NSString *_Nonnull)accessToken + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for that OAuth 2 provider identified +/// by provider ID, ID token, raw nonce, and access token. \param providerID The +/// provider ID associated with the Auth credential being created. +/// +/// \param idToken The IDToken associated with the Auth credential being +/// created. +/// +/// \param rawNonce The raw nonce associated with the Auth credential being +/// created. +/// +/// \param accessToken The access token associated with the Auth credential be +/// created. +/// +/// +/// returns: +/// An AuthCredential for the specified provider ID, ID token and access token. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + IDToken:(NSString *_Nonnull)idToken + rawNonce:(NSString *_Nonnull)rawNonce + accessToken:(NSString *_Nonnull)accessToken + SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for that OAuth 2 provider identified +/// by providerID using an ID token and raw nonce. \param providerID The +/// provider ID associated with the Auth credential being created. +/// +/// \param idToken The IDToken associated with the Auth credential being +/// created. +/// +/// \param rawNonce The raw nonce associated with the Auth credential being +/// created. +/// +/// +/// returns: +/// An AuthCredential. ++ (FIROAuthCredential *_Nonnull) + credentialWithProviderID:(NSString *_Nonnull)providerID + IDToken:(NSString *_Nonnull)idToken + rawNonce:(NSString *_Nonnull)rawNonce + SWIFT_WARN_UNUSED_RESULT; +/// Used to obtain an auth credential via a mobile web flow. +/// This method is available on iOS only. +/// \param uiDelegate An optional UI delegate used to present the mobile web +/// flow. +/// +- (void)getCredentialWithUIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nonnull)( + FIRAuthCredential *_Nullable, + NSError *_Nullable))completionHandler + SWIFT_AVAILABILITY(watchos, introduced = 8) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); +/// Creates an AuthCredential for the Sign in with Apple OAuth 2 +/// provider identified by ID token, raw nonce, and full name.This method is +/// specific to the Sign in with Apple OAuth 2 provider as this provider +/// requires the full name to be passed explicitly. \param idToken The IDToken +/// associated with the Sign in with Apple Auth credential being created. +/// +/// \param rawNonce The raw nonce associated with the Sign in with Apple Auth +/// credential being created. +/// +/// \param fullName The full name associated with the Sign in with Apple Auth +/// credential being created. +/// +/// +/// returns: +/// An AuthCredential. ++ (FIROAuthCredential *_Nonnull) + appleCredentialWithIDToken:(NSString *_Nonnull)idToken + rawNonce:(NSString *_Nullable)rawNonce + fullName:(NSPersonNameComponents *_Nullable)fullName + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Implementation of AuthCredential for Phone Auth credentials. +/// This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneAuthCredential") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneAuthCredential + : FIRAuthCredential +SWIFT_CLASS_PROPERTY(@property(nonatomic, class) BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; ++ (void)setSupportsSecureCoding:(BOOL)value; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +@end + +@class FIRPhoneMultiFactorInfo; + +/// A concrete implementation of AuthProvider for phone auth +/// providers. This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneAuthProvider : NSObject +/// A string constant identifying the phone identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Returns an instance of PhoneAuthProvider for the default +/// Auth object. ++ (FIRPhoneAuthProvider *_Nonnull)provider SWIFT_WARN_UNUSED_RESULT; +/// Returns an instance of PhoneAuthProvider for the provided +/// Auth object. \param auth The auth object to associate with the +/// phone auth provider instance. +/// ++ (FIRPhoneAuthProvider *_Nonnull)providerWithAuth:(FIRAuth *_Nonnull)auth + SWIFT_WARN_UNUSED_RESULT; +/// Starts the phone number authentication flow by sending a verification code +/// to the specified phone number. Possible error codes:
    +///
  • +/// AuthErrorCodeCaptchaCheckFailed - Indicates that the +/// reCAPTCHA token obtained by the Firebase Auth is invalid or has expired. +///
  • +///
  • +/// AuthErrorCodeQuotaExceeded - Indicates that the phone +/// verification quota for this project has been exceeded. +///
  • +///
  • +/// AuthErrorCodeInvalidPhoneNumber - Indicates that the phone +/// number provided is invalid. +///
  • +///
  • +/// AuthErrorCodeMissingPhoneNumber - Indicates that a phone +/// number was not provided. +///
  • +///
+/// \param phoneNumber The phone number to be verified. +/// +/// \param uiDelegate An object used to present the SFSafariViewController. The +/// object is retained by this method until the completion block is executed. +/// +/// \param completion The callback to be invoked when the verification flow is +/// finished. +/// +- (void)verifyPhoneNumber:(NSString *_Nonnull)phoneNumber + UIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Verify ownership of the second factor phone number by the current user. +/// \param phoneNumber The phone number to be verified. +/// +/// \param uiDelegate An object used to present the SFSafariViewController. The +/// object is retained by this method until the completion block is executed. +/// +/// \param multiFactorSession A session to identify the MFA flow. For +/// enrollment, this identifies the user trying to enroll. For sign-in, this +/// identifies that the user already passed the first factor challenge. +/// +/// \param completion The callback to be invoked when the verification flow is +/// finished. +/// +- (void)verifyPhoneNumber:(NSString *_Nonnull)phoneNumber + UIDelegate:(id _Nullable)uiDelegate + multiFactorSession:(FIRMultiFactorSession *_Nullable)multiFactorSession + completion:(void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Verify ownership of the second factor phone number by the current user. +/// \param multiFactorInfo The phone multi factor whose number need to be +/// verified. +/// +/// \param uiDelegate An object used to present the SFSafariViewController. The +/// object is retained by this method until the completion block is executed. +/// +/// \param multiFactorSession A session to identify the MFA flow. For +/// enrollment, this identifies the user trying to enroll. For sign-in, this +/// identifies that the user already passed the first factor challenge. +/// +/// \param completion The callback to be invoked when the verification flow is +/// finished. +/// +- (void) + verifyPhoneNumberWithMultiFactorInfo: + (FIRPhoneMultiFactorInfo *_Nonnull)multiFactorInfo + UIDelegate: + (id _Nullable)uiDelegate + multiFactorSession: + (FIRMultiFactorSession *_Nullable)multiFactorSession + completion:(void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable)) + completion; +/// Creates an AuthCredential for the phone number provider +/// identified by the verification ID and verification code. \param +/// verificationID The verification ID obtained from invoking +/// verifyPhoneNumber:completion: +/// +/// \param verificationCode The verification code obtained from the user. +/// +/// +/// returns: +/// The corresponding phone auth credential for the verification ID and +/// verification code provided. +- (FIRPhoneAuthCredential *_Nonnull) + credentialWithVerificationID:(NSString *_Nonnull)verificationID + verificationCode:(NSString *_Nonnull)verificationCode + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// The subclass of base class FIRMultiFactorAssertion, used to assert ownership +/// of a phone second factor. This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneMultiFactorAssertion") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneMultiFactorAssertion + : FIRMultiFactorAssertion +@end + +/// The data structure used to help initialize an assertion for a second factor +/// entity to the Firebase Auth/CICP server. Depending on the type of second +/// factor, this will help generate the assertion. This class is available on +/// iOS only. +SWIFT_CLASS_NAMED("PhoneMultiFactorGenerator") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRPhoneMultiFactorGenerator : NSObject +/// Initializes the MFA assertion to confirm ownership of the phone second +/// factor. Note that this API is used for both enrolling and signing in with a +/// phone second factor. \param phoneAuthCredential The phone auth credential +/// used for multi factor flows. +/// ++ (FIRPhoneMultiFactorAssertion *_Nonnull)assertionWithCredential: + (FIRPhoneAuthCredential *_Nonnull)phoneAuthCredential + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// Extends the MultiFactorInfo class for phone number second factors. +/// The identifier of this second factor is “phone”. +/// This class is available on iOS only. +SWIFT_CLASS_NAMED("PhoneMultiFactorInfo") +@interface FIRPhoneMultiFactorInfo : FIRMultiFactorInfo +/// The string identifier for using phone as a second factor. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull FIRPhoneMultiFactorID;) ++ (NSString *_Nonnull)FIRPhoneMultiFactorID SWIFT_WARN_UNUSED_RESULT; +/// The string identifier for using TOTP as a second factor. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull FIRTOTPMultiFactorID;) ++ (NSString *_Nonnull)FIRTOTPMultiFactorID SWIFT_WARN_UNUSED_RESULT; +/// This is the phone number associated with the current second factor. +@property(nonatomic, copy) NSString *_Nonnull phoneNumber; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +@end + +/// The subclass of base class MultiFactorAssertion, used to assert ownership of +/// a TOTP (Time-based One Time Password) second factor. This class is available +/// on iOS only. +SWIFT_CLASS_NAMED("TOTPMultiFactorAssertion") +@interface FIRTOTPMultiFactorAssertion : FIRMultiFactorAssertion +@end + +@class FIRTOTPSecret; + +/// The data structure used to help initialize an assertion for a second factor +/// entity to the Firebase Auth/CICP server. Depending on the type of second +/// factor, this will help generate the assertion. This class is available on +/// iOS only. +SWIFT_CLASS_NAMED("TOTPMultiFactorGenerator") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRTOTPMultiFactorGenerator : NSObject +/// Creates a TOTP secret as part of enrolling a TOTP second factor. Used for +/// generating a QR code URL or inputting into a TOTP app. This method uses the +/// auth instance corresponding to the user in the multiFactorSession. \param +/// session The multiFactorSession instance. +/// +/// \param completion Completion block +/// ++ (void)generateSecretWithMultiFactorSession: + (FIRMultiFactorSession *_Nonnull)session + completion:(void (^_Nonnull)( + FIRTOTPSecret *_Nullable, + NSError *_Nullable))completion; +/// Initializes the MFA assertion to confirm ownership of the TOTP second +/// factor. This assertion is used to complete enrollment of TOTP as a second +/// factor. \param secret The TOTP secret. +/// +/// \param oneTimePassword One time password string. +/// +/// +/// returns: +/// The MFA assertion. ++ (FIRTOTPMultiFactorAssertion *_Nonnull) + assertionForEnrollmentWithSecret:(FIRTOTPSecret *_Nonnull)secret + oneTimePassword:(NSString *_Nonnull)oneTimePassword + SWIFT_WARN_UNUSED_RESULT; +/// Initializes the MFA assertion to confirm ownership of the TOTP second +/// factor. This assertion is used to complete signIn with TOTP as a second +/// factor. \param enrollmentID The ID that identifies the enrolled TOTP second +/// factor. +/// +/// \param oneTimePassword one time password string. +/// +/// +/// returns: +/// The MFA assertion. ++ (FIRTOTPMultiFactorAssertion *_Nonnull) + assertionForSignInWithEnrollmentID:(NSString *_Nonnull)enrollmentID + oneTimePassword:(NSString *_Nonnull)oneTimePassword + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +/// The subclass of base class MultiFactorAssertion, used to assert ownership of +/// a TOTP (Time-based One Time Password) second factor. This class is available +/// on iOS only. +SWIFT_CLASS_NAMED("TOTPSecret") +@interface FIRTOTPSecret : NSObject +/// Returns the shared secret key/seed used to generate time-based one-time +/// passwords. +- (NSString *_Nonnull)sharedSecretKey SWIFT_WARN_UNUSED_RESULT; +/// Returns a QRCode URL as described in +/// https://github.com/google/google-authenticator/wiki/Key-Uri-Format. +/// This can be displayed to the user as a QRCode to be scanned into a TOTP app +/// like Google Authenticator. \param accountName The name of the account/app. +/// +/// \param issuer Issuer of the TOTP(likely the app name). +/// +/// +/// returns: +/// A QRCode URL string. +- (NSString *_Nonnull) + generateQRCodeURLWithAccountName:(NSString *_Nonnull)accountName + issuer:(NSString *_Nonnull)issuer + SWIFT_WARN_UNUSED_RESULT; +/// Opens the specified QR Code URL in a password manager like iCloud Keychain. +/// See more details +/// here +- (void)openInOTPAppWithQRCodeURL:(NSString *_Nonnull)qrCodeURL; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +/// Utility class for constructing Twitter Sign In credentials. +SWIFT_CLASS_NAMED("TwitterAuthProvider") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRTwitterAuthProvider : NSObject +/// A string constant identifying the Twitter identity provider. +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, copy) + NSString *_Nonnull id;) ++ (NSString *_Nonnull)id SWIFT_WARN_UNUSED_RESULT; +/// Creates an AuthCredential for a Twitter sign in. +/// \param token The Twitter OAuth token. +/// +/// \param secret The Twitter OAuth secret. +/// +/// +/// returns: +/// An AuthCredential containing the Twitter credentials. ++ (FIRAuthCredential *_Nonnull)credentialWithToken:(NSString *_Nonnull)token + secret:(NSString *_Nonnull)secret + SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; +@end + +/// Represents user data returned from an identity provider. +SWIFT_PROTOCOL_NAMED("UserInfo") +@protocol FIRUserInfo +/// The provider identifier. +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// The provider’s user ID for the user. +@property(nonatomic, readonly, copy) NSString *_Nonnull uid; +/// The name of the user. +@property(nonatomic, readonly, copy) NSString *_Nullable displayName; +/// The URL of the user’s profile photo. +@property(nonatomic, readonly, copy) NSURL *_Nullable photoURL; +/// The user’s email address. +@property(nonatomic, readonly, copy) NSString *_Nullable email; +/// A phone number associated with the user. +/// This property is only available for users authenticated via phone number +/// auth. +@property(nonatomic, readonly, copy) NSString *_Nullable phoneNumber; +@end + +@class FIRUserMetadata; +@class FIRUserProfileChangeRequest; + +/// Represents a user. +/// Firebase Auth does not attempt to validate users +/// when loading them from the keychain. Invalidated users (such as those +/// whose passwords have been changed on another client) are automatically +/// logged out when an auth-dependent operation is attempted or when the +/// ID token is automatically refreshed. +/// This class is thread-safe. +SWIFT_CLASS_NAMED("User") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRUser + : NSObject +/// Indicates the user represents an anonymous user. +@property(nonatomic, readonly) BOOL isAnonymous; +/// Indicates the user represents an anonymous user. +- (BOOL)anonymous SWIFT_WARN_UNUSED_RESULT; +/// Indicates the email address associated with this user has been verified. +@property(nonatomic, readonly) BOOL isEmailVerified; +/// Indicates the email address associated with this user has been verified. +- (BOOL)emailVerified SWIFT_WARN_UNUSED_RESULT; +/// Profile data for each identity provider, if any. +/// This data is cached on sign-in and updated when linking or unlinking. +@property(nonatomic, readonly, copy) + NSArray > *_Nonnull providerData; +/// Metadata associated with the Firebase user in question. +@property(nonatomic, readonly, strong) FIRUserMetadata *_Nonnull metadata; +/// The tenant ID of the current user. nil if none is available. +@property(nonatomic, readonly, copy) NSString *_Nullable tenantID; +/// Multi factor object associated with the user. +/// This property is available on iOS only. +@property(nonatomic, readonly, strong) FIRMultiFactor *_Nonnull multiFactor; +/// [Deprecated] Updates the email address for the user. +/// On success, the cached user profile data is updated. Returns an error when +/// Email +/// Enumeration Protection is enabled. May fail if there is already an +/// account with this email address that was created using email and password +/// authentication. Invoked asynchronously on the main thread in the future. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeEmailAlreadyInUse - Indicates the email is +/// already in use by another account. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating a user’s email +/// is a security sensitive operation that requires a recent login from the +/// user. This error indicates the user has not signed in recently enough. +/// To resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param email The email address for the user. +/// +/// \param completion Optionally; the block invoked when the user profile change +/// has finished. +/// +- (void)updateEmail:(NSString *_Nonnull)email + completion:(void (^_Nullable)(NSError *_Nullable))completion + SWIFT_DEPRECATED_MSG( + "`updateEmail` is deprecated and will be removed in a future release. " + "Use sendEmailVerification(beforeUpdatingEmail:) instead."); +/// Updates the password for the user. On success, the cached user profile data +/// is updated. Invoked asynchronously on the main thread in the future. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates the +/// administrator disabled sign in with the specified identity provider. +///
  • +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating a user’s +/// password is a security sensitive operation that requires a recent login +/// from the user. This error indicates the user has not signed in recently +/// enough. To resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
  • +/// AuthErrorCodeWeakPassword - Indicates an attempt to set a +/// password that is considered too weak. The +/// NSLocalizedFailureReasonErrorKey field in the +/// userInfo dictionary object will contain more detailed +/// explanation that can be shown to the user. +///
  • +///
+/// \param password The new password for the user. +/// +/// \param completion Optionally; the block invoked when the user profile change +/// has finished. +/// +- (void)updatePassword:(NSString *_Nonnull)password + completion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Updates the phone number for the user. On success, the cached user profile +/// data is updated. Invoked asynchronously on the main thread in the future. +/// This method is available on iOS only. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating a user’s phone +/// number is a security sensitive operation that requires a recent login +/// from the user. This error indicates the user has not signed in recently +/// enough. To resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param credential The new phone number credential corresponding to the +/// phone number to be added to the Firebase account, if a phone number is +/// already linked to the account this new phone number will replace it. +/// +/// \param completion Optionally; the block invoked when the user profile change +/// has finished. +/// +- (void)updatePhoneNumberCredential:(FIRPhoneAuthCredential *_Nonnull)credential + completion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Creates an object which may be used to change the user’s profile data. +/// Set the properties of the returned object, then call +/// UserProfileChangeRequest.commitChanges() to perform the updates +/// atomically. +/// +/// returns: +/// An object which may be used to change the user’s profile data atomically. +- (FIRUserProfileChangeRequest *_Nonnull) + profileChangeRequest SWIFT_WARN_UNUSED_RESULT; +/// A refresh token; useful for obtaining new access tokens independently. +/// This property should only be used for advanced scenarios, and is not +/// typically needed. +@property(nonatomic, readonly, copy) NSString *_Nullable refreshToken; +/// Reloads the user’s profile data from the server. +/// May fail with an AuthErrorCodeRequiresRecentLogin error code. +/// In this case you should call reauthenticate(with:) before +/// re-invoking updateEmail(to:). \param completion Optionally; the +/// block invoked when the reload has finished. Invoked asynchronously on the +/// main thread in the future. +/// +- (void)reloadWithCompletion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Renews the user’s authentication tokens by validating a fresh set of +/// credentials supplied by the user and returns additional identity provider +/// data. If the user associated with the supplied credential is different from +/// the current user, or if the validation of the supplied credentials fails; an +/// error is returned and the current user remains signed in. Possible error +/// codes:
    +///
  • +/// AuthErrorCodeInvalidCredential - Indicates the supplied +/// credential is invalid. This could happen if it has expired or it is +/// malformed. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that accounts +/// with the identity provider represented by the credential are not +/// enabled. Enable them in the Auth section of the Firebase console. +///
  • +///
  • +/// AuthErrorCodeEmailAlreadyInUse - Indicates the email +/// asserted by the credential (e.g. the email in a Facebook access token) +/// is already in use by an existing account, that cannot be authenticated +/// with this method. This error will only be thrown if the “One account per +/// email address” setting is enabled in the Firebase console, under Auth +/// settings. Please note that the error code raised in this specific +/// situation may not be the same on Web and Android. +///
  • +///
  • +/// AuthErrorCodeUserDisabled - Indicates the user’s account is +/// disabled. +///
  • +///
  • +/// AuthErrorCodeWrongPassword - Indicates the user attempted +/// reauthentication with an incorrect password, if credential is of the +/// type EmailPasswordAuthCredential. +///
  • +///
  • +/// AuthErrorCodeUserMismatch - Indicates that an attempt was +/// made to reauthenticate with a user which is not the current user. +///
  • +///
  • +/// AuthErrorCodeInvalidEmail - Indicates the email address is +/// malformed. +///
  • +///
+/// \param credential A user-supplied credential, which will be validated by the +/// server. This can be a successful third-party identity provider sign-in, or +/// an email address and password. +/// +/// \param completion Optionally; the block invoked when the re-authentication +/// operation has finished. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)reauthenticateWithCredential:(FIRAuthCredential *_Nonnull)credential + completion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Renews the user’s authentication using the provided auth provider instance. +/// This method is available on iOS only. +/// \param provider An instance of an auth provider used to initiate the +/// reauthenticate flow. +/// +/// \param uiDelegate Optionally an instance of a class conforming to the +/// AuthUIDelegate protocol, used for presenting the web context. +/// If nil, a default AuthUIDelegate will be used. +/// +/// \param completion Optionally; a block which is invoked when the +/// reauthenticate flow finishes, or is canceled. Invoked asynchronously on the +/// main thread in the future. +/// +- (void)reauthenticateWithProvider: + (id _Nonnull)provider + UIDelegate:(id _Nullable)uiDelegate + completion: + (void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. \param completion Optionally; the block invoked when the token +/// is available. Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenWithCompletion: + (void (^_Nullable)(NSString *_Nullable, NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. The authentication token will be refreshed (by making a network +/// request) if it has expired, or if forceRefresh is +/// true. \param forceRefresh Forces a token refresh. Useful if the +/// token becomes invalid for some reason other than an expiration. +/// +/// \param completion Optionally; the block invoked when the token is available. +/// Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenForcingRefresh:(BOOL)forceRefresh + completion: + (void (^_Nullable)(NSString *_Nullable, + NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. \param completion Optionally; the block invoked when the token +/// is available. Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenResultWithCompletion: + (void (^_Nullable)(FIRAuthTokenResult *_Nullable, + NSError *_Nullable))completion; +/// Retrieves the Firebase authentication token, possibly refreshing it if it +/// has expired. The authentication token will be refreshed (by making a network +/// request) if it has expired, or if forcingRefresh is +/// true. \param forcingRefresh Forces a token refresh. Useful if +/// the token becomes invalid for some reason other than an expiration. +/// +/// \param completion Optionally; the block invoked when the token is available. +/// Invoked asynchronously on the main thread in the future. +/// +- (void)getIDTokenResultForcingRefresh:(BOOL)forcingRefresh + completion:(void (^_Nullable)( + FIRAuthTokenResult *_Nullable, + NSError *_Nullable))completion; +/// Associates a user account from a third-party identity provider with this +/// user and returns additional identity provider data. Invoked asynchronously +/// on the main thread in the future. Possible error codes:
    +///
  • +/// AuthErrorCodeProviderAlreadyLinked - Indicates an attempt +/// to link a provider of a type already linked to this account. +///
  • +///
  • +/// AuthErrorCodeCredentialAlreadyInUse - Indicates an attempt +/// to link with a credential that has already been linked with a different +/// Firebase account. +///
  • +///
  • +/// AuthErrorCodeOperationNotAllowed - Indicates that accounts +/// with the identity provider represented by the credential are not +/// enabled. Enable them in the Auth section of the Firebase console. +///
  • +///
+/// This method may also return error codes associated with +/// updateEmail(to:) and updatePassword(to:) on +/// User. \param credential The credential for the identity +/// provider. +/// +/// \param completion Optionally; the block invoked when the unlinking is +/// complete, or fails. +/// +- (void)linkWithCredential:(FIRAuthCredential *_Nonnull)credential + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Link the user with the provided auth provider instance. +/// This method is available on iOSonly. +/// \param provider An instance of an auth provider used to initiate the link +/// flow. +/// +/// \param uiDelegate Optionally an instance of a class conforming to the +/// AuthUIDelegate protocol used for presenting the web context. If +/// nil, a default AuthUIDelegate will be used. +/// +/// \param completion Optionally; a block which is invoked when the link flow +/// finishes, or is canceled. Invoked asynchronously on the main thread in the +/// future. +/// +- (void)linkWithProvider:(id _Nonnull)provider + UIDelegate:(id _Nullable)uiDelegate + completion:(void (^_Nullable)(FIRAuthDataResult *_Nullable, + NSError *_Nullable))completion; +/// Disassociates a user account from a third-party identity provider with this +/// user. Invoked asynchronously on the main thread in the future. Possible +/// error codes:
    +///
  • +/// AuthErrorCodeNoSuchProvider - Indicates an attempt to +/// unlink a provider that is not linked to the account. +///
  • +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating email is a +/// security sensitive operation that requires a recent login from the user. +/// This error indicates the user has not signed in recently enough. To +/// resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param provider The provider ID of the provider to unlink. +/// +/// \param completion Optionally; the block invoked when the unlinking is +/// complete, or fails. +/// +- (void)unlinkFromProvider:(NSString *_Nonnull)provider + completion:(void (^_Nullable)(FIRUser *_Nullable, + NSError *_Nullable))completion; +/// Initiates email verification for the user. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeUserNotFound - Indicates the user account was +/// not found. +///
  • +///
+/// \param completion Optionally; the block invoked when the request to send an +/// email verification is complete, or fails. Invoked asynchronously on the main +/// thread in the future. +/// +- (void)sendEmailVerificationWithCompletion: + (void (^_Nullable)(NSError *_Nullable))completion; +/// Initiates email verification for the user. +/// Possible error codes: +///
    +///
  • +/// AuthErrorCodeInvalidRecipientEmail - Indicates an invalid +/// recipient email was sent in the request. +///
  • +///
  • +/// AuthErrorCodeInvalidSender - Indicates an invalid sender +/// email is set in the console for this action. +///
  • +///
  • +/// AuthErrorCodeInvalidMessagePayload - Indicates an invalid +/// email template for sending update email. +///
  • +///
  • +/// AuthErrorCodeUserNotFound - Indicates the user account was +/// not found. +///
  • +///
+/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; the block invoked when the request to send an +/// email verification is complete, or fails. Invoked asynchronously on the main +/// thread in the future. +/// +- (void)sendEmailVerificationWithActionCodeSettings: + (FIRActionCodeSettings *_Nullable)actionCodeSettings + completion: + (void (^_Nullable)( + NSError *_Nullable))completion; +/// Deletes the user account (also signs out the user, if this was the current +/// user). Possible error codes:
    +///
  • +/// AuthErrorCodeRequiresRecentLogin - Updating email is a +/// security sensitive operation that requires a recent login from the user. +/// This error indicates the user has not signed in recently enough. To +/// resolve, reauthenticate the user by calling +/// reauthenticate(with:). +///
  • +///
+/// \param completion Optionally; the block invoked when the request to delete +/// the account is complete, or fails. Invoked asynchronously on the main thread +/// in the future. +/// +- (void)deleteWithCompletion:(void (^_Nullable)(NSError *_Nullable))completion; +/// Send an email to verify the ownership of the account then update to the new +/// email. \param email The email to be updated to. +/// +/// \param completion Optionally; the block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void)sendEmailVerificationBeforeUpdatingEmail:(NSString *_Nonnull)email + completion: + (void (^_Nullable)( + NSError *_Nullable))completion; +/// Send an email to verify the ownership of the account then update to the new +/// email. \param email The email to be updated to. +/// +/// \param actionCodeSettings An ActionCodeSettings object +/// containing settings related to handling action codes. +/// +/// \param completion Optionally; the block invoked when the request to send the +/// verification email is complete, or fails. +/// +- (void) + sendEmailVerificationBeforeUpdatingEmail:(NSString *_Nonnull)email + actionCodeSettings:(FIRActionCodeSettings *_Nullable) + actionCodeSettings + completion:(void (^_Nullable)( + NSError *_Nullable))completion; +@property(nonatomic, readonly, copy) NSString *_Nonnull providerID; +/// The provider’s user ID for the user. +@property(nonatomic, copy) NSString *_Nonnull uid; +/// The name of the user. +@property(nonatomic, copy) NSString *_Nullable displayName; +/// The URL of the user’s profile photo. +@property(nonatomic, copy) NSURL *_Nullable photoURL; +/// The user’s email address. +@property(nonatomic, copy) NSString *_Nullable email; +/// A phone number associated with the user. +/// This property is only available for users authenticated via phone number +/// auth. +@property(nonatomic, copy) NSString *_Nullable phoneNumber; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder + OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, + introduced = 13) SWIFT_AVAILABILITY(ios, + introduced = 13) + @interface FIRUser(SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// A data class representing the metadata corresponding to a Firebase user. +SWIFT_CLASS_NAMED("UserMetadata") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRUserMetadata : NSObject +/// Stores the last sign in date for the corresponding Firebase user. +@property(nonatomic, readonly, copy) NSDate *_Nullable lastSignInDate; +/// Stores the creation date for the corresponding Firebase user. +@property(nonatomic, readonly, copy) NSDate *_Nullable creationDate; +SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly) + BOOL supportsSecureCoding;) ++ (BOOL)supportsSecureCoding SWIFT_WARN_UNUSED_RESULT; +- (void)encodeWithCoder:(NSCoder *_Nonnull)coder; +- (nullable instancetype)initWithCoder:(NSCoder *_Nonnull)coder; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +SWIFT_AVAILABILITY(watchos, introduced = 7) +SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRUserMetadata( + SWIFT_EXTENSION(FirebaseAuth)) +@end + +/// Represents an object capable of updating a user’s profile data. +/// Properties are marked as being part of a profile update when they are set. +/// Setting a property value to nil is not the same as leaving the property +/// unassigned. +SWIFT_CLASS_NAMED("UserProfileChangeRequest") +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRUserProfileChangeRequest : NSObject +/// The name of the user. +@property(nonatomic, copy) NSString *_Nullable displayName; +/// The URL of the user’s profile photo. +@property(nonatomic, copy) NSURL *_Nullable photoURL; +/// Commits any pending changes. +/// Invoked asynchronously on the main thread in the future. +/// This method should only be called once.Once called, property values should +/// not be changed. \param completion Optionally; the block invoked when the +/// user profile change has been applied. +/// +- (void)commitChangesWithCompletion: + (void (^_Nullable)(NSError *_Nullable))completion; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +#endif +#if __has_attribute(external_source_symbol) +#pragma clang attribute pop +#endif +#if defined(__cplusplus) +#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 d2abcfbe03..da6fad3d44 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 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -394,7 +394,7 @@ SWIFT_CLASS_NAMED("_ObjC_HeartbeatsPayload") #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseDatabase-Swift.h b/ios_pod/swift_headers/FirebaseDatabase-Swift.h index 8f7f18c8af..4806f4e86d 100644 --- a/ios_pod/swift_headers/FirebaseDatabase-Swift.h +++ b/ios_pod/swift_headers/FirebaseDatabase-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -338,7 +338,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseFirestore-Swift.h b/ios_pod/swift_headers/FirebaseFirestore-Swift.h index 85873b0cb7..f52d43df2d 100644 --- a/ios_pod/swift_headers/FirebaseFirestore-Swift.h +++ b/ios_pod/swift_headers/FirebaseFirestore-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -346,7 +346,7 @@ SWIFT_CLASS_PROPERTY(@property(nonatomic, class, readonly, #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseFunctions-Swift.h b/ios_pod/swift_headers/FirebaseFunctions-Swift.h index 6b2259897f..a0384e61ce 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 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -456,7 +456,7 @@ SWIFT_CLASS_NAMED("Functions") @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 +/// trigger. 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", @@ -619,7 +619,7 @@ SWIFT_CLASS_NAMED("HTTPSCallableResult") #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -1074,7 +1074,7 @@ SWIFT_CLASS_NAMED("Functions") @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 +/// trigger. 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", diff --git a/ios_pod/swift_headers/FirebaseInAppMessaging-Swift.h b/ios_pod/swift_headers/FirebaseInAppMessaging-Swift.h index 0635aeb1c9..65bd9388e2 100644 --- a/ios_pod/swift_headers/FirebaseInAppMessaging-Swift.h +++ b/ios_pod/swift_headers/FirebaseInAppMessaging-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -337,7 +337,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h b/ios_pod/swift_headers/FirebaseMLModelDownloader-Swift.h index 824a0c8fed..d032d538a0 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 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -338,7 +338,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseRemoteConfig-Swift.h b/ios_pod/swift_headers/FirebaseRemoteConfig-Swift.h index 93f133e3e5..fc2b001a75 100644 --- a/ios_pod/swift_headers/FirebaseRemoteConfig-Swift.h +++ b/ios_pod/swift_headers/FirebaseRemoteConfig-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -338,7 +338,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseSessions-Swift.h b/ios_pod/swift_headers/FirebaseSessions-Swift.h index ed9ca1c493..100a38c9e4 100644 --- a/ios_pod/swift_headers/FirebaseSessions-Swift.h +++ b/ios_pod/swift_headers/FirebaseSessions-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -383,7 +383,7 @@ typedef SWIFT_ENUM_NAMED(NSInteger, FIRSessionsSubscriberName, #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h b/ios_pod/swift_headers/FirebaseSharedSwift-Swift.h index c664df02b3..df597d7188 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 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -337,7 +337,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/FirebaseStorage-Swift.h b/ios_pod/swift_headers/FirebaseStorage-Swift.h index f7ba2c1d91..9ee7024120 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 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -343,7 +343,12 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); /// instance of FirebaseApp, the storage location will be specified /// via the FirebaseOptions.storageBucket property. SWIFT_CLASS_NAMED("Storage") -@interface FIRStorage : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRStorage + : NSObject /// The default Storage instance. /// /// returns: @@ -410,7 +415,12 @@ SWIFT_CLASS_NAMED("Storage") /// returns: /// An instance of StorageReference referencing the root of the /// storage bucket. -- (FIRStorageReference *_Nonnull)reference SWIFT_WARN_UNUSED_RESULT; +- (FIRStorageReference *_Nonnull)reference SWIFT_WARN_UNUSED_RESULT + SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); /// 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 @@ -426,7 +436,11 @@ SWIFT_CLASS_NAMED("Storage") /// returns: /// An instance of StorageReference at the given child path. - (FIRStorageReference *_Nonnull)referenceForURL:(NSString *_Nonnull)url - SWIFT_WARN_UNUSED_RESULT; + SWIFT_WARN_UNUSED_RESULT SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); /// 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”. @@ -476,7 +490,12 @@ SWIFT_PROTOCOL_NAMED("StorageTaskManagement") /// 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 +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageTask : NSObject /// An immutable view of the task and associated metadata, progress, error, etc. @property(nonatomic, readonly, strong) FIRStorageTaskSnapshot *_Nonnull snapshot; @@ -491,7 +510,12 @@ enum FIRStorageTaskStatus : NSInteger; /// StorageHandle, which is used to keep track of and remove /// specific observers at a later date. SWIFT_CLASS_NAMED("StorageObservableTask") -@interface FIRStorageObservableTask : FIRStorageTask +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageObservableTask : FIRStorageTask /// Observes changes in the upload status: Resume, Pause, Progress, Success, and /// Failure. \param status The StorageTaskStatus change to observe. /// @@ -526,8 +550,13 @@ SWIFT_CLASS_NAMED("StorageObservableTask") /// the developer specified callbackQueue in Storage, or the main /// queue if left unspecified. SWIFT_CLASS_NAMED("StorageDownloadTask") -@interface FIRStorageDownloadTask - : FIRStorageObservableTask +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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 @@ -558,6 +587,9 @@ typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", FIRStorageErrorCodeDownloadSizeExceeded = -13032, FIRStorageErrorCodeCancelled = -13040, FIRStorageErrorCodeInvalidArgument = -13050, + FIRStorageErrorCodeBucketMismatch = -13051, + FIRStorageErrorCodeInternalError = -13052, + FIRStorageErrorCodePathError = -13053, }; static NSString *_Nonnull const FIRStorageErrorCodeDomain = @"FirebaseStorage.StorageErrorCode"; @@ -565,7 +597,12 @@ static NSString *_Nonnull const FIRStorageErrorCodeDomain = /// Contains the prefixes and items returned by a /// StorageReference.list() call. SWIFT_CLASS_NAMED("StorageListResult") -@interface FIRStorageListResult : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageListResult : NSObject /// The prefixes (folders) returned by a list() operation. @property(nonatomic, readonly, copy) NSArray *_Nonnull prefixes; @@ -590,7 +627,12 @@ SWIFT_CLASS_NAMED("StorageListResult") /// href="https://cloud.google.com/storage/docs/json_api/v1/objects#resource">GCS /// documentation SWIFT_CLASS_NAMED("StorageMetadata") -@interface FIRStorageMetadata : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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. @@ -662,7 +704,12 @@ SWIFT_CLASS_NAMED("StorageMetadata") /// get/set object metadata, and delete an object at the path. See the Cloud docs for more details. SWIFT_CLASS_NAMED("StorageReference") -@interface FIRStorageReference : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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. @@ -935,7 +982,12 @@ SWIFT_CLASS_NAMED("StorageReference") /// 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 +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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. @@ -970,8 +1022,13 @@ typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", /// 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 +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageUploadTask + : FIRStorageObservableTask /// Prepares a task and begins execution. - (void)enqueue; /// Pauses a task currently in progress. @@ -993,7 +1050,7 @@ SWIFT_CLASS_NAMED("StorageUploadTask") #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -1335,7 +1392,12 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); /// instance of FirebaseApp, the storage location will be specified /// via the FirebaseOptions.storageBucket property. SWIFT_CLASS_NAMED("Storage") -@interface FIRStorage : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) @interface FIRStorage + : NSObject /// The default Storage instance. /// /// returns: @@ -1402,7 +1464,12 @@ SWIFT_CLASS_NAMED("Storage") /// returns: /// An instance of StorageReference referencing the root of the /// storage bucket. -- (FIRStorageReference *_Nonnull)reference SWIFT_WARN_UNUSED_RESULT; +- (FIRStorageReference *_Nonnull)reference SWIFT_WARN_UNUSED_RESULT + SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); /// 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 @@ -1418,7 +1485,11 @@ SWIFT_CLASS_NAMED("Storage") /// returns: /// An instance of StorageReference at the given child path. - (FIRStorageReference *_Nonnull)referenceForURL:(NSString *_Nonnull)url - SWIFT_WARN_UNUSED_RESULT; + SWIFT_WARN_UNUSED_RESULT SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13); /// 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”. @@ -1468,7 +1539,12 @@ SWIFT_PROTOCOL_NAMED("StorageTaskManagement") /// 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 +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageTask : NSObject /// An immutable view of the task and associated metadata, progress, error, etc. @property(nonatomic, readonly, strong) FIRStorageTaskSnapshot *_Nonnull snapshot; @@ -1483,7 +1559,12 @@ enum FIRStorageTaskStatus : NSInteger; /// StorageHandle, which is used to keep track of and remove /// specific observers at a later date. SWIFT_CLASS_NAMED("StorageObservableTask") -@interface FIRStorageObservableTask : FIRStorageTask +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageObservableTask : FIRStorageTask /// Observes changes in the upload status: Resume, Pause, Progress, Success, and /// Failure. \param status The StorageTaskStatus change to observe. /// @@ -1518,8 +1599,13 @@ SWIFT_CLASS_NAMED("StorageObservableTask") /// the developer specified callbackQueue in Storage, or the main /// queue if left unspecified. SWIFT_CLASS_NAMED("StorageDownloadTask") -@interface FIRStorageDownloadTask - : FIRStorageObservableTask +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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 @@ -1550,6 +1636,9 @@ typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageErrorCode, "StorageErrorCode", FIRStorageErrorCodeDownloadSizeExceeded = -13032, FIRStorageErrorCodeCancelled = -13040, FIRStorageErrorCodeInvalidArgument = -13050, + FIRStorageErrorCodeBucketMismatch = -13051, + FIRStorageErrorCodeInternalError = -13052, + FIRStorageErrorCodePathError = -13053, }; static NSString *_Nonnull const FIRStorageErrorCodeDomain = @"FirebaseStorage.StorageErrorCode"; @@ -1557,7 +1646,12 @@ static NSString *_Nonnull const FIRStorageErrorCodeDomain = /// Contains the prefixes and items returned by a /// StorageReference.list() call. SWIFT_CLASS_NAMED("StorageListResult") -@interface FIRStorageListResult : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageListResult : NSObject /// The prefixes (folders) returned by a list() operation. @property(nonatomic, readonly, copy) NSArray *_Nonnull prefixes; @@ -1582,7 +1676,12 @@ SWIFT_CLASS_NAMED("StorageListResult") /// href="https://cloud.google.com/storage/docs/json_api/v1/objects#resource">GCS /// documentation SWIFT_CLASS_NAMED("StorageMetadata") -@interface FIRStorageMetadata : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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. @@ -1654,7 +1753,12 @@ SWIFT_CLASS_NAMED("StorageMetadata") /// get/set object metadata, and delete an object at the path. See the Cloud docs for more details. SWIFT_CLASS_NAMED("StorageReference") -@interface FIRStorageReference : NSObject +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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. @@ -1927,7 +2031,12 @@ SWIFT_CLASS_NAMED("StorageReference") /// 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 +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @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. @@ -1962,8 +2071,13 @@ typedef SWIFT_ENUM_NAMED(NSInteger, FIRStorageTaskStatus, "StorageTaskStatus", /// 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 +SWIFT_AVAILABILITY(watchos, introduced = 7) + SWIFT_AVAILABILITY(maccatalyst, introduced = 13) + SWIFT_AVAILABILITY(macos, introduced = 10.15) + SWIFT_AVAILABILITY(tvos, introduced = 13) + SWIFT_AVAILABILITY(ios, introduced = 13) + @interface FIRStorageUploadTask + : FIRStorageObservableTask /// Prepares a task and begins execution. - (void)enqueue; /// Pauses a task currently in progress. diff --git a/ios_pod/swift_headers/Promises-Swift.h b/ios_pod/swift_headers/Promises-Swift.h index 5e4a8d684a..c73e991ff3 100644 --- a/ios_pod/swift_headers/Promises-Swift.h +++ b/ios_pod/swift_headers/Promises-Swift.h @@ -1,7 +1,7 @@ #if 0 #elif defined(__arm64__) && __arm64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -336,7 +336,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/ios_pod/swift_headers/SwiftProtobuf-Swift.h b/ios_pod/swift_headers/SwiftProtobuf-Swift.h index 4c82d2de73..5a7ae5d219 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 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) @@ -337,7 +337,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #elif defined(__x86_64__) && __x86_64__ // Copyright 2024 Google LLC -// Copied from Firebase iOS SDK 10.25.0. +// Copied from Firebase iOS SDK 11.0.0. // Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 // clang-1500.1.0.2.5) diff --git a/messaging/integration_test/Podfile b/messaging/integration_test/Podfile index e819022057..ff769e1a6e 100644 --- a/messaging/integration_test/Podfile +++ b/messaging/integration_test/Podfile @@ -4,14 +4,14 @@ use_frameworks! :linkage => :static target 'integration_test' do platform :ios, '13.0' - pod 'Firebase/Messaging', '10.28.1' - pod 'Firebase/Functions', '10.28.1' + pod 'Firebase/Messaging', '11.0.0' + pod 'Firebase/Functions', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Messaging', '10.28.1' - pod 'Firebase/Functions', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Messaging', '11.0.0' + pod 'Firebase/Functions', '11.0.0' end post_install do |installer| diff --git a/messaging/integration_test/integration_test.xcodeproj/project.pbxproj b/messaging/integration_test/integration_test.xcodeproj/project.pbxproj index 63030ea9f2..9cfe380d7b 100644 --- a/messaging/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/messaging/integration_test/integration_test.xcodeproj/project.pbxproj @@ -592,7 +592,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -644,7 +644,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/release_build_files/readme.md b/release_build_files/readme.md index f3e8af087f..a1532d5fff 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -230,50 +230,50 @@ Feature | Required Frameworks and Cocoapods -------------------------- | --------------------------------------- Firebase Analytics | firebase_analytics.xcframework | | firebase.xcframework -| | Firebase/Analytics Cocoapod (10.28.1) +| | Firebase/Analytics Cocoapod (11.0.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.28.1) +| | Firebase/AppCheck Cocoapod (11.0.0) Firebase Authentication | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Auth Cocoapod (11.0.0) Firebase Dynamic Links | firebase_dynamic_links.xcframework | | firebase.xcframework -| | Firebase/DynamicLinks Cocoapod (10.28.1) +| | Firebase/DynamicLinks Cocoapod (11.0.0) Cloud Firestore | firebase_firestore.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Firestore Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Firestore Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.0) Firebase Functions | firebase_functions.xcframework | | firebase_auth.xcframework (optional) | | firebase.xcframework -| | Firebase/Functions Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Functions Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.0) Google Mobile Ads | firebase_gma.xcframework | | firebase.xcframework -| | Firebase/CoreOnly Cocoapod (10.28.1) +| | Firebase/CoreOnly Cocoapod (11.0.0) | | Google-Mobile-Ads-SDK Cocoapod (11.2.0) | | GoogleUserMessagingPlatform Cocoapod (2.3.0) Firebase Installations | firebase_installations.xcframework | | firebase.xcframework -| | FirebaseInstallations Cocoapod (10.28.0) +| | FirebaseInstallations Cocoapod (11.0.0) Firebase Cloud Messaging | firebase_messaging.xcframework | | firebase.xcframework -| | Firebase/Messaging Cocoapod (10.28.1) +| | Firebase/Messaging Cocoapod (11.0.0) Firebase Realtime Database | firebase_database.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Database Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Database Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.0) Firebase Remote Config | firebase_remote_config.xcframework | | firebase.xcframework -| | Firebase/RemoteConfig Cocoapod (10.28.1) +| | Firebase/RemoteConfig Cocoapod (11.0.0) Firebase Storage | firebase_storage.xcframework | | firebase_auth.xcframework | | firebase.xcframework -| | Firebase/Storage Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Storage Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.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 @@ -293,50 +293,50 @@ Feature | Required Libraries and Cocoapods -------------------------- | ----------------------------------------- Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a -| | Firebase/Analytics Cocoapod (10.28.1) +| | Firebase/Analytics Cocoapod (11.0.0) Firebase App Check | firebase_app_check.xcframework | | firebase.xcframework -| | Firebase/AppCheck Cocoapod (10.28.1) +| | Firebase/AppCheck Cocoapod (11.0.0) Firebase Authentication | libfirebase_auth.a | | libfirebase_app.a -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Auth Cocoapod (11.0.0) Firebase Dynamic Links | libfirebase_dynamic_links.a | | libfirebase_app.a -| | Firebase/DynamicLinks Cocoapod (10.28.1) +| | Firebase/DynamicLinks Cocoapod (11.0.0) Cloud Firestore | libfirebase_firestore.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Firestore Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Firestore Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.0) Firebase Functions | libfirebase_functions.a | | libfirebase_app.a | | libfirebase_auth.a (optional) -| | Firebase/Functions Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Functions Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.0) Google Mobile Ads | libfirebase_gma.a | | libfirebase_app.a -| | Firebase/CoreOnly Cocoapod (10.28.1) +| | Firebase/CoreOnly Cocoapod (11.0.0) | | Google-Mobile-Ads-SDK Cocoapod (11.2.0) | | GoogleUserMessagingPlatform Cocoapod (2.3.0) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a -| | FirebaseInstallations Cocoapod (10.28.0) +| | FirebaseInstallations Cocoapod (11.0.0) Firebase Cloud Messaging | libfirebase_messaging.a | | libfirebase_app.a -| | Firebase/CloudMessaging Cocoapod (10.28.1) +| | Firebase/CloudMessaging Cocoapod (11.0.0) Firebase Realtime Database | libfirebase_database.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Database Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Database Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.0) Firebase Remote Config | libfirebase_remote_config.a | | libfirebase_app.a -| | Firebase/RemoteConfig Cocoapod (10.28.1) +| | Firebase/RemoteConfig Cocoapod (11.0.0) Firebase Storage | libfirebase_storage.a | | libfirebase_app.a | | libfirebase_auth.a -| | Firebase/Storage Cocoapod (10.28.1) -| | Firebase/Auth Cocoapod (10.28.1) +| | Firebase/Storage Cocoapod (11.0.0) +| | Firebase/Auth Cocoapod (11.0.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 diff --git a/remote_config/integration_test/Podfile b/remote_config/integration_test/Podfile index 6898897435..0b9d2057f2 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, '13.0' - pod 'Firebase/RemoteConfig', '10.28.1' + pod 'Firebase/RemoteConfig', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/RemoteConfig', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/RemoteConfig', '11.0.0' end post_install do |installer| diff --git a/remote_config/integration_test/integration_test.xcodeproj/project.pbxproj b/remote_config/integration_test/integration_test.xcodeproj/project.pbxproj index a350bc821e..d48274f7d2 100644 --- a/remote_config/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/remote_config/integration_test/integration_test.xcodeproj/project.pbxproj @@ -565,7 +565,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -616,7 +616,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; diff --git a/storage/integration_test/Podfile b/storage/integration_test/Podfile index 33f9cb06a1..5a54e9c554 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, '13.0' - pod 'Firebase/Storage', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + pod 'Firebase/Storage', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end target 'integration_test_tvos' do - platform :tvos, '12.0' - pod 'Firebase/Storage', '10.28.1' - pod 'Firebase/Auth', '10.28.1' + platform :tvos, '13.0' + pod 'Firebase/Storage', '11.0.0' + pod 'Firebase/Auth', '11.0.0' end post_install do |installer| diff --git a/storage/integration_test/integration_test.xcodeproj/project.pbxproj b/storage/integration_test/integration_test.xcodeproj/project.pbxproj index 280e3ed615..25a35edd16 100644 --- a/storage/integration_test/integration_test.xcodeproj/project.pbxproj +++ b/storage/integration_test/integration_test.xcodeproj/project.pbxproj @@ -581,7 +581,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Debug; }; @@ -635,7 +635,7 @@ SDKROOT = appletvos; SWIFT_VERSION = 5.3; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; };