I am developing my first application in IOS and I want that when I update my bbdd (Firebase) in the subject method (applicationDidEnterBackground) I get a notification to show it in the icon of my app.
I have this code:
func applicationDidEnterBackground(_ application: UIApplication) {
DispatchQueue.global(qos: .background).async {
- Llamada a Firebase (funciona correctamente cuando se actualiza un nodo)
- UNUserNotificationCenter.current().add(request, withCompletionHandler: nil)
}
}
The code is fine, both the call to firebase and notifications (tested), my problem is that this code when the application goes into the background does not work and I do not know why.
What's more, if I re-enter the app, it's when the code finally runs and I get the notification in the app's icon.
Can someone help me?
Thank you very much!