Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
}
Loading