I am looking for the alternate way of implementing UIUserNotificationSettings in iOS 10.
Apple documentation has given the below framework for the further usage. UNNotificationSettings in the link here.
Is there any one who can help me with the sample code to implement the below using the UNNotificationSettings instead of UIUserNotificationSettings
let notificationSettings = UIUserNotificationSettings(
forTypes: [.Badge, .Sound, .Alert], categories: nil)
application.registerUserNotificationSettings(notificationSettings)
Registration of notification you should implement this code :
import UserNotifications
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {
(granted, error) in
//Parse errors and track state
}
This resource contains additional information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With