@@ -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