diff --git a/ios/CustomNotificationServiceExtension/NotificationService.swift b/ios/CustomNotificationServiceExtension/NotificationService.swift index abd04a62fe63..6b95f4f49ffb 100644 --- a/ios/CustomNotificationServiceExtension/NotificationService.swift +++ b/ios/CustomNotificationServiceExtension/NotificationService.swift @@ -5,31 +5,8 @@ // Created by Andrew Rosiclair on 12/8/23. // -import UserNotifications +import AirshipServiceExtension -class NotificationService: UNNotificationServiceExtension { - - var contentHandler: ((UNNotificationContent) -> Void)? - var bestAttemptContent: UNMutableNotificationContent? - - override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { - self.contentHandler = contentHandler - bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) - - if let bestAttemptContent = bestAttemptContent { - // Modify the notification content here... - bestAttemptContent.title = "\(bestAttemptContent.title) [modified]" - - contentHandler(bestAttemptContent) - } - } - - override func serviceExtensionTimeWillExpire() { - // Called just before the extension will be terminated by the system. - // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. - if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { - contentHandler(bestAttemptContent) - } - } +class NotificationService: UANotificationServiceExtension { } diff --git a/ios/Podfile b/ios/Podfile index 6aee4b94df04..2df3d94a013d 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -118,3 +118,7 @@ target 'NewExpensify' do end end end + +target 'CustomNotificationServiceExtension' do + pod 'AirshipServiceExtension' +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0fac30a26430..0c1214344a8f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -20,6 +20,7 @@ PODS: - Airship (= 16.12.1) - Airship/MessageCenter (= 16.12.1) - Airship/PreferenceCenter (= 16.12.1) + - AirshipServiceExtension (16.12.5) - AppAuth (1.6.2): - AppAuth/Core (= 1.6.2) - AppAuth/ExternalUserAgent (= 1.6.2) @@ -828,6 +829,7 @@ PODS: - Yoga (~> 1.14) DEPENDENCIES: + - AirshipServiceExtension - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) - BVLinearGradient (from `../node_modules/react-native-linear-gradient`) - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) @@ -942,6 +944,7 @@ SPEC REPOS: trunk: - Airship - AirshipFrameworkProxy + - AirshipServiceExtension - AppAuth - CocoaAsyncSocket - Firebase @@ -1162,6 +1165,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Airship: 2f4510b497a8200780752a5e0304a9072bfffb6d AirshipFrameworkProxy: ea1b6c665c798637b93c465b5e505be3011f1d9d + AirshipServiceExtension: 89c6e25a69f3458d9dbd581c700cffb196b61930 AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570 boost: 57d2868c099736d80fcd648bf211b4431e51a558 BVLinearGradient: 421743791a59d259aec53f4c58793aad031da2ca @@ -1291,6 +1295,6 @@ SPEC CHECKSUMS: Yoga: 3efc43e0d48686ce2e8c60f99d4e6bd349aff981 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: ff769666b7221c15936ebc5576a8c8e467dc6879 +PODFILE CHECKSUM: c44319b85c142746fd25749dc13f06ce81273f22 COCOAPODS: 1.12.1