fluttercommunity / fluttercommunity/plus_plugins

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

Open
#3,748 0 comments 0 reactions 0 assignees View on GitHub
enhancement triage
Dominant language
Dart
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

### Plugin

share_plus

### Use case

### Current Behavior
```dart
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`:

```swift
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.