@@ -43,55 +43,47 @@ See the example app for more complex examples.
43
43
## Configuration
44
44
45
45
### iOS
46
- Add any URL schemes passed to ` canLaunchUrl ` as ` LSApplicationQueriesSchemes ` entries in your Info.plist file.
46
+ Add any URL schemes passed to ` canLaunchUrl ` as ` LSApplicationQueriesSchemes `
47
+ entries in your Info.plist file, otherwise it will return false.
47
48
48
49
Example:
49
50
``` xml
50
51
<key >LSApplicationQueriesSchemes</key >
51
52
<array >
52
- <string >https </string >
53
- <string >http </string >
53
+ <string >sms </string >
54
+ <string >tel </string >
54
55
</array >
55
56
```
56
57
57
58
See [ ` -[UIApplication canOpenURL:] ` ] ( https://developer.apple.com/documentation/uikit/uiapplication/1622952-canopenurl ) for more details.
58
59
59
60
### Android
60
61
61
- Starting from API 30 Android requires package visibility configuration in your
62
- ` AndroidManifest.xml ` otherwise ` canLaunchUrl ` will return ` false ` . A ` <queries> `
62
+ Add any URL schemes passed to ` canLaunchUrl ` as ` <queries> ` entries in your
63
+ ` AndroidManifest.xml ` , otherwise it will return false in most cases starting
64
+ on Android 11 (API 30) or higher. A ` <queries> `
63
65
element must be added to your manifest as a child of the root element.
64
66
65
- The snippet below shows an example for an application that uses ` https ` , ` tel ` ,
66
- and ` mailto ` URLs with ` url_launcher ` . See
67
- [ the Android documentation] ( https://developer.android.com/training/package-visibility/use-cases )
68
- for examples of other queries.
69
-
67
+ Example:
70
68
``` xml
71
69
<queries >
72
- <!-- If your app opens https URLs -->
70
+ <!-- If your app checks for SMS support -->
73
71
<intent >
74
72
<action android : name =" android.intent.action.VIEW" />
75
- <data android : scheme =" https " />
73
+ <data android : scheme =" sms " />
76
74
</intent >
77
- <!-- If your app makes calls -->
75
+ <!-- If your app checks for call support -->
78
76
<intent >
79
- <action android : name =" android.intent.action.DIAL " />
77
+ <action android : name =" android.intent.action.VIEW " />
80
78
<data android : scheme =" tel" />
81
79
</intent >
82
- <!-- If your sends SMS messages -->
83
- <intent >
84
- <action android : name =" android.intent.action.SENDTO" />
85
- <data android : scheme =" smsto" />
86
- </intent >
87
- <!-- If your app sends emails -->
88
- <intent >
89
- <action android : name =" android.intent.action.SEND" />
90
- <data android : mimeType =" */*" />
91
- </intent >
92
80
</queries >
93
81
```
94
82
83
+ See
84
+ [ the Android documentation] ( https://developer.android.com/training/package-visibility/use-cases )
85
+ for examples of other queries.
86
+
95
87
## Supported URL schemes
96
88
97
89
The provided URL is passed directly to the host platform for handling. The
0 commit comments