IOS App - Method applicationDidEnterBackground

1

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!

    
asked by Yayo 12.11.2017 в 22:11
source

1 answer

0

Here are several examples of how to continue running in the background:

link

    
answered by 02.03.2018 в 09:21