Skip to content

Commit 0097256

Browse files
[url_launcher] Remove incorrect SMS instructions (#7807)
Removes incorrect instructions for SMS that were added in flutter/plugins#6042. These instructions would double-encode the body, causing issues. This removes, rather than fixes, the instructions because the `sms:` scheme isn't particularly well defined, and has inconsistent handling across platforms (see flutter/flutter#18823 and flutter/flutter#156281 for some examples), so no simple instructions will work everywhere. Handling that kind of platform difference is out of scope for this package and its instructions. Fixes flutter/flutter#156281
1 parent 5cda4c6 commit 0097256

File tree

4 files changed

+3
-33
lines changed

4 files changed

+3
-33
lines changed

packages/url_launcher/url_launcher/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 6.3.1
22

3+
* Removes incorrect SMS instructions from README.
34
* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
45

56
## 6.3.0

packages/url_launcher/url_launcher/README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,6 @@ String? encodeQueryParameters(Map<String, String> params) {
170170
launchUrl(emailLaunchUri);
171171
```
172172

173-
Encoding for `sms` is slightly different:
174-
175-
<?code-excerpt "lib/encoding.dart (sms)"?>
176-
```dart
177-
final Uri smsLaunchUri = Uri(
178-
scheme: 'sms',
179-
path: '0118 999 881 999 119 7253',
180-
queryParameters: <String, String>{
181-
'body': Uri.encodeComponent('Example Subject & Symbols are allowed!'),
182-
},
183-
);
184-
```
185-
186173
### URLs not handled by `Uri`
187174

188175
In rare cases, you may need to launch a URL that the host system considers

packages/url_launcher/url_launcher/example/lib/encoding.dart

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ void main() => runApp(
3131
onPressed: _composeMail,
3232
child: Text('Compose an email'),
3333
),
34-
ElevatedButton(
35-
onPressed: _composeSms,
36-
child: Text('Compose a SMS'),
37-
),
3834
],
3935
),
4036
),
@@ -54,17 +50,3 @@ void _composeMail() {
5450
launchUrl(emailLaunchUri);
5551
// #enddocregion encode-query-parameters
5652
}
57-
58-
void _composeSms() {
59-
// #docregion sms
60-
final Uri smsLaunchUri = Uri(
61-
scheme: 'sms',
62-
path: '0118 999 881 999 119 7253',
63-
queryParameters: <String, String>{
64-
'body': Uri.encodeComponent('Example Subject & Symbols are allowed!'),
65-
},
66-
);
67-
// #enddocregion sms
68-
69-
launchUrl(smsLaunchUri);
70-
}

packages/url_launcher/url_launcher/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for launching a URL. Supports
33
web, phone, SMS, and email schemes.
44
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
6-
version: 6.3.0
6+
version: 6.3.1
77

88
environment:
99
sdk: ^3.3.0

0 commit comments

Comments
 (0)