Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address PR comments and issues.
  • Loading branch information
ditman committed Jul 12, 2022
commit 2bf3dc6d6b8719a4747e5f35e259c51a59c840bd
14 changes: 5 additions & 9 deletions packages/url_launcher/url_launcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,20 @@ element must be added to your manifest as a child of the root element.

Example:

<?code-excerpt "../../android/app/src/main/AndroidManifest.xml (android-queries)"?>
<?code-excerpt "../../android/app/src/main/AndroidManifest.xml (android-queries)" plaster="none"?>
``` xml
<!-- Provide required visibility configuration for API level 30 and above -->
<queries>
<!-- If your app checks for SMS support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
<data android:scheme="sms" />
</intent>
<!-- If your app checks for call support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent>
<!-- If your app checks for SMS support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="sms" />
</intent>
</queries>
```

Expand Down Expand Up @@ -201,8 +197,8 @@ Example:
final String filePath = testFile.absolute.path;
final Uri uri = Uri.file(filePath);

if (!File(uri.toFilePath()).existsSync() || !await canLaunchUrl(uri)) {
throw "$uri does not exist, or there's no handler registered for it!";
if (!File(uri.toFilePath()).existsSync()) {
throw '$uri does not exist!';
}
if (!await launchUrl(uri)) {
throw 'Could not launch $uri';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@
<!--#docregion android-queries-->
<!-- Provide required visibility configuration for API level 30 and above -->
<queries>
<!-- If your app checks for SMS support -->
<intent>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth adding a comment saying this is only here for integration tests, and shouldn't be needed in most actual apps, so it doesn't confuse anyone else in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed; I've added a comment to the https scheme bit of the XML, in addition to excluding it from the relevant docregion.

<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
<data android:scheme="sms" />
</intent>
<!-- If your app checks for call support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent>
<!-- If your app checks for SMS support -->
<!--#enddocregion android-queries-->
<!-- The "https" scheme is only required for integration tests of this package.
It shouldn't be needed in most actual apps, or show up in the README! -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="sms" />
<data android:scheme="https" />
</intent>
<!--#docregion android-queries-->
</queries>
<!--#enddocregion android-queries-->

Expand Down
4 changes: 2 additions & 2 deletions packages/url_launcher/url_launcher/example/lib/files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Future<void> _openFile() async {
final String filePath = testFile.absolute.path;
final Uri uri = Uri.file(filePath);

if (!File(uri.toFilePath()).existsSync() || !await canLaunchUrl(uri)) {
throw "$uri does not exist, or there's no handler registered for it!";
if (!File(uri.toFilePath()).existsSync()) {
throw '$uri does not exist!';
}
if (!await launchUrl(uri)) {
throw 'Could not launch $uri';
Expand Down
2 changes: 1 addition & 1 deletion packages/url_launcher/url_launcher/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
path: ^1.8.2
path: ^1.8.1
url_launcher:
# When depending on this package from a real application you should use:
# url_launcher: ^x.y.z
Expand Down