Skip to content

Commit d73c445

Browse files
MOEN-41314: Fixed the issue of category not appearing with push notification (#92)
* MOEN-41314: Fixed the issue of category not appearing with push notification * MOEN-41314: Fixed changelog
1 parent d2be148 commit d73c445

2 files changed

Lines changed: 1 addition & 39 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Release Version
44

55
- [minor] Added Swift Package Manager distribution support
6+
- [patch] Fixed the issue of Category on Push notifications.
67

78
# 17-10-2025
89

Sources/MoEngagePluginBase/MoEngagePluginMessageDelegateHandler.swift

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,6 @@ final class MoEngagePluginMessageDelegateHandler: NSObject, MoEngageMessagingDel
2626

2727
private func setMessagingDelegate() {
2828
MoEngageSDKMessaging.sharedInstance.setMessagingDelegate(self, forAppID: identifier)
29-
30-
let current = UNUserNotificationCenter.current()
31-
32-
current.getNotificationSettings(completionHandler: { (settings) in
33-
switch settings.authorizationStatus {
34-
case .authorized:
35-
DispatchQueue.main.async {
36-
37-
guard let sharedApplication = MoEngageCoreUtils.sharedUIApplication(),
38-
sharedApplication.isRegisteredForRemoteNotifications
39-
else {
40-
return
41-
}
42-
43-
if let currentDelegate = UNUserNotificationCenter.current().delegate {
44-
MoEngageSDKMessaging.sharedInstance.registerForRemoteNotification(withCategories: nil, andUserNotificationCenterDelegate: currentDelegate)
45-
} else {
46-
MoEngageSDKMessaging.sharedInstance.registerForRemoteNotification(withCategories: nil, andUserNotificationCenterDelegate: self)
47-
}
48-
}
49-
default:
50-
break
51-
}
52-
})
5329
}
5430

5531
func notificationRegistered(withDeviceToken deviceToken: String) {
@@ -63,18 +39,3 @@ final class MoEngagePluginMessageDelegateHandler: NSObject, MoEngageMessagingDel
6339
}
6440

6541
}
66-
67-
@available(iOSApplicationExtension, unavailable)
68-
@available(tvOS, unavailable)
69-
extension MoEngagePluginMessageDelegateHandler: UNUserNotificationCenterDelegate {
70-
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
71-
completionHandler([.alert, .sound])
72-
}
73-
74-
#if !os(tvOS)
75-
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
76-
MoEngageSDKMessaging.sharedInstance.userNotificationCenter(center, didReceive: response)
77-
completionHandler()
78-
}
79-
#endif
80-
}

0 commit comments

Comments
 (0)