Repository navigation
Show sealed previews on Android, opened by the app itself - #322
Merged
Merged
Conversation
The relay sends data-only messages to phones that register with opens, and a background task opens the preview and shows the notification, falling back to the fixed text (GRYT-1698). Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Android notifications show who wrote, where, and the first line, the same as on iPhone (GRYT-1698).
How. The relay (push#4) sends a phone that registered with
opens: truedata-only messages. Android doesn't show those by itself. It wakes the app, which builds the notification:index.tsloadssrc/notify/androidPushTask.tsbefore the router. It defines a task forexpo-notifications'registerTaskAsync, and Android runs it for a data-only push with the app in the foreground, the background or closed.openPreview, and shows a local notification: who wrote as the title, where as the subtext, the line as the body, and the tag in its data so a tap opens the right server. If it can't open the preview, it shows the relay's fixed text instead.openPreviewreads the same format as the iPhone extension (AES-256-GCM,gryt-push-1|<tag>as additional data), using@noble/ciphers. Its test seals the way the server does.Registration. Android now registers with
opens: true. A capability made before this was registered without it, so the phone swaps it once (opensin the push state). That also means a new preview key, which the server picks up on the nextpush:register.New dependencies:
expo-task-manager~57.0.21 (a native module, so this needs a new build) and@noble/ciphers^2.4.0.Tested on the Android emulator (Pixel 7, API 36) against the live relay with push#4 deployed, a local server and the web client:
opens = 1.Look at:
SplashScreenManagernot found) before the task can run, so test that case with a release build.expo-task-managerisrequired inside a try, on Android only, so an iPhone or an old dev client without the native module doesn't crash on start.🤖 Generated with Claude Code