Repository navigation
Show who wrote, where, and the first line in a push, on iPhone (GRYT-1688) - #316
Merged
Merged
Conversation
…1688) Pushes said "Gryt · New message". With this and the server half, an iPhone shows "Alice", "#general · Gryt" and the first line. Only this phone can read it. - The phone makes a random 32-byte key for each server, with its push capability, and sends it as `previewKey` in `push:register`. A new capability gets a new key. Forgetting a server deletes its key. - The keys, by the relay's tag for each server, go into the app group's defaults through a small native module (`modules/push-preview`), because the extension can't reach the app's own storage. - A new Notification Service Extension, `GrytNotify` (`targets/notify`, `plugins/withNotificationExtension.js`), opens the sealed preview with CryptoKit and swaps in the title, subtitle and body. If anything doesn't open (no key, wrong key, an old server), it leaves the relay's fixed text, so the worst case is what it was before. Apple side, already done: the App ID `chat.gryt.app.notify` is registered with App Groups and `group.chat.gryt.app`. CI makes its profile on the next build (the dry run lists it as "would create"), and the entitlement check from mobile#313 stops the upload if the extension comes out without its group. The server half is in Gryt-chat/server and the relay half in Gryt-chat/push (linked below). Android keeps the fixed text for now (GRYT-1698). Tested: - The extension's actual Swift, compiled with a small harness, opens a blob sealed by the server code and returns "Alice | #general · Gryt | build is green 🎉". A wrong key, no key or another server's tag return nothing, so the fixed text stays. - `expo prebuild` generates the target with its plist and entitlements, and the target builds for the simulator on its own. - tsc is clean and the notify tests pass. Not tested: a real push to a phone. That needs this build on TestFlight and the server on beta. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pushes said "Gryt · New message". With this and the server half, an iPhone shows "Alice", "#general · Gryt" and the first line. Only this phone can read it.
previewKeyinpush:register. A new capability gets a new key. Forgetting a server deletes its key.modules/push-preview), because the extension can't reach the app's own storage.GrytNotify(targets/notify,plugins/withNotificationExtension.js), opens the sealed preview with CryptoKit and swaps in the title, subtitle and body. If anything doesn't open (no key, wrong key, an old server), it leaves the relay's fixed text, so the worst case is what it was before.Apple side, already done: the App ID
chat.gryt.app.notifyis registered with App Groups andgroup.chat.gryt.app. CI makes its profile on the next build (the dry run lists it as "would create"), and the entitlement check from #313 stops the upload if the extension comes out without its group.The server half is Gryt-chat/server#286 and the relay half is Gryt-chat/push#3. Android keeps the fixed text for now (GRYT-1698).
Tested:
expo prebuildgenerates the target with its plist and entitlements, and the target builds for the simulator on its own.Not tested: a real push to a phone. That needs this build on TestFlight and the server on beta.
🤖 Generated with Claude Code