diff --git a/CHANGELOG.md b/CHANGELOG.md index f223d72..0442c12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Release Version - [minor] Added Swift Package Manager distribution support +- [patch] Fixed the issue of Category on Push notifications. # 17-10-2025 diff --git a/Sources/MoEngagePluginBase/MoEngagePluginMessageDelegateHandler.swift b/Sources/MoEngagePluginBase/MoEngagePluginMessageDelegateHandler.swift index ba9d31b..99c1734 100644 --- a/Sources/MoEngagePluginBase/MoEngagePluginMessageDelegateHandler.swift +++ b/Sources/MoEngagePluginBase/MoEngagePluginMessageDelegateHandler.swift @@ -26,30 +26,6 @@ final class MoEngagePluginMessageDelegateHandler: NSObject, MoEngageMessagingDel private func setMessagingDelegate() { MoEngageSDKMessaging.sharedInstance.setMessagingDelegate(self, forAppID: identifier) - - let current = UNUserNotificationCenter.current() - - current.getNotificationSettings(completionHandler: { (settings) in - switch settings.authorizationStatus { - case .authorized: - DispatchQueue.main.async { - - guard let sharedApplication = MoEngageCoreUtils.sharedUIApplication(), - sharedApplication.isRegisteredForRemoteNotifications - else { - return - } - - if let currentDelegate = UNUserNotificationCenter.current().delegate { - MoEngageSDKMessaging.sharedInstance.registerForRemoteNotification(withCategories: nil, andUserNotificationCenterDelegate: currentDelegate) - } else { - MoEngageSDKMessaging.sharedInstance.registerForRemoteNotification(withCategories: nil, andUserNotificationCenterDelegate: self) - } - } - default: - break - } - }) } func notificationRegistered(withDeviceToken deviceToken: String) { @@ -63,18 +39,3 @@ final class MoEngagePluginMessageDelegateHandler: NSObject, MoEngageMessagingDel } } - -@available(iOSApplicationExtension, unavailable) -@available(tvOS, unavailable) -extension MoEngagePluginMessageDelegateHandler: UNUserNotificationCenterDelegate { - func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { - completionHandler([.alert, .sound]) - } - - #if !os(tvOS) - func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { - MoEngageSDKMessaging.sharedInstance.userNotificationCenter(center, didReceive: response) - completionHandler() - } - #endif -}