Although I disable notification permission in setting, still receive push notification when app in foreground
AppDelegate::application(_:didReceiveRemoteNotification:fetchCompletionHandler:)[L:------------------didReceiveRemoteNotification [AnyHashable("aps"): { alert = { body = "Push payload body"; subtitle = "Test push notification"; title = "Push Hero"; }; }]------------------]
The notification permission in settings is meant to control the visual behavior of notifications. If it is disabled the app will not be able to show notifications.
But in the case of app being in the foreground and also for notifications with the content-available flag in the payload, these are considered signals to the app that there is new content to be fetched or an action can be taken upon receipt. While content-available notifications are usually throttled if your app is in the background or not running, if it is already in the foreground the system passes the information in case you would like to refresh your content automatically.