All Projects → gtchance → Firebaseswift

gtchance / Firebaseswift

Licence: mit
Firebase REST API wrapper for use in server-side Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Firebaseswift

Mongo Swift Driver
The official MongoDB driver for Swift
Stars: ✭ 242 (+348.15%)
Mutual labels:  server-side-swift, swift-package-manager
Jsoncore
A Swift JSON parser that doesn't need Objective-C bridging and doesn't depend on Foundation
Stars: ✭ 86 (+59.26%)
Mutual labels:  server-side-swift, swift-package-manager
Telegrammer
Telegram Bot - written with Swift 5.2 / NIO, supports Linux, macOS
Stars: ✭ 248 (+359.26%)
Mutual labels:  server-side-swift, swift-package-manager
Backend
Backend is responsible to provide data to EVOlution App - iOS
Stars: ✭ 123 (+127.78%)
Mutual labels:  server-side-swift, backend
SwiftMC
A Minecraft server and proxy written from scratch in Swift.
Stars: ✭ 22 (-59.26%)
Mutual labels:  swift-package-manager, server-side-swift
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-9.26%)
Mutual labels:  backend
Awesome Android Kotlin Apps
👓 A curated list of awesome android kotlin apps by open-source contributors.
Stars: ✭ 1,058 (+1859.26%)
Mutual labels:  firebase
Tech Logo Memo Game
🖱️🖱️🖕🖕🤯🤯🤯technology logo memory game, including frontend and backend
Stars: ✭ 49 (-9.26%)
Mutual labels:  backend
Firebase Admin Dashboard
Easily create admin dashboards for your Firebase powered apps.
Stars: ✭ 48 (-11.11%)
Mutual labels:  firebase
Angular 4 Material Pos
POS written in Angular 4 with Angular Material UI
Stars: ✭ 54 (+0%)
Mutual labels:  firebase
Ionic Chat With Firebase
IONIC Chat With Firebase
Stars: ✭ 53 (-1.85%)
Mutual labels:  firebase
Ember Cloud Firestore Adapter
Unofficial Ember Data Adapter and Serializer for Cloud Firestore
Stars: ✭ 51 (-5.56%)
Mutual labels:  firebase
Postgresclientkit
A PostgreSQL client library for Swift. Does not require libpq.
Stars: ✭ 49 (-9.26%)
Mutual labels:  server-side-swift
Lark
Swift SOAP Client
Stars: ✭ 52 (-3.7%)
Mutual labels:  swift-package-manager
Scenekit Scnline
Draw a tube or thick line in SceneKit
Stars: ✭ 49 (-9.26%)
Mutual labels:  swift-package-manager
Tiledesk Dashboard
The Tiledesk dashboard. Tiledesk is an Open Source Live Chat platform written in NodeJs, firebase and Angular.
Stars: ✭ 53 (-1.85%)
Mutual labels:  firebase
Perfect Postgresql
A stand-alone Swift wrapper around the libpq client library, enabling access to PostgreSQL servers.
Stars: ✭ 48 (-11.11%)
Mutual labels:  server-side-swift
Fluent Sqlite Driver
Fluent driver for SQLite
Stars: ✭ 51 (-5.56%)
Mutual labels:  server-side-swift
Framelayoutkit
FrameLayoutKit is a super fast and easy to use autolayout kit
Stars: ✭ 53 (-1.85%)
Mutual labels:  swift-package-manager
Client
Swift client for Kubernetes
Stars: ✭ 50 (-7.41%)
Mutual labels:  server-side-swift

FirebaseSwift

Build Status Language GitHub license

FirebaseSwift is intended for server-side Swift and acts as a wrapper around the Firebase REST api. Options for both synchronous and asynchronous calls.

Swift Package Manager

.package(url: "https://github.com/gtchance/FirebaseSwift.git", .upToNextMajor(from: "1.6"))

Example

let firebase = Firebase(
baseURL: "https://myapp.firebaseio.com/",
accessToken: "<MY_GOOGLE_OAUTH2_ACCESS_TOKEN>")
AUTH

See instructions here on creating an access token. You cannot currently create an access token with this library, but you can use an access token you've created elsewhere or use the depricated Database Secret (see below on using a secret instead of an access token)

If you want to use the deprecated Firebase Database Secret, use the auth property:

// Deprecated by Firebase. Use access token in the main example instead.
let firebase = Firebase(baseURL: "https://myapp.firebaseio.com/")
firebase.auth = "<MY_DATABASE_SECRET>"

GET
// sync
let user = firebase.get("user")

// async
firebase.get("user") { user in
  // ...
}
POST
let newUser = [
  "name": "John",
  "email": "[email protected]"
]
// sync
let result = firebase.post(path: "user", value: newUser)
print(result) // ["name": "john_id"]

// async
firebase.post(path: "user", value: newUser) { result in
  // ...
}
PUT
let updatedUser = [
  "name": "John Smith",
  "email": "[email protected]"
]
// can also use setValue(path: ..., value: ...)
// sync
let response = firebase.put(path: "user/john_id", value: updatedUser)

// async
firebase.put(path: "user/john_id", value: updatedUser) { result in
  // ...
}
DELETE
// sync
firebase.delete("user/john_id")

// async
firebase.delete("user/john_id") {
  // ...
}
PATCH
// sync
let result = firebase.patch(path: "user/john_id", value: ["middleInitial": "T"])

// async
firebase.patch(path: "user/john_id", value: ["middleInitial": "T"]) { result in
  // ...
}
I AM NOT AFFILIATED WITH GOOGLE OR FIREBASE IN ANY WAY

If you experience any bugs, please create an issue or submit a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].