Updated to SwiftFormat 0.52.10 (#12125)

This commit is contained in:
Paul Beusterien authored and GitHub committed 2023-11-21 12:12:05 -08:00
1 parent 25abe7766c
commit 4d2b60dc75
169 files changed
+372 -376

No files matched your search

@@ -49,8 +49,8 @@ import FirebaseInstallations
import FirebaseMessaging
import FirebaseMLModelDownloader
#if (os(iOS) && !targetEnvironment(macCatalyst)) || os(tvOS)
import FirebasePerformance
import FirebaseInAppMessaging
import FirebasePerformance
#endif
import FirebaseRemoteConfig
import FirebaseRemoteConfigSwift
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import Firebase
// Verify that the following Firebase Swift APIs can be found.
import FirebaseAnalyticsSwift
import FirebaseFirestoreSwift
import FirebaseInAppMessagingSwift
import UIKit
class CoreExists: FirebaseApp {}
class AnalyticsExists: Analytics {}
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import Firebase
import SwiftUI
@main
struct CombineSampleApp: App {
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import Firebase
import FirebaseAuthCombineSwift
import FirebaseFirestoreCombineSwift
import FirebaseFunctionsCombineSwift
import FirebaseStorageCombineSwift
import Combine
import Foundation
class AnonymousSignInViewModel: UserInfoViewModel {
private var cancellables = Set<AnyCancellable>()
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Combine
import Firebase
import FirebaseAuth
import FirebaseAuthCombineSwift
import Combine
class UserInfoViewModel: ObservableObject {
@Published var user: User?
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import Combine
import Firebase
import FirebaseAuthCombineSwift
import Combine
import SwiftUI
struct AnonymousSignInView: View {
@StateObject var viewModel = AnonymousSignInViewModel()
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseAuth
import FirebaseCore
import FirebaseFirestore
import FirebaseAuth
import SwiftUI
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseFirestore
import FirebaseFirestoreSwift
import SwiftUI
private struct Fruit: Codable, Identifiable, Equatable {
@DocumentID var id: String?
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseFirestoreSwift
import SwiftUI
private struct Fruit: Codable, Identifiable, Equatable {
@DocumentID var id: String?
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseFirestoreSwift
import SwiftUI
private struct Fruit: Codable, Identifiable, Equatable {
@DocumentID var id: String?
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseFirestore
import FirebaseFirestoreSwift
import SwiftUI
private struct Fruit: Codable, Identifiable, Equatable {
@DocumentID var id: String?
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseFirestore
import FirebaseFirestoreSwift
import SwiftUI
private struct Fruit: Codable, Identifiable, Equatable {
@DocumentID var id: String?
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import FirebaseCore
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import FirebaseAuth
import UIKit
class AuthLoginViewController: UIViewController {
override func viewDidLoad() {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import FirebaseAuth
import UIKit
class AuthViewController: UIViewController {
// MARK: - User Interface
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import FirebaseDatabase
import UIKit
/// A class to demonstrate the Firebase Realtime Database API. This will show a number read
/// from the Database and increase or decrease it based on the buttons pressed.
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import FirebaseAuth
import UIKit
protocol EmailLoginDelegate {
func emailLogin(_ controller: EmailLoginViewController, signedInAs user: User)
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import FirebaseStorage
import UIKit
class StorageViewController: UIViewController {
/// An enum describing the different states of the view controller.
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseStorage
import SwiftUI
class InterfaceController: WKInterfaceController {
@IBOutlet var imageView: WKInterfaceImage!
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import WatchKit
import Foundation
import UserNotifications
import WatchKit
class NotificationController: WKUserNotificationInterfaceController {
override init() {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UserNotifications
import FirebaseMessaging
import UserNotifications
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import UIKit
import Firebase
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import UIKit
import FirebaseAnalytics
import FirebaseRemoteConfig
import UIKit
class ViewController: UIViewController {
@IBAction func fireAnalyticsEventButtonTapped(_ sender: Any) {
+1 -1
View File
@@ -19,7 +19,7 @@
/// Custom view modifier to allow for easily logging screen view events.
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *)
@available(watchOS, unavailable)
internal struct LoggedAnalyticsModifier: ViewModifier {
struct LoggedAnalyticsModifier: ViewModifier {
/// The name of the view to log in the `AnalyticsParameterScreenName` parameter.
let screenName: String
@@ -20,9 +20,9 @@ import Foundation
import StoreKit
import SwiftUI
import FirebaseAnalytics
import FirebaseAnalyticsSwift
import SwiftUI
import FirebaseAnalytics
final class AnalyticsAPITests {
func usage() {
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import UIKit
import FirebaseCore
import FirebaseAppCheck
import FirebaseCore
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import Foundation
import FirebaseCore
import FirebaseAppCheck
import FirebaseCore
import Foundation
class MyAppCheckProvider: NSObject, AppCheckProvider {
func getToken(completion handler: @escaping AppCheckTokenHandler) {
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import UIKit
import SwiftUI
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
@@ -16,8 +16,8 @@
import UIKit
import FirebaseCore
import FirebaseAppCheck
import FirebaseCore
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -18,8 +18,8 @@
import Foundation
import FirebaseCore
import FirebaseAppCheck
import FirebaseCore
final class AppCheckAPITests {
func usage() {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseAppDistribution
import XCTest
class AppDistributionAPITests: XCTestCase {
@available(iOS 13.0.0, *)
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseInstallations
import FirebaseCore
import FirebaseInstallations
import Foundation
import UIKit
// Avoids exposing internal APIs to Swift users
@@ -13,8 +13,8 @@
// limitations under the License.
import Foundation
import UIKit
import Photos
import UIKit
@objc(FIRFADInAppFeedback) open class InAppFeedback: NSObject {
@objc(
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseInstallations
import Foundation
// Wraps around the use of FIRInstallations in a protocol to be able to inject a fake one for
// unit testing.
internal protocol InstallationsProtocol {
protocol InstallationsProtocol {
func authToken(completion: @escaping (InstallationsAuthTokenResult?, Error?) -> Void)
func installationID(completion: @escaping (String?, Error?) -> Void)
}
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
import FirebaseCore
import XCTest
@testable import FirebaseInstallations
@testable import FirebaseAppDistributionInternal
@testable import FirebaseInstallations
class ApiServiceTests: XCTestCase {
override class func setUp() {
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
@testable import FirebaseInstallations
@testable import FirebaseAppDistributionInternal
@testable import FirebaseInstallations
import Foundation
// This is needed because importing the setter from FIRInstallationsAuthTokenResultInternal.h in
// the bridging error results in errors.
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import XCTest
import FirebaseAuth
import XCTest
class AccountInfoTests: TestsBase {
/** The testing email address for testCreateAccountWithEmailAndPassword. */
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import Foundation
import FirebaseAuth
import Foundation
import XCTest
class AnonymousTests: TestsBase {
@@ -48,7 +48,7 @@ import Foundation
The name of the test user for Facebook Login.
*/
class Credentials {
enum Credentials {
static let kGoogleClientID = KGOOGLE_CLIENT_ID
static let kGoogleTestAccountRefreshToken = KGOOGLE_TEST_ACCOUNT_REFRESH_TOKEN
static let kGoogleUserName = KGOOGLE_USER_NAME
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import Foundation
import FirebaseAuth
import Foundation
import XCTest
class EmailPasswordTests: TestsBase {
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import Foundation
import FirebaseAuth
import Foundation
import GTMSessionFetcher
import XCTest
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import Foundation
import FirebaseAuth
import Foundation
import GTMSessionFetcher
import XCTest
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import Foundation
import FirebaseAuth
import Foundation
import XCTest
class TestsBase: XCTestCase {
+1 -1
View File
@@ -24,4 +24,4 @@ import Foundation
#endif
// This is here to appease the compiler.
internal struct _Dummy {}
struct _Dummy {}
@@ -14,9 +14,9 @@
#if canImport(Combine) && swift(>=5.0)
import Foundation
import Combine
import FirebaseStorage
import Foundation
@available(swift 5.0)
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *)
@@ -44,9 +44,9 @@
import Combine
import FirebaseAuth
import FirebaseCombineSwift
import FirebaseCore
import FirebaseStorage
import FirebaseCombineSwift
import XCTest
class StorageIntegration: XCTestCase {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class AnonymousAuthTests: XCTestCase {
static let apiKey = Credentials.apiKey
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
@testable import FirebaseAuth
import Foundation
let expectationTimeout: TimeInterval = 2
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseCore
import Combine
import FirebaseAuth
import FirebaseCombineSwift
import Combine
import FirebaseCore
import Foundation
import XCTest
class AuthStateDidChangePublisherTests: XCTestCase {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class EmailLinkAuthTests: XCTestCase {
static let apiKey = Credentials.apiKey
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class EmailPasswordAuthTests: XCTestCase {
override class func setUp() {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class FetchSignInMethodsTests: XCTestCase {
override class func setUp() {
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import FirebaseAuth
import Foundation
import GameKit
import XCTest
import FirebaseAuth
class GameCenterAuthProviderTests: XCTestCase {
override class func setUp() {
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseCore
import Combine
import FirebaseAuth
import FirebaseCombineSwift
import Combine
import FirebaseCore
import Foundation
import XCTest
class IDTokenDidChangePublisherTests: XCTestCase {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class OAuthProviderTests: XCTestCase {
override class func setUp() {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class PasswordResetTests: XCTestCase {
override class func setUp() {
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import FirebaseAuthTestingSupport
import Foundation
import XCTest
class PhoneAuthProviderTests: XCTestCase {
fileprivate static let phoneNumber = "55555555"
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class SignInWithCredentialTests: XCTestCase {
override class func setUp() {
@@ -55,14 +55,12 @@ class SignInWithCredentialTests: XCTestCase {
static let googleAccessToken = "GOOGLE_ACCESS_TOKEN"
static let googleDisplayName = "Google Doe"
static let googleEmail = "user@gmail.com"
static let googleProfile: [String: String] = {
[
"iss": "https://accounts.google.com\\",
"email": googleEmail,
"given_name": "User",
"family_name": "Doe",
]
}()
static let googleProfile: [String: String] = [
"iss": "https://accounts.google.com\\",
"email": googleEmail,
"given_name": "User",
"family_name": "Doe",
]
static let verificationCode = "12345678"
static let verificationID = "55432"
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class SignInWithCustomTokenTests: XCTestCase {
override class func setUp() {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class SignInWithGameCenterTests: XCTestCase {
override class func setUp() {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class SignInWithProviderTests: XCTestCase {
override class func setUp() {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class UpdateCurrentUserTests: XCTestCase {
override class func setUp() {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
class UserTests: XCTestCase {
override class func setUp() {
@@ -66,14 +66,12 @@ class UserTests: XCTestCase {
fileprivate static let userName = "User Doe"
fileprivate static let localID = "localId"
fileprivate static let googleEmail = "user@gmail.com"
fileprivate static let googleProfile: [String: String] = {
[
"iss": "https://accounts.google.com\\",
"email": googleEmail,
"given_name": "User",
"family_name": "Doe",
]
}()
fileprivate static let googleProfile: [String: String] = [
"iss": "https://accounts.google.com\\",
"email": googleEmail,
"given_name": "User",
"family_name": "Doe",
]
class MockGetAccountInfoResponse: FIRGetAccountInfoResponse {
fileprivate var providerCredentials: ProviderCredentials!
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
import FirebaseAuth
import Foundation
import XCTest
extension FIRAuthBackend {
class func signIn(withGameCenter request: FIRSignInWithGameCenterRequest)
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseCore
import Foundation
extension FirebaseApp {
static func appOptions() -> FirebaseOptions {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import FirebaseCombineSwift
import FirebaseFirestoreTestingSupport
import Combine
import Foundation
import XCTest
class GetDocumentsTests: XCTestCase {
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import Combine
import XCTest
@testable import FirebaseStorage
import Foundation
import XCTest
class StorageReferenceTests: XCTestCase {
override class func setUp() {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
// MARK: - Assertions
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class HeartbeatLoggingIntegrationTests: XCTestCase {
// 2021-11-01 @ 00:00:00 (EST)
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class HeartbeatControllerTests: XCTestCase {
// 2021-11-01 @ 00:00:00 (EST)
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class HeartbeatStorageTests: XCTestCase {
// MARK: - Instance Management
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class TimePeriodTests: XCTestCase {
override func setUpWithError() throws {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class HeartbeatsBundleTests: XCTestCase {
// 2021-11-01 @ 00:00:00 (EST)
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class HeartbeatsPayloadTests: XCTestCase {
func testPayloadCurrentVersion() throws {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class RingBufferTests: XCTestCase {
// `RingBuffer` is a generic type. `String` is used for simplified testing.
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
private enum Constants {
static let testData = "test_data".data(using: .utf8)!
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCoreInternal
import XCTest
class WeakContainerTests: XCTestCase {
func testContainersObjectIsWeaklyRetained() throws {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCore
import XCTest
private extension Constants {
static let testAppName1 = "test_app_name_1"
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCore
import XCTest
class FirebaseConfigurationTests: XCTestCase {
func testSharedInstance() {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import XCTest
@testable import FirebaseCore
import XCTest
class FirebaseOptionsTests: XCTestCase {
func testDefaultOptions() throws {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseSharedSwift
import Foundation
// A `Callable` is reference to a particular Callable HTTPS trigger in Cloud Functions.
public struct Callable<Request: Encodable, Response: Decodable> {
+25 -25
View File
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseAppCheckInterop
import FirebaseAuthInterop
import FirebaseCore
import FirebaseMessagingInterop
import FirebaseSharedSwift
import Foundation
#if COCOAPODS
import GTMSessionFetcher
#else
@@ -34,7 +34,7 @@ private enum Constants {
}
/// Cross SDK constants.
internal enum FunctionsConstants {
enum FunctionsConstants {
static let defaultRegion = "us-central1"
}
@@ -54,10 +54,10 @@ internal enum FunctionsConstants {
private let contextProvider: FunctionsContextProvider
/// The custom domain to use for all functions references (optional).
internal let customDomain: String?
let customDomain: String?
/// The region to use for all function references.
internal let region: String
let region: String
// MARK: - Public APIs
@@ -314,13 +314,13 @@ internal enum FunctionsConstants {
type: self)
}
@objc internal init(projectID: String,
region: String,
customDomain: String?,
auth: AuthInterop?,
messaging: MessagingInterop?,
appCheck: AppCheckInterop?,
fetcherService: GTMSessionFetcherService = GTMSessionFetcherService()) {
@objc init(projectID: String,
region: String,
customDomain: String?,
auth: AuthInterop?,
messaging: MessagingInterop?,
appCheck: AppCheckInterop?,
fetcherService: GTMSessionFetcherService = GTMSessionFetcherService()) {
self.projectID = projectID
self.region = region
self.customDomain = customDomain
@@ -332,9 +332,9 @@ internal enum FunctionsConstants {
}
/// Using the component system for initialization.
internal convenience init(app: FirebaseApp,
region: String,
customDomain: String?) {
convenience init(app: FirebaseApp,
region: String,
customDomain: String?) {
// TODO: These are not optionals, but they should be.
let auth = ComponentType<AuthInterop>.instance(for: AuthInterop.self, in: app.container)
let messaging = ComponentType<MessagingInterop>.instance(for: MessagingInterop.self,
@@ -354,7 +354,7 @@ internal enum FunctionsConstants {
appCheck: appCheck)
}
internal func urlWithName(_ name: String) -> String {
func urlWithName(_ name: String) -> String {
assert(!name.isEmpty, "Name cannot be empty")
// Check if we're using the emulator
@@ -370,11 +370,11 @@ internal enum FunctionsConstants {
return "https://\(region)-\(projectID).cloudfunctions.net/\(name)"
}
internal func callFunction(name: String,
withObject data: Any?,
options: HTTPSCallableOptions?,
timeout: TimeInterval,
completion: @escaping ((Result<HTTPSCallableResult, Error>) -> Void)) {
func callFunction(name: String,
withObject data: Any?,
options: HTTPSCallableOptions?,
timeout: TimeInterval,
completion: @escaping ((Result<HTTPSCallableResult, Error>) -> Void)) {
// Get context first.
contextProvider.getContext(options: options) { context, error in
// Note: context is always non-nil since some checks could succeed, we're only failing if
@@ -393,11 +393,11 @@ internal enum FunctionsConstants {
}
}
internal func callFunction(url: URL,
withObject data: Any?,
options: HTTPSCallableOptions?,
timeout: TimeInterval,
completion: @escaping ((Result<HTTPSCallableResult, Error>) -> Void)) {
func callFunction(url: URL,
withObject data: Any?,
options: HTTPSCallableOptions?,
timeout: TimeInterval,
completion: @escaping ((Result<HTTPSCallableResult, Error>) -> Void)) {
// Get context first.
contextProvider.getContext(options: options) { context, error in
// Note: context is always non-nil since some checks could succeed, we're only failing if
@@ -108,7 +108,7 @@ public let FunctionsErrorDetailsKey: String = "details"
* - Parameter status An HTTP status code.
* - Returns: The corresponding error code, or `FIRFunctionsErrorCodeUnknown` if none.
*/
internal func FunctionsCodeForHTTPStatus(_ status: NSInteger) -> FunctionsErrorCode {
func FunctionsCodeForHTTPStatus(_ status: NSInteger) -> FunctionsErrorCode {
switch status {
case 200:
return .OK
@@ -209,9 +209,9 @@ extension FunctionsErrorCode {
}
}
internal func FunctionsErrorForResponse(status: NSInteger,
body: Data?,
serializer: FUNSerializer) -> NSError? {
func FunctionsErrorForResponse(status: NSInteger,
body: Data?,
serializer: FUNSerializer) -> NSError? {
// Start with reasonable defaults from the status code.
var code = FunctionsCodeForHTTPStatus(status)
var description = code.descriptionForErrorCode
@@ -28,7 +28,7 @@ open class HTTPSCallableResult: NSObject {
*/
@objc public let data: Any
internal init(data: Any) {
init(data: Any) {
self.data = data
}
}
@@ -59,13 +59,13 @@ open class HTTPSCallable: NSObject {
*/
@objc open var timeoutInterval: TimeInterval = 70
internal init(functions: Functions, name: String, options: HTTPSCallableOptions? = nil) {
init(functions: Functions, name: String, options: HTTPSCallableOptions? = nil) {
self.functions = functions
self.options = options
endpoint = .name(name)
}
internal init(functions: Functions, url: URL, options: HTTPSCallableOptions? = nil) {
init(functions: Functions, url: URL, options: HTTPSCallableOptions? = nil) {
self.functions = functions
self.options = options
endpoint = .url(url)
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseAppCheckInterop
import FirebaseAuthInterop
import FirebaseCore
import FirebaseMessagingInterop
import Foundation
// Avoids exposing internal FirebaseCore APIs to Swift users.
@_implementationOnly import FirebaseCoreExtension
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseAppCheckInterop
import FirebaseAuthInterop
import FirebaseMessagingInterop
import Foundation
/// FunctionsContext is a helper class for gathering metadata for a function call.
internal class FunctionsContext: NSObject {
class FunctionsContext: NSObject {
let authToken: String?
let fcmToken: String?
let appCheckToken: String?
@@ -33,7 +33,7 @@ internal class FunctionsContext: NSObject {
}
}
internal class FunctionsContextProvider: NSObject {
class FunctionsContextProvider: NSObject {
private var auth: AuthInterop?
private var messaging: MessagingInterop?
private var appCheck: AppCheckInterop?
@@ -51,8 +51,8 @@ internal class FunctionsContextProvider: NSObject {
//
// }
internal func getContext(options: HTTPSCallableOptions? = nil,
_ completion: @escaping ((FunctionsContext, Error?) -> Void)) {
func getContext(options: HTTPSCallableOptions? = nil,
_ completion: @escaping ((FunctionsContext, Error?) -> Void)) {
let dispatchGroup = DispatchGroup()
var authToken: String?
@@ -38,7 +38,7 @@ class FUNSerializer: NSObject {
// MARK: - Internal APIs
internal func encode(_ object: Any) throws -> AnyObject {
func encode(_ object: Any) throws -> AnyObject {
if object is NSNull {
return object as AnyObject
} else if object is NSNumber {
@@ -71,7 +71,7 @@ class FUNSerializer: NSObject {
}
}
internal func decode(_ object: Any) throws -> AnyObject? {
func decode(_ object: Any) throws -> AnyObject? {
// Return these types as is. PORTING NOTE: Moved from the bottom of the func for readability.
if let dict = object as? NSDictionary {
if let requestedType = dict["@type"] as? String {
@@ -15,11 +15,11 @@
import Foundation
import Combine
import FirebaseAppCheckInterop
import FirebaseAuthInterop
import FirebaseCore
@testable import FirebaseFunctions
import FirebaseFunctionsCombineSwift
import FirebaseAuthInterop
import FirebaseAppCheckInterop
import FirebaseMessagingInterop
import GTMSessionFetcherCore
import XCTest
@@ -14,8 +14,8 @@
import Foundation
@testable import FirebaseFunctions
import FirebaseAuthInterop
@testable import FirebaseFunctions
import FirebaseMessagingInterop
import XCTest
@@ -22,8 +22,8 @@ import FirebaseCore
import GTMSessionFetcherCore
#endif
import XCTest
import SharedTestUtilities
import XCTest
class FunctionsTests: XCTestCase {
var functions: Functions?
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseInAppMessaging
import SwiftUI
struct ContentView: View {
@State private var analyticsEvent = ""
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseInAppMessaging
import FirebaseInAppMessagingSwift
import SwiftUI
struct ModalInAppMessageView: View {
var modalMessage: InAppMessagingModalDisplay
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import FirebaseCore
import FirebaseMLModelDownloader
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import SwiftUI
import FirebaseMLModelDownloader
import SwiftUI
struct ContentView: View {
var downloadTotal: Float = 1.0
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import FirebaseMLModelDownloader
import Foundation
import TensorFlowLite
import FirebaseMLModelDownloader
class Downloader: ObservableObject {
@Published var downloadProgress: Float = 0.0
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
import SwiftUI
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseCore
import FirebaseInstallations
import Foundation
/// Possible ways to get a custom model.
public enum ModelDownloadType {
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseCore
import FirebaseInstallations
import Foundation
/// URL Session to use while retrieving model info.
protocol ModelInfoRetrieverSession {
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
import FirebaseCore
import Foundation
import GoogleDataTransport
/// Extension to set Firebase app info.
@@ -18,10 +18,10 @@
// See go/firebase-macos-keychain-popups for more details.
#if !targetEnvironment(macCatalyst) && !os(macOS)
import XCTest
@testable import FirebaseCore
@testable import FirebaseInstallations
@testable import FirebaseMLModelDownloader
import XCTest
extension UserDefaults {
/// Returns a new cleared instance of user defaults.
Loaded 100 of 169 files, more files were not shown because too many files have changed in this diff. Show more