FirebaseAPI for Swift is a Swift package that provides a simple interface to interact.
This repository includes the googleapis repository as a submodule, which is used to generate the API client code for Firebase.
To develop this library, you will need a ServiceAccount.json
file.
Please copy this file to the FirestoreTests
directory.
-
Download the service account key from Firebase Console and save it as
ServiceAccount.json
. -
Copy the
ServiceAccount.json
file to theFirestoreTests
directory. -
Open the project in Xcode and select the
FirestoreTests
target.
.testTarget(
name: "FirestoreTests",
dependencies: ["Firestore"],
resources: [
.copy("ServiceAccount.json")
]),
mkdir -p Sources/Firestore/Proto
cd googleapi
protoc \
./google/firestore/v1/*.proto \
./google/api/field_behavior.proto \
./google/api/resource.proto \
./google/longrunning/operations.proto \
./google/rpc/status.proto \
./google/type/latlng.proto \
--swift_out=../Sources/FirestoreAPI/Proto \
--grpc-swift_out=../Sources/FirestoreAPI/Proto \
--swift_opt=Visibility=Public \
--grpc-swift_opt=Visibility=Public