From 58b3d7589648312becc3553b7c76c07b375f76ec Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 23 Jul 2024 11:18:06 +0800 Subject: [PATCH] :bug: Fix NSE --- ios/Podfile.lock | 72 ++++++++-------- ios/SolianNotifyExt/NotificationService.swift | 11 +-- macos/Podfile | 2 +- macos/Podfile.lock | 68 +++++++-------- macos/Runner.xcodeproj/project.pbxproj | 21 +++-- .../SolianNotifyExt/NotificationService.swift | 11 +-- .../SolianNotifyExt.entitlements | 8 ++ pubspec.lock | 84 +++++++++---------- pubspec.yaml | 2 +- 9 files changed, 150 insertions(+), 129 deletions(-) create mode 100644 macos/SolianNotifyExt/SolianNotifyExt.entitlements diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ad91e38..011079b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -38,30 +38,30 @@ PODS: - file_picker (0.0.1): - DKImagePickerController/PhotoGallery - Flutter - - Firebase/CoreOnly (10.27.0): - - FirebaseCore (= 10.27.0) - - Firebase/Messaging (10.27.0): + - Firebase/CoreOnly (10.28.0): + - FirebaseCore (= 10.28.0) + - Firebase/Messaging (10.28.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 10.27.0) - - firebase_core (3.1.1): - - Firebase/CoreOnly (= 10.27.0) + - FirebaseMessaging (~> 10.28.0) + - firebase_core (3.2.0): + - Firebase/CoreOnly (= 10.28.0) - Flutter - - firebase_messaging (15.0.2): - - Firebase/Messaging (= 10.27.0) + - firebase_messaging (15.0.3): + - Firebase/Messaging (= 10.28.0) - firebase_core - Flutter - - FirebaseCore (10.27.0): + - FirebaseCore (10.28.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) - - FirebaseCoreInternal (10.28.0): + - FirebaseCoreInternal (10.29.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseInstallations (10.28.0): + - FirebaseInstallations (10.29.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - - FirebaseMessaging (10.27.0): + - FirebaseMessaging (10.28.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.3) @@ -73,9 +73,9 @@ PODS: - Flutter (1.0.0) - flutter_secure_storage (6.0.0): - Flutter - - flutter_webrtc (0.9.36): + - flutter_webrtc (0.11.3): - Flutter - - WebRTC-SDK (= 114.5735.10) + - WebRTC-SDK (= 125.6422.04) - GoogleDataTransport (9.4.1): - GoogleUtilities/Environment (~> 7.7) - nanopb (< 2.30911.0, >= 2.30908.0) @@ -107,9 +107,9 @@ PODS: - GoogleUtilities/Privacy - image_picker_ios (0.0.1): - Flutter - - livekit_client (2.2.0): + - livekit_client (2.2.1): - Flutter - - WebRTC-SDK (= 114.5735.10) + - WebRTC-SDK (= 125.6422.04) - media_kit_libs_ios_video (1.0.4): - Flutter - media_kit_native_event_loop (1.0.0): @@ -135,14 +135,14 @@ PODS: - Flutter - screen_brightness_ios (0.1.0): - Flutter - - SDWebImage (5.19.2): - - SDWebImage/Core (= 5.19.2) - - SDWebImage/Core (5.19.2) - - Sentry/HybridSDK (8.29.0) - - sentry_flutter (8.3.0): + - SDWebImage (5.19.4): + - SDWebImage/Core (= 5.19.4) + - SDWebImage/Core (5.19.4) + - Sentry/HybridSDK (8.30.1) + - sentry_flutter (8.4.0): - Flutter - FlutterMacOS - - Sentry/HybridSDK (= 8.29.0) + - Sentry/HybridSDK (= 8.30.1) - sqflite (0.0.3): - Flutter - FlutterMacOS @@ -153,7 +153,7 @@ PODS: - Flutter - wakelock_plus (0.0.1): - Flutter - - WebRTC-SDK (114.5735.10) + - WebRTC-SDK (125.6422.04) DEPENDENCIES: - connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`) @@ -255,20 +255,20 @@ SPEC CHECKSUMS: DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655 - Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86 - firebase_core: f8d0424c45e0f1e596811085fc12c638d628457c - firebase_messaging: 8b29edaf5adfd3b52b5bfa5af8128c44164670c6 - FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808 - FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 - FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e - FirebaseMessaging: 585984d0a1df120617eb10b44cad8968b859815e + Firebase: 5121c624121af81cbc81df3bda414b3c28c4f3c3 + firebase_core: a9d0180d5285527884d07a41eb4a9ec9ed12cdb6 + firebase_messaging: ccc82a143a74de75f440a4e413dbbb37ec3fddbc + FirebaseCore: 857dc1c6dd1255675047404d8466f7dfaac5d779 + FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934 + FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd + FirebaseMessaging: 087a7c7cadef7b9239f005bc4db823894844f323 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 - flutter_webrtc: b33475c3a57d59ff05bf87b4f5d3feceac63f291 + flutter_webrtc: 75b868e4f9e817c7a9a42ca4b6169063de4eec9f GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 - livekit_client: 2b3f5185f95d46d62d3570bf981f3d98ad3051e2 + livekit_client: 411d387fd6f993851081069afbe7f04a8e974f1b media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1 media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e @@ -280,15 +280,15 @@ SPEC CHECKSUMS: PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 protocol_handler_ios: a5db8abc38526ee326988b808be621e5fd568990 screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625 - SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a - Sentry: 016de45ee5ce5fca2a829996f1bfafeb5e62e8b4 - sentry_flutter: 5fb57c5b7e6427a9dc1fedde4269eb65823982d4 + SDWebImage: 066c47b573f408f18caa467d71deace7c0f8280d + Sentry: 514a3ea653886e9a48c6287d8b7bf05ec24bf3be + sentry_flutter: edc037f7af0dc1512d6c33a5c2c7c838bd0d6806 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9 wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 - WebRTC-SDK: 8c0edd05b880a39648118192c252667ea06dea51 + WebRTC-SDK: c3d69a87e7185fad3568f6f3cff7c9ac5890acf3 PODFILE CHECKSUM: a57f30d18f102dd3ce366b1d62a55ecbef2158e5 diff --git a/ios/SolianNotifyExt/NotificationService.swift b/ios/SolianNotifyExt/NotificationService.swift index 105b4fd..d379acf 100644 --- a/ios/SolianNotifyExt/NotificationService.swift +++ b/ios/SolianNotifyExt/NotificationService.swift @@ -29,14 +29,12 @@ class NotificationService: UNNotificationServiceExtension { guard let metadata = bestAttemptContent.userInfo["metadata"] as? [AnyHashable : Any] else { throw ParseNotificationPayloadError.noMetadata("The notification has no metadata.") } - let userId = metadata["user_id"] as! Int - let userName = metadata["user_name"] as? String guard let avatarUrl = bestAttemptContent.userInfo["avatar"] as? String else { throw ParseNotificationPayloadError.noMetadata("The notification has no avatar url.") } - let handle = INPersonHandle(value: String(userId), type: .unknown) + let handle = INPersonHandle(value: String(metadata["user_id"] as! Int), type: .unknown) let avatar = INImage( url: URL(string: avatarUrl)! )! @@ -45,19 +43,22 @@ class NotificationService: UNNotificationServiceExtension { displayName: bestAttemptContent.title, image: avatar, contactIdentifier: nil, - customIdentifier: userName) + customIdentifier: nil) let intent = INSendMessageIntent(recipients: nil, outgoingMessageType: .outgoingMessageText, content: bestAttemptContent.body, speakableGroupName: nil, conversationIdentifier: String(metadata["channel_id"] as! Int), - serviceName: "PostPigeon", + serviceName: nil, sender: sender, attachments: nil) let interaction = INInteraction(intent: intent, response: nil) interaction.direction = .incoming interaction.donate(completion: nil) + + let updatedContent = try request.content.updating(from: intent) + contentHandler(updatedContent) break default: contentHandler(bestAttemptContent) diff --git a/macos/Podfile b/macos/Podfile index b52666a..b15254e 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.15' +platform :osx, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/macos/Podfile.lock b/macos/Podfile.lock index c9249ee..58e6c40 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -8,31 +8,31 @@ PODS: - FlutterMacOS - file_selector_macos (0.0.1): - FlutterMacOS - - Firebase/CoreOnly (10.27.0): - - FirebaseCore (= 10.27.0) - - Firebase/Messaging (10.27.0): + - Firebase/CoreOnly (10.28.1): + - FirebaseCore (= 10.28.1) + - Firebase/Messaging (10.28.1): - Firebase/CoreOnly - - FirebaseMessaging (~> 10.27.0) - - firebase_core (3.1.1): - - Firebase/CoreOnly (~> 10.27.0) + - FirebaseMessaging (~> 10.28.0) + - firebase_core (3.2.0): + - Firebase/CoreOnly (~> 10.28.0) - FlutterMacOS - - firebase_messaging (15.0.2): - - Firebase/CoreOnly (~> 10.27.0) - - Firebase/Messaging (~> 10.27.0) + - firebase_messaging (15.0.3): + - Firebase/CoreOnly (~> 10.28.0) + - Firebase/Messaging (~> 10.28.0) - firebase_core - FlutterMacOS - - FirebaseCore (10.27.0): + - FirebaseCore (10.28.1): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) - - FirebaseCoreInternal (10.28.0): + - FirebaseCoreInternal (10.29.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseInstallations (10.28.0): + - FirebaseInstallations (10.29.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - - FirebaseMessaging (10.27.0): + - FirebaseMessaging (10.28.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.3) @@ -43,9 +43,9 @@ PODS: - nanopb (< 2.30911.0, >= 2.30908.0) - flutter_secure_storage_macos (6.1.1): - FlutterMacOS - - flutter_webrtc (0.9.36): + - flutter_webrtc (0.11.3): - FlutterMacOS - - WebRTC-SDK (= 114.5735.10) + - WebRTC-SDK (= 125.6422.04) - FlutterMacOS (1.0.0) - GoogleDataTransport (9.4.1): - GoogleUtilities/Environment (~> 7.7) @@ -76,9 +76,9 @@ PODS: - GoogleUtilities/UserDefaults (7.13.3): - GoogleUtilities/Logger - GoogleUtilities/Privacy - - livekit_client (2.2.0): + - livekit_client (2.2.1): - FlutterMacOS - - WebRTC-SDK (= 114.5735.10) + - WebRTC-SDK (= 125.6422.04) - macos_window_utils (1.0.0): - FlutterMacOS - media_kit_libs_macos_video (1.0.4): @@ -104,11 +104,11 @@ PODS: - FlutterMacOS - screen_brightness_macos (0.1.0): - FlutterMacOS - - Sentry/HybridSDK (8.29.0) - - sentry_flutter (8.3.0): + - Sentry/HybridSDK (8.30.1) + - sentry_flutter (8.4.0): - Flutter - FlutterMacOS - - Sentry/HybridSDK (= 8.29.0) + - Sentry/HybridSDK (= 8.30.1) - sqflite (0.0.3): - Flutter - FlutterMacOS @@ -116,7 +116,7 @@ PODS: - FlutterMacOS - wakelock_plus (0.0.1): - FlutterMacOS - - WebRTC-SDK (114.5735.10) + - WebRTC-SDK (125.6422.04) DEPENDENCIES: - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/darwin`) @@ -210,19 +210,19 @@ SPEC CHECKSUMS: desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720 file_selector_macos: 54fdab7caa3ac3fc43c9fac4d7d8d231277f8cf2 - Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86 - firebase_core: df33f64432203e675060e475de6ea8127eb8398a - firebase_messaging: b8921fa4cbbbebab66e98b181a69f2af0692a820 - FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808 - FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 - FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e - FirebaseMessaging: 585984d0a1df120617eb10b44cad8968b859815e + Firebase: 49e62242b3ae422a002ab647a7e62a332a8c3ec1 + firebase_core: d8af40a9c8a9ce3112a94692aac83675627c0486 + firebase_messaging: 7871cfa8af1e863324e46ae9e90343c452626c02 + FirebaseCore: dfc33f0dffba05f76181da9cc0151171ebb3bd10 + FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934 + FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd + FirebaseMessaging: 087a7c7cadef7b9239f005bc4db823894844f323 flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9 - flutter_webrtc: 823284e171ecb2487b7210c214886a949c122a59 + flutter_webrtc: 2b4e4a2de70a1485836e40fd71a7a94c77d49bd9 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 - livekit_client: 9b39e0f1b8e1a8ec794bb72a4f9bbfc28c959ece + livekit_client: b8dc024da36a5c1103b6ccdcfb5bb7776a1ee6a1 macos_window_utils: 933f91f64805e2eb91a5bd057cf97cd097276663 media_kit_libs_macos_video: b3e2bbec2eef97c285f2b1baa7963c67c753fb82 media_kit_native_event_loop: 81fd5b45192b72f8b5b69eaf5b540f45777eb8d5 @@ -234,13 +234,13 @@ SPEC CHECKSUMS: PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 protocol_handler_macos: d10a6c01d6373389ffd2278013ab4c47ed6d6daa screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda - Sentry: 016de45ee5ce5fca2a829996f1bfafeb5e62e8b4 - sentry_flutter: 5fb57c5b7e6427a9dc1fedde4269eb65823982d4 + Sentry: 514a3ea653886e9a48c6287d8b7bf05ec24bf3be + sentry_flutter: edc037f7af0dc1512d6c33a5c2c7c838bd0d6806 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399 wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269 - WebRTC-SDK: 8c0edd05b880a39648118192c252667ea06dea51 + WebRTC-SDK: c3d69a87e7185fad3568f6f3cff7c9ac5890acf3 -PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 +PODFILE CHECKSUM: f0c21717cb7ee9112f915044c74bfceb5b12e02a COCOAPODS: 1.15.2 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index b697020..929885d 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -71,14 +71,14 @@ }; 733796322C4D64880046C275 /* Embed Foundation Extensions */ = { isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; + buildActionMask = 12; dstPath = ""; dstSubfolderSpec = 13; files = ( 733796312C4D64880046C275 /* SolianNotifyExt.appex in Embed Foundation Extensions */, ); name = "Embed Foundation Extensions"; - runOnlyForDeploymentPostprocessing = 1; + runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ @@ -107,6 +107,7 @@ 7337962A2C4D64880046C275 /* SolianNotifyExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SolianNotifyExt.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 7337962C2C4D64880046C275 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; 7337962E2C4D64880046C275 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 733F502E2C4D7DB40010FE51 /* SolianNotifyExt.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SolianNotifyExt.entitlements; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 8AB030F50C089DAB14480DBD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; @@ -236,6 +237,7 @@ 7337962B2C4D64880046C275 /* SolianNotifyExt */ = { isa = PBXGroup; children = ( + 733F502E2C4D7DB40010FE51 /* SolianNotifyExt.entitlements */, 7337962C2C4D64880046C275 /* NotificationService.swift */, 7337962E2C4D64880046C275 /* Info.plist */, ); @@ -693,7 +695,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 12.0; PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solian; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; @@ -835,7 +837,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 12.0; PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solian; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -863,7 +865,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 12.0; PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solian; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; @@ -900,6 +902,8 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = SolianNotifyExt/SolianNotifyExt.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = W7HPZ53V6B; @@ -921,6 +925,7 @@ MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solian.SolianNotifyExt; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -942,6 +947,8 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = SolianNotifyExt/SolianNotifyExt.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = W7HPZ53V6B; @@ -962,6 +969,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solian.SolianNotifyExt; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -982,6 +990,8 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = SolianNotifyExt/SolianNotifyExt.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = W7HPZ53V6B; @@ -1002,6 +1012,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solian.SolianNotifyExt; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/macos/SolianNotifyExt/NotificationService.swift b/macos/SolianNotifyExt/NotificationService.swift index 105b4fd..d379acf 100644 --- a/macos/SolianNotifyExt/NotificationService.swift +++ b/macos/SolianNotifyExt/NotificationService.swift @@ -29,14 +29,12 @@ class NotificationService: UNNotificationServiceExtension { guard let metadata = bestAttemptContent.userInfo["metadata"] as? [AnyHashable : Any] else { throw ParseNotificationPayloadError.noMetadata("The notification has no metadata.") } - let userId = metadata["user_id"] as! Int - let userName = metadata["user_name"] as? String guard let avatarUrl = bestAttemptContent.userInfo["avatar"] as? String else { throw ParseNotificationPayloadError.noMetadata("The notification has no avatar url.") } - let handle = INPersonHandle(value: String(userId), type: .unknown) + let handle = INPersonHandle(value: String(metadata["user_id"] as! Int), type: .unknown) let avatar = INImage( url: URL(string: avatarUrl)! )! @@ -45,19 +43,22 @@ class NotificationService: UNNotificationServiceExtension { displayName: bestAttemptContent.title, image: avatar, contactIdentifier: nil, - customIdentifier: userName) + customIdentifier: nil) let intent = INSendMessageIntent(recipients: nil, outgoingMessageType: .outgoingMessageText, content: bestAttemptContent.body, speakableGroupName: nil, conversationIdentifier: String(metadata["channel_id"] as! Int), - serviceName: "PostPigeon", + serviceName: nil, sender: sender, attachments: nil) let interaction = INInteraction(intent: intent, response: nil) interaction.direction = .incoming interaction.donate(completion: nil) + + let updatedContent = try request.content.updating(from: intent) + contentHandler(updatedContent) break default: contentHandler(bestAttemptContent) diff --git a/macos/SolianNotifyExt/SolianNotifyExt.entitlements b/macos/SolianNotifyExt/SolianNotifyExt.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/macos/SolianNotifyExt/SolianNotifyExt.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/pubspec.lock b/pubspec.lock index b6ab8bd..c2b5ef1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: a315d1c444402c3fa468de626d33a1c666041c87e9e195e8fb355b7084aefcc1 + sha256: b46f62516902afb04befa4b30eb6a12ac1f58ca8cb25fb9d632407259555dd3d url: "https://pub.dev" source: hosted - version: "1.3.38" + version: "1.3.39" analyzer: dependency: transitive description: @@ -277,10 +277,10 @@ packages: dependency: transitive description: name: dart_webrtc - sha256: d663abfe6ed95afadcb64083e364aa16dbeaadead193bb03047cf6913e57b65e + sha256: ac7ef077084b3e54004716f1d736fcd839e1b60bc3f21f4122a35a9bb5ca2e47 url: "https://pub.dev" source: hosted - version: "1.4.6+hotfix.1" + version: "1.4.8" dbus: dependency: transitive description: @@ -301,10 +301,10 @@ packages: dependency: transitive description: name: dev_build - sha256: "5d23104ed6212275cca89b2226b5288833c6bb15529d4ad66a35a4b30fcb792b" + sha256: cd2d110dc7ca372cc45d4eba79e4be9eb54ceda673687305b82be367aad8c652 url: "https://pub.dev" source: hosted - version: "1.0.0+1" + version: "1.0.0+7" device_info_plus: dependency: "direct main" description: @@ -397,10 +397,10 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: "1e06b0538ab3108a61d895ee16951670b491c4a94fce8f2d30e5de7a5eca4b28" + sha256: "5159984ce9b70727473eb388394650677c02c925aaa6c9439905e1f30966a4d5" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.2.0" firebase_core_platform_interface: dependency: transitive description: @@ -413,34 +413,34 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "6643fe3dbd021e6ccfb751f7882b39df355708afbdeb4130fc50f9305a9d1a3d" + sha256: "23509cb3cddfb3c910c143279ac3f07f06d3120f7d835e4a5d4b42558e978712" url: "https://pub.dev" source: hosted - version: "2.17.2" + version: "2.17.3" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: a1eb38242e072118650139f8485a78d8f12e6d9b6ae563808ca0fa406bdebaad + sha256: "156c4292aa63a6a7d508c68ded984cb38730d2823c3265e573cb1e94983e2025" url: "https://pub.dev" source: hosted - version: "15.0.2" + version: "15.0.3" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: "98faf00cbe125bba136787e1678e7bf213f5e694e8f2615b94ad3d4bdcb0bdc2" + sha256: "10408c5ca242b7fc632dd5eab4caf8fdf18ebe88db6052980fa71a18d88bd200" url: "https://pub.dev" source: hosted - version: "4.5.40" + version: "4.5.41" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: a38e9ccdd5dc4d7dc9eef0097b6a5a3c24842772035e1be103dc1b81d8d09f7c + sha256: c7a756e3750679407948de665735e69a368cb902940466e5d68a00ea7aba1aaa url: "https://pub.dev" source: hosted - version: "3.8.10" + version: "3.8.11" fixnum: dependency: transitive description: @@ -620,10 +620,10 @@ packages: dependency: "direct main" description: name: flutter_webrtc - sha256: fd5f115a08dcdc00b988bea3003c956f1b60a78a61d899cbddfb44f5d0e44d4a + sha256: "3f115def06fb80df7c2e9f97b7d73c1b43a973211fc56df69638a663529f56c6" url: "https://pub.dev" source: hosted - version: "0.10.8" + version: "0.11.4" font_awesome_flutter: dependency: "direct main" description: @@ -660,26 +660,26 @@ packages: dependency: "direct main" description: name: go_router - sha256: cdae1b9c8bd7efadcef6112e81c903662ef2ce105cbd220a04bbb7c3425b5554 + sha256: "39dd52168d6c59984454183148dc3a5776960c61083adfc708cc79a7b3ce1ba8" url: "https://pub.dev" source: hosted - version: "14.2.0" + version: "14.2.1" graphs: dependency: transitive description: name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" http: dependency: transitive description: name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" http_multi_server: dependency: transitive description: @@ -716,10 +716,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "4161e1f843d8480d2e9025ee22411778c3c9eb7e40076dcf2da23d8242b7b51c" + sha256: cea2bd5b9fcff039a4901d3b13c67fe747f940be9ba76bde1bcd218d168eeb7f url: "https://pub.dev" source: hosted - version: "0.8.12+3" + version: "0.8.12+6" image_picker_for_web: dependency: transitive description: @@ -852,10 +852,10 @@ packages: dependency: "direct main" description: name: livekit_client - sha256: e4e301c26bbba522897254986ad339d6acb59752d7679ff243d4dbee66ca4b95 + sha256: "0c369b25e56910650184049cc713bb38a920cbe2e0d10db83fac400a3c393e2b" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" logging: dependency: transitive description: @@ -1340,18 +1340,18 @@ packages: dependency: transitive description: name: sentry - sha256: "7342ef4c18932881730ac941a07a6e4cf76fe99cd1ea3bef06e53a6a1402dec0" + sha256: cbc29cbdd8a047aab3df42f826daf07e58dfb2e1d550895d1021a6d4e618b00d url: "https://pub.dev" source: hosted - version: "8.3.0" + version: "8.4.0" sentry_flutter: dependency: "direct main" description: name: sentry_flutter - sha256: "475cf49682e4d1eb48caa2577502721bcfdcbb63f215de57b3b246d52f4f7914" + sha256: "96ce085e1be6c9963d93d42d6ba5c67484c076c59d25c94a7ba906549dc6c635" url: "https://pub.dev" source: hosted - version: "8.3.0" + version: "8.4.0" shelf: dependency: transitive description: @@ -1585,18 +1585,18 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: ceb2625f0c24ade6ef6778d1de0b2e44f2db71fded235eb52295247feba8c5cf + sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac" url: "https://pub.dev" source: hosted - version: "6.3.3" + version: "6.3.5" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "7068716403343f6ba4969b4173cbf3b84fc768042124bc2c011e5d782b24fe89" + sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.3.1" url_launcher_linux: dependency: transitive description: @@ -1641,10 +1641,10 @@ packages: dependency: "direct main" description: name: uuid - sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" + sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.4.2" vector_math: dependency: transitive description: @@ -1705,18 +1705,18 @@ packages: dependency: transitive description: name: web_socket - sha256: "24301d8c293ce6fe327ffe6f59d8fd8834735f0ec36e4fd383ec7ff8a64aa078" + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.1.6" web_socket_channel: dependency: "direct main" description: name: web_socket_channel - sha256: a2d56211ee4d35d9b344d9d4ce60f362e4f5d1aafb988302906bd732bc731276 + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" webrtc_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e240120..b73de8e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,7 +33,7 @@ dependencies: uuid: ^4.4.0 dropdown_button2: ^2.3.9 livekit_client: ^2.1.5 - flutter_webrtc: ^0.10.7 + flutter_webrtc: ^0.11.4 wakelock_plus: ^1.2.5 cached_network_image: ^3.3.1 sentry_flutter: ^8.2.0