firebase-swift

Swift 的 Firebase 客户端。

身份验证

let client = Auth(
  apiKey: apiKey,
  httpClient: .urlSession(.shared)
)

let user = try await client.createUser(
  email: "test@gmail.com",
  password: "password"
)

print(user)

Remote Config

let client = RemoteConfig(
  apiKey: apiKey,
  projectId: projectId,
  projectName: projectName,
  appId: appId,
  appInstanceId: UUID().uuidString,
  httpClient: .urlSession(.shared)
)

let config = try await client.fetch()
print(config)

Cloud Storage

let client = Storage(
  httpClient: .urlSession(.shared)
)

let item = try await client.upload(
  bucket: bucket,
  path: itemPath,
  data: data,
  contentType: contentType
)

print(item)