I have built an app using SwiftUI 2.0 that just houses a few documents stored inside a Firebase Firestore database. I have also integrated push notifications, so that you can manually send them through the cloud messaging service firebase offer.
My query is, is it possible to send a notification to all devices with the app downloaded, when a new document is added; alerting them to the new document. I have no experience with node.js which I think is what is used most of the time, but am wondering if it is possible to do it all within Swift.
My ideal situation would be to run the below function and have a notification sent out with the corresponding message!
func add(_ card: Card) {
do {
_ = try store.collection(path).addDocument(from: card)
//Something here to send a notification to all other devices?!!
} catch {
fatalError("Unable to add card: \(error.localizedDescription).")
}
}