I'm trying to delete all pending notifications when user quit the app
So I added this code
func applicationWillTerminate(_ application: UIApplication) {
print("This function was executed")
application.unregisterForRemoteNotifications()
}
at AppDelegate.swift
to delete all pending notifications when user quit the app.
But it didn't work. So I added print("This function was executed")
and actually quit the app to see whether Xcode prints "This function was executed"
But Xcode doesn't print This "function was executed"
How can I fix this?