Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit e9f52d5

Browse files
committed
Document why canLaunch can return false on Android API 30
1 parent 26bf10f commit e9f52d5

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

packages/url_launcher/url_launcher/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 5.6.1
2+
3+
* Add API documentation explaining the [canLaunch] method returns `false` if package visibility (Android API 30) is not managed correctly.
4+
15
## 5.6.0
26

37
* Support Windows by default.

packages/url_launcher/url_launcher/lib/url_launcher.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ Future<bool> launch(
109109

110110
/// Checks whether the specified URL can be handled by some app installed on the
111111
/// device.
112+
///
113+
/// On Android (from API 30), [canLaunch] will return `false` when the required
114+
/// visibility configuration is not provided in the AndroidManifest.xml file.
115+
/// For more information see the [Managing package visibility](https://developer.android.com/training/basics/intents/package-visibility)
116+
/// article in the Android docs.
112117
Future<bool> canLaunch(String urlString) async {
113118
if (urlString == null) {
114119
return false;

packages/url_launcher/url_launcher/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: url_launcher
22
description: Flutter plugin for launching a URL on Android and iOS. Supports
33
web, phone, SMS, and email schemes.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher
5-
version: 5.6.0
5+
version: 5.6.1
66

77
flutter:
88
plugin:

0 commit comments

Comments
 (0)