The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
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](https://github.com/Flowductive/easy-firebase/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) or report buts in [Issues](https://github.com/Flowductive/easy-firebase/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!
## Minor Changes
- Added a method to listen to Singleton updates.
- Added an option to override EasyLink's redirect to the AppStore using `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](https://github.com/Flowductive/easy-firebase/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) or report buts in [Issues](https://github.com/Flowductive/easy-firebase/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!
## 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.
🎉 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](https://github.com/Flowductive/easy-firebase/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) or report buts in [Issues](https://github.com/Flowductive/easy-firebase/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!
## 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.
```swift
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
...
}
```
### EasyLink Support
Create a Firebase Dynamic Link using `EasyLink`:
```swift
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:
```swift
EasyLink.handle(handledURL) { easyLink in
guard let easyLink = easyLink else { return }
if let id: String = easyLink.query["foodID"] { ... }
}
```
Pass in social parameters:
```swift
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:
```swift
EasyFirestore.Updating.updateMapValue(key: "Barry", value: 25, to: \.friends, in: global.user) { error in ... }
```
Remove a similar value:
```swift
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:
```swift
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
🎉 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](https://github.com/Flowductive/easy-firebase/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) or report buts in [Issues](https://github.com/Flowductive/easy-firebase/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!
> **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:
```swift
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!"
}
```
```swift
// 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:
```swift
// 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`.
Thanks for using EasyFirebase! 🎉
## Minor Changes
- Added Swift Package Index documentation support
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 `MessagingNotification`s
- 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
🎉 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](https://github.com/Flowductive/easy-firebase/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) or report buts in [Issues](https://github.com/Flowductive/easy-firebase/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!
## 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
🎉 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](https://github.com/Flowductive/easy-firebase/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) or report buts in [Issues](https://github.com/Flowductive/easy-firebase/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!
## 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