Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

1.3.0

Compare
Choose a tag to compare
@benlmyers benlmyers released this 29 Aug 07:27
· 32 commits to main since this release

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