Conversation
There was a problem hiding this comment.
Pull request overview
Adds iOS “Communication Notifications” support artifacts so push notifications can display sender avatars on iOS 15+ by using a Notification Service Extension + INSendMessageIntent donation, and wires this into the notifications demo.
Changes:
- Adds a Notification Service Extension template (
NotificationService.swift+Info.plist) and documentation for enabling Communication Notifications on iOS. - Updates the notifications demo’s iOS project to include/embed the service extension and required capabilities (
NSUserActivityTypes, entitlements). - Tweaks the demo UI logic to request permission on launch and register for push when granted.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| ios/Extensions/CommunicationNotifications/NotificationService.swift | New iOS service extension implementation that donates INSendMessageIntent and loads an avatar image. |
| ios/Extensions/CommunicationNotifications/Info.plist | New extension Info.plist template for com.apple.usernotifications.service. |
| docs/communication-notifications.md | New step-by-step setup guide for Communication Notifications and required payload fields. |
| README.md | Links to the new iOS Communication Notifications guide. |
| examples/notifications-demo/src/routes/+page.svelte | Requests permission on startup and registers for push when granted. |
| examples/notifications-demo/src-tauri/tauri.conf.json | Updates demo identifier and contains a formatting change. |
| examples/notifications-demo/src-tauri/gen/apple/project.yml | Updates bundle ID prefix / bundle identifier used for the generated iOS project. |
| examples/notifications-demo/src-tauri/gen/apple/notifications-demo_iOS/notifications-demo_iOS.entitlements | Adds push + communication notifications entitlements. |
| examples/notifications-demo/src-tauri/gen/apple/notifications-demo_iOS/Info.plist | Adds NSUserActivityTypes entry for INSendMessageIntent. |
| examples/notifications-demo/src-tauri/gen/apple/notifications-demo.xcodeproj/project.pbxproj | Adds and embeds Notification Service Extension target; updates signing/build settings. |
| examples/notifications-demo/src-tauri/gen/apple/NotificationServiceExtension/NotificationService.swift | Demo’s service extension implementation (same as template). |
| examples/notifications-demo/src-tauri/gen/apple/NotificationServiceExtension/Info.plist | Demo’s extension Info.plist. |
| examples/notifications-demo/src-tauri/Cargo.lock | Bumps tauri-plugin-notifications dependency version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: notifications-demo | ||
| options: | ||
| bundleIdPrefix: com.tauri.dev | ||
| bundleIdPrefix: com.the-tie-bridge.app | ||
| deploymentTarget: | ||
| iOS: 14.0 |
There was a problem hiding this comment.
bundleIdPrefix is set to com.the-tie-bridge.app for the demo's generated Xcode project. A hard-coded, real-looking bundle ID prefix will prevent other developers from signing/building unless they own that App ID; consider using a placeholder or documenting that it must be changed locally.
| GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| GCC_WARN_UNUSED_FUNCTION = YES; | ||
| GCC_WARN_UNUSED_VARIABLE = YES; | ||
| GENERATE_INFOPLIST_FILE = YES; |
There was a problem hiding this comment.
The extension target has GENERATE_INFOPLIST_FILE = YES while also specifying INFOPLIST_FILE = NotificationServiceExtension/Info.plist. This can lead to the built Info.plist not containing the required NSExtension keys (depending on Xcode settings). Prefer using the checked-in Info.plist (disable generation) or move all required keys to build settings and remove the file reference.
| GENERATE_INFOPLIST_FILE = YES; | |
| GENERATE_INFOPLIST_FILE = NO; |
| CODE_SIGN_ENTITLEMENTS = "notifications-demo_iOS/notifications-demo_iOS.entitlements"; | ||
| CODE_SIGN_IDENTITY = "iPhone Developer"; | ||
| DEVELOPMENT_TEAM = L4HDDT92GH; | ||
| ENABLE_BITCODE = NO; |
There was a problem hiding this comment.
DEVELOPMENT_TEAM is hard-coded to a specific Team ID. This makes the example project difficult to build for other contributors/CI (they will get code signing errors). Prefer leaving it unset in committed config or sourcing it from user-local settings.
| CURRENT_PROJECT_VERSION = 1; | ||
| DEBUG_INFORMATION_FORMAT = dwarf; | ||
| DEVELOPMENT_TEAM = L4HDDT92GH; | ||
| ENABLE_STRICT_OBJC_MSGSEND = YES; |
There was a problem hiding this comment.
The extension target also hard-codes DEVELOPMENT_TEAM to a specific Team ID, which will break signing for anyone else building the demo. Prefer leaving this unset in repo-committed project files (or make it configurable).
| "productName": "notifications-demo", | ||
| "version": "0.1.0", | ||
| "identifier": "com.tauri.dev", | ||
| "identifier": "com.the-tie-bridge.app", | ||
| "build": { |
There was a problem hiding this comment.
The demo app identifier was changed to com.the-tie-bridge.app. A hard-coded, real-looking bundle identifier will prevent other developers from signing/building the example unless they own that App ID. Consider using a clearly placeholder identifier (or documenting that users must change it).
| import UserNotifications | ||
| import Intents | ||
|
|
There was a problem hiding this comment.
NotificationService uses URL, URLSession, and Data, but the file does not import Foundation (and may also require Dispatch for DispatchSemaphore). This will fail to compile in targets that don't re-export these symbols; add the appropriate imports explicitly.
| @@ -0,0 +1,98 @@ | |||
| import UserNotifications | |||
| import Intents | |||
There was a problem hiding this comment.
NotificationService uses URL, URLSession, and Data, but the file does not import Foundation (and may also require Dispatch for DispatchSemaphore). Add the appropriate imports explicitly to avoid build failures.
| import Intents | |
| import Intents | |
| import Foundation | |
| import Dispatch |
| <key>aps-environment</key> | ||
| <string>development</string> | ||
| <key>com.apple.developer.usernotifications.communication</key> | ||
| <true/> |
There was a problem hiding this comment.
aps-environment is set to development in the entitlements file. This will fail signing for distribution/TestFlight builds (which require production). Consider using separate entitlements per configuration or setting this up via Xcode signing so debug uses development and release uses production.
| app: | ||
| base: | ||
| PRODUCT_NAME: notifications-demo | ||
| PRODUCT_BUNDLE_IDENTIFIER: com.tauri.dev | ||
| PRODUCT_BUNDLE_IDENTIFIER: com.the-tie-bridge.app | ||
| targetTemplates: |
There was a problem hiding this comment.
PRODUCT_BUNDLE_IDENTIFIER is set to com.the-tie-bridge.app for the demo app. For a repo-shipped example, consider using a placeholder identifier (or making it configurable) so contributors can build without owning that App ID.
| A98D55AEB23591E6E9FC9AA8 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2952782657A3C85626BB111 /* Security.framework */; }; | ||
| ADB9C9906C96E51419A6BF5C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9F871F3497F27E63C315CD27 /* LaunchScreen.storyboard */; }; | ||
| B3E42E9CC0FA1CC67193FF88 /* libapp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 53360DEB65E4CEAF5FE9BE5E /* libapp.a */; }; | ||
| C4CC44A32F34E0B000D3EBC4 /* NotificationServiceExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = C4CC449C2F34E0B000D3EBC4 /* NotificationServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; |
There was a problem hiding this comment.
The embedded .appex build file only has RemoveHeadersOnCopy in its copy attributes. For app extensions, the embed phase typically needs CodeSignOnCopy as well; without it the extension may not be properly signed when copied into the app bundle, causing install/runtime failures.
| C4CC44A32F34E0B000D3EBC4 /* NotificationServiceExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = C4CC449C2F34E0B000D3EBC4 /* NotificationServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; | |
| C4CC44A32F34E0B000D3EBC4 /* NotificationServiceExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = C4CC449C2F34E0B000D3EBC4 /* NotificationServiceExtension.appex */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #99 +/- ##
=========================================
Coverage 57.90% 57.90%
Complexity 65 65
=========================================
Files 29 29
Lines 5096 5096
Branches 232 232
=========================================
Hits 2951 2951
Misses 2111 2111
Partials 34 34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.