🔥 A Swifty solution for all things Firebase. Quickly implement Firestore and Authentication on iOS + macOS using Swift protocols and methods.
This update fixes issues with accounts resetting.
This update fixes issues with Firestore Querying and Cloud Messages.
🎉 Thank you for supporting EasyFirebase! I'm a full-time student spending my free time on this library, so I apologize if there any bugs present. Feel free to contribute with a pull request or report buts in Issues!
EasyLink.redirectToAppStore
.🎉 Thank you for supporting EasyFirebase! I'm a full-time student spending my free time on this library, so I apologize if there any bugs present. Feel free to contribute with a pull request or report buts in Issues!
set(singleton:...)
.EasyAuth.signInWithApple(...)
now uses a completion handler.EasyFirestore.usePersistence
.🎉 Thank you for supporting EasyFirebase! I'm a full-time student spending my free time on this library, so I apologize if there any bugs present. Feel free to contribute with a pull request or report buts in Issues!
Geohashing and querying is built-in now with EasyFirebase. Conform your document type to GeoQueryable
to unlock geo-querying capabilities for your documents.
class MyDocument: Document, GeoQueryable {
static var geohashPrecision: GeoPrecision = .normal
@objc var geohash: String = ""
var latitude: Double
var longitude: Double
...
}
// Works if myDocument.latitude and myDocument.longitude are non-nil
myDocument.updateGeohash()
// Query nearby documents
EasyFirestore.Querying.near(\MyDocument.geohash, at: location, precision: .loose, order: .ascending) { documents in
...
}
Create a Firebase Dynamic Link using EasyLink
:
EasyLink.urlPrefix = "company.page.link"
EasyLink.backupURL = URL(string: "https://www.mycompany.com")
var link = EasyLink(host: "mycompany.com", query: ("foodID", food.id))
link.shorten { shortURL in ... }
Handle a universal URL using EasyLink
to retrieve the deep-link payload:
EasyLink.handle(handledURL) { easyLink in
guard let easyLink = easyLink else { return }
if let id: String = easyLink.query["foodID"] { ... }
}
Pass in social parameters:
link.social = .init(title: "My Food", desc: "Check out this awesome meal.", imageURL: foodImageURL)
Update the value of a field in a map in a field in a document in Firestore:
EasyFirestore.Updating.updateMapValue(key: "Barry", value: 25, to: \.friends, in: global.user) { error in ... }
Remove a similar value:
EasyFirestore.Updating.removeMapValue(key: "Barry", from: \.friends, in: global.user) { error in ... }
It's easier to define the type of information you wish to display in a MessagingNotification
. A new initializer provides explicit control over a remote notification's title, body, and other information:
let notification = MessagingNotification(title: "Hello, world!", body: "It's a great, sunny day. Fizzbuzz! 🐝", from: global.user, in: "general")
.endError
, .alreadyHost
, .notInSession
, .alreadyInSession
provide additional session warnings.onUpdate
callback of EasyFirestore.Listening.listen(...)
will be called passing nil
if no data can be found for a document.EasyFirestore.Updating
demonstration to the Example Project.🎉 Thank you for supporting EasyFirebase! I'm a full-time student spending my free time on this library, so I apologize if there any bugs present. Feel free to contribute with a pull request or report buts in Issues!
Note New
firebase-ios-sdk
dependency version for this version of EasyFirebase: 9.0.0 Please make sure to update your dependencies!
Create, join, and listen to Sessions: a place where users can join together to exchange data in an interactive way:
class MySession: Session {
// Inherited Properties
var id: String = UUID().uuidString
var dateCreated: Date = Date()
var host: FUser.ID = ""
var users: [FUser.ID] = []
// Your custom properties
var myData: String = "Hello, world!"
}
// Create a new session
myUser.createSession(ofType: MySession.self) { session, error in
// Passes a session if success, error if failure
...
}
// Join an existing session
myUser.joinSession(id: sessionID, ofType: MySession.self) { session, error in ... }
// Once the session has been created/joined, listen to the session
myUser.listen(to: session, onUpdate { session in ... }, onEnd: { ... })
// Leave a session
myUser.leaveSession(session) { error in ... }
Append and remove items in arrays remotely without affecting your read count:
// Append element to array
EasyFirestore.Updating.append(\.ingredients, with: "Cheese", in: pizzaDocument) { error in ... }
// Increment field
EasyFirestore.Updating.increment(\.pepperoniCount, by: 5, in: pizzaDocument)
// Remove elements from array
EasyFirestore.Updating.remove(\.ingredients, taking: ["Garlic", "Anchovies", "Pineapple"], from: pizzaDocument)
EasyFirestore.Listening
methods.DocumentID
types (a.k.a String
) to <DOCUMENT_CLASS_NAME>.ID
associated type i.e. MyDocumentType.ID
.Thanks for using EasyFirebase! 🎉
EasyFirestore.Querying.where(path:matches:completion:)
to query documents matching a string (for search purposes).inQueryableFormat
computed String property to obtain a queryable format of a String (no symbols, capital letters, etc.)key
property to Messaging Notifications so basic action handling can be passed thorough MessagingNotification
s.lastSignon
, EasyUser.versionUpdate
, and .appVersion
.EasyUser
objects when using EasyUser.get(from: User)
.incremented(...)
method to increment a String to querying.getChildren(...)
Document method🎉 Thank you for supporting EasyFirebase! I'm a full-time student spending my free time on this library, so I apologize if there any bugs present. Feel free to contribute with a pull request or report buts in Issues!
EasyUser.analyticsProperties()
overridableEasyUser.refreshEmailVerificationStatus()
EasyUser
when auth is mismatched🎉 Thank you for supporting EasyFirebase! I'm a full-time student spending my free time on this library, so I apologize if there any bugs present. Feel free to contribute with a pull request or report buts in Issues!
EasyUser
's .refreshEmailVerificationStatus()
now properly reloads the status