Easy Firebase Versions Save

🔥 A Swifty solution for all things Firebase. Quickly implement Firestore and Authentication on iOS + macOS using Swift protocols and methods.

1.4.5

1 year ago

This update fixes issues with accounts resetting.

1.4.4

1 year ago

This update fixes issues with Firestore Querying and Cloud Messages.

1.4.3

1 year ago

🎉 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!

Minor Changes

  • Added a method to listen to Singleton updates.
  • Added an option to override EasyLink's redirect to the AppStore using EasyLink.redirectToAppStore.

1.4.2

1 year ago

🎉 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!

Minor Changes

  • Firebase Remote Config can now be imported as a dependency.
  • Singletons are now explicitly stored with set(singleton:...).
  • EasyAuth.signInWithApple(...) now uses a completion handler.
  • Device token improvements.
  • Persistence can now be toggled using EasyFirestore.usePersistence.

Fixes

  • Issues with EasyLink have been fixed.

1.4.0

1 year ago

🎉 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!

New Features

Built-In Geo-Querying

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)

Firestore Map Updating

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 ... }

EasyMessaging Improvements

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")

Minor Changes

  • New Session Errors: .endError, .alreadyHost, .notInSession, .alreadyInSession provide additional session warnings.
  • The onUpdate callback of EasyFirestore.Listening.listen(...) will be called passing nil if no data can be found for a document.
  • Added a simple EasyFirestore.Updating demonstration to the Example Project.

Bug Fixes

1.3.0

1 year ago

🎉 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!

New Features

Sessions

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 ... }

Improved Firestore Updating

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)

Minor Changes

  • Improved the stability of EasyUser's encoding and decoding.
  • Added documentation for EasyFirestore.Listening methods.
  • Refactored all DocumentID types (a.k.a String) to <DOCUMENT_CLASS_NAME>.ID associated type i.e. MyDocumentType.ID.

1.2.5

1 year ago

Thanks for using EasyFirebase! 🎉

Minor Changes

  • Added Swift Package Index documentation support

1.2.4

1 year ago

Thanks for using EasyFirebase! 🎉

New Features

  • Use EasyFirestore.Querying.where(path:matches:completion:) to query documents matching a string (for search purposes)
  • Use the .inQueryableFormat computed String property to obtain a queryable format of a String (no symbols, capital letters, etc.)

Minor Changes

  • Added a key property to Messaging Notifications so basic action handling can be passed thorough MessagingNotifications
  • EasyAuth will now automatically update .lastSignon, EasyUser.versionUpdate, and .appVersion.
  • Emails are no longer required to form EasyUser objects when using EasyUser.get(from: User)
  • Use the .incremented(...) method to increment a String to querying

Bug Fixes

  • Fixed .getChildren(...) Document method
  • Fixed issues with operator precedence

1.2.3

1 year ago

🎉 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!

Minor Changes

  • Reduced the Analytics update cooldown to 2 seconds
  • Made EasyUser.analyticsProperties() overridable
  • Improved the callbacks for all auth methods
  • Added an optional completion handler to EasyUser.refreshEmailVerificationStatus()
  • Relevant error messages are now shown for Storage uploads

Bug Fixes

  • Fixed completion handlers not being called on EasyUser when auth is mismatched

1.2.2

2 years ago

🎉 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!

Minor Additions

  • Add Google + Apple sign-in examples
  • Add additional wiki assets

Bug Fixes

  • EasyUser's .refreshEmailVerificationStatus() now properly reloads the status
  • Other minor fixes