I saw such buttons in some applications in the push notifications settings, which open the personal notification settings in the application. I could not find information on how to implement this. Please tell me how to add this to my application. enter image description here
CodePudding user response:
On the request notification authorization you should add providesAppNotificationSettings
like below.
UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .alert, .sound, .providesAppNotificationSettings])
After that you need to redirect user to your app's settings page below function.
func userNotificationCenter(_ center: UNUserNotificationCenter, openSettingsFor notification: UNNotification?) { // Redirect User to App Settings Page}