|
|
|
@ -21,13 +21,8 @@ class PushNotificationsRegistrar { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func register() { |
|
|
|
|
if #available(iOS 10, *) { |
|
|
|
|
UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .alert, .sound]) { _, _ in } |
|
|
|
|
UIApplication.shared.registerForRemoteNotifications() |
|
|
|
|
} else if #available(iOS 9, *) { |
|
|
|
|
UIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil)) |
|
|
|
|
UIApplication.shared.registerForRemoteNotifications() |
|
|
|
|
} |
|
|
|
|
UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .alert, .sound]) { _, _ in } |
|
|
|
|
UIApplication.shared.registerForRemoteNotifications() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func unregister() { |
|
|
|
|