feat: add push notification subscription TrUAPI methods#187
Draft
pgherveou wants to merge 2 commits into
Draft
Conversation
Adds five new TrUAPI methods exposing the v2 push backend's rule-management endpoints: push_add_rules, push_remove_rules, push_list_rules, push_set_rules, plus the interim push_broadcast direct submit path. Rules are (signer, topic) pairs grouped per publisher; add/set require the Notifications device permission, remove/list/broadcast do not. The host attests the broadcast signer, so the product cannot supply it. Also extends makeDevicePermissionGatedRequestSlot with an optional makePermissionDeniedError so callers whose error enum has a PermissionDenied variant can return the correct error when permission is denied vs when the host has not implemented the method.
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.
Summary
Exposes the v2 push backend's rule-management endpoints to products as TrUAPI:
push_add_rules,push_remove_rules,push_list_rules,push_set_rules, andthe interim
push_broadcastdirect submit. Rules are(signer, topic)pairs;add/setrequire theNotificationsdevice permission,remove/list/broadcastdo not. The host attests the broadcast signer.Spec: Push Notification Subscriptions RFC (notification-subscriptions repo, docs/rfcs/push-notification-subscriptions.md).
Changes
Follow-up (separate PRs in each host repo)
Each host (polkadot-app-ios-v2, polkadot-app-android-v2) needs to wire container.handlePushAddRules / RemoveRules / ListRules / SetRules / Broadcast in its product-container/src/index.ts and add the matching native bridge methods.
Authored with assistance from Claude Code.