fluttercommunity / fluttercommunity/plus_plugins

[Request]: Allow uri + text together in ShareParams (for iOS support)

Offen
#3,748 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement triage
Vorherrschende Sprache
Dart
Sterne
1.9k
Forks
1.3k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Plugin

share_plus

Use case
Current Behavior
await SharePlus.instance.share(
 ShareParams(
  text: 'Check this out!'
   uri: Uri.parse(
    'https://example.com/page/123'
  ),
),

Results in

Invalid argument(s): uri and text cannot be provided at the same time

I see this restriction was added in https://github.com/fluttercommunity/plus_plugins/pull/3404#discussion_r2048771496 as a deliberate design choice. The discussion mentions being open to revisiting based on feedback :)

Feature request

I want to share a URL with a custom pre-filled message. Such that if a user clicks "iMessage" the custom text will be appended underneath the rich link preview.

iOS supports this natively - you just pass both to UIActivityViewController:

  UIActivityViewController(activityItems: ["Check this out!", url], applicationActivities: nil)
Proposal

Remove the restriction so iOS and make the small native code change for iOS to work. I've tested it and it works with minimal changes.

For non-iOS functionality (e.g. Android Intent.EXTRA_TEXT only has one slot ), we could either:

  • Fall back to uri-only
  • Concatenate them
  • Document the platform difference

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Untersuchung der ShareParams-Validierung in share_plus und seiner plattformspezifischen Implementierungen. Verfolge anschließend, wie iOS Aktivitätselemente an UIActivityViewController übergibt. Bestätige, dass iOS sowohl text als auch uri akzeptiert, entscheide, wie nicht-iOS-Plattformen mit diesem Paar umgehen sollen, und aktualisiere Tests oder Dokumentation, um das abgeschlossene Plattformverhalten zu zeigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
dart, flutter, ios, swift
Bereich
mobile
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.