How to create a Notifications Settings button in the Notification Settings on iOS?

How to create a Notifications Settings button in the Notification Settings similar to Facebook Notification Settings that will lead users to the app's internal settings page?

Answered by Engineer in 824586022

To add such a link back to your app from the Settings app -> Notification settings, you would also request authorization for .providesAppNotificationSettings when requesting authorization for notifications.

UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .alert, .sound, .providesAppNotificationSettings])

This will create this button you within the Settings app. When that button is tapped, the system will wake up or launch your app and call the delegate function userNotificationCenter(_:openSettingsFor:) which you need to implement in your UNUserNotificationCenterDelegate class.

In this delegate function, you can take the steps to navigate to your internal settings view.


Argun Tekant /  DTS Engineer / Core Technologies

Accepted Answer

To add such a link back to your app from the Settings app -> Notification settings, you would also request authorization for .providesAppNotificationSettings when requesting authorization for notifications.

UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .alert, .sound, .providesAppNotificationSettings])

This will create this button you within the Settings app. When that button is tapped, the system will wake up or launch your app and call the delegate function userNotificationCenter(_:openSettingsFor:) which you need to implement in your UNUserNotificationCenterDelegate class.

In this delegate function, you can take the steps to navigate to your internal settings view.


Argun Tekant /  DTS Engineer / Core Technologies

How to create a Notifications Settings button in the Notification Settings on iOS?
 
 
Q