diff --git a/OYPermission.podspec b/OYPermission.podspec index dea42a5..7454e02 100644 --- a/OYPermission.podspec +++ b/OYPermission.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "OYPermission" - s.version = "1.0" + s.version = "1.0.1" s.summary = "Swift SDK to help with Permission authorizations" s.homepage = "https://github.com/osmanyildirim/OYPermission.git" diff --git a/Sources/Types/Notifications.swift b/Sources/Types/Notifications.swift index 5f81ec9..783be1d 100644 --- a/Sources/Types/Notifications.swift +++ b/Sources/Types/Notifications.swift @@ -56,8 +56,14 @@ public final class Notifications: OYBaseRequestable { let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.badge, .alert, .sound]) { granted, error in + guard granted else { + closure?(false, error) + return + } + DispatchQueue.main.async { - closure?(granted, error) + UIApplication.shared.registerForRemoteNotifications() + closure?(granted, nil) } } }