Skip to content

Feature request: official @perryts/app-group for cross-process shared storage #675

@proggeramlug

Description

@proggeramlug

Feature request: official @perryts/app-group for cross-process shared storage

Widget extensions, share extensions, watchOS targets, and the main app all need a way to share data with the host app. iOS does this through App Groups — a file-system + UserDefaults sandbox shared between targets that share an application-groups entitlement. Android has the same problem with MODE_MULTI_PROCESS SharedPreferences or content providers.

There's no official Perry binding for this yet, so apps roll a local fork (e.g. our perry-searchbird-shared).

Surface we'd expect

// @perryts/app-group — TS surface
export declare function js_app_group_set(key: string, value: string): void;
export declare function js_app_group_get(key: string): string;          // "" if absent
export declare function js_app_group_delete(key: string): void;
export declare function js_app_group_write_blob(path: string, data: string): void;  // path relative to group root
export declare function js_app_group_read_blob(path: string): string;

Configuration:

[ios]
app_group = "group.io.example.app"   # must match entitlement

[android]
shared_prefs_name = "io.example.app.shared"

Notes:

  • iOS / macOS: UserDefaults(suiteName: <appGroup>) for kv, FileManager.default.containerURL(forSecurityApplicationGroupIdentifier:) for blobs.
  • Android: scoped SharedPreferences keyed by shared_prefs_name.
  • Linux/Windows: stub to a per-user XDG path ($XDG_DATA_HOME/<bundle_id>/shared/).
  • Entitlement plumbing: Perry's signing pipeline already merges entitlements from perry.toml; application-groups should drop in cleanly.

Why this matters

Without this, the only official way to wire a Perry app to a Perry-built widget is to hand-write a Rust+Swift bridge per project. That's a steep onboarding cliff and creates a forest of subtly-different forks across the ecosystem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions