Hello all,
I have an itms-service URI that I need to launch in an external browser. I am using version 6.1.14 of url_launcher to do this and launching the URI as a string. I know the URI is valid because I can open it in the device browser and it works as intended. I also wrote my own MethodChannel to rule out OS problems and it works fine using shared.open.
Any ideas what might be going on?
I can’t provide example code but we literally just call launchUrlString with the URI.
Maybe this will have some tips for you?
opened 08:20PM - 17 Nov 22 UTC
closed 11:11PM - 17 Nov 22 UTC
Hello everyone! Hope someone has gone thru the same issue and can help me here:
…
I’m trying open a URL with the scheme **itms-service** using a **AWS link** with _manifest.plist_ link using `url_launcher` library but I’m getting an error:
Note: This is only iOS app
```
-canOpenURL: failed for URL: "itms-services://?action=download-manifest&url=https://app.com/build/manifest.plist" - error: "Invalid input URL"
```
- I’ve tried encoding the url string but nothing seems to work: Uri(path: Uri.encodeFull(url));
- I've also tried adding itms-service as a UrlScheme. (but honestly this should be a default scheme for iOS)
The point of it is to be able to force update the app if it is on a lower version, this is currently only under an Enterprise certificate and not in the AppStore
## Steps to Reproduce
```dart
final uri = Uri(path: 'itms-services://?action=download-manifest&url=https://app.com/build/manifest.plist');
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
throw 'Could not launch $url';
}
```
**Expected results:**
Being able to open the link and download the app
**Actual results:**
Logs</summary>
```
-canOpenURL: failed for URL: "itms-services://?action=download-manifest&url=https://aws-link.com/build/manifest.plist" - error: "Invalid input URL"
```
***Flutter Analyze***
```
Analyzing opus_playlist_notifier...
No issues found! (ran in 15.5s)
```
***Flutter Doctor***
```
fvm flutter doctor -v
[✓] Flutter (Channel stable, 3.3.2, on macOS 12.6 21G115 darwin-arm, locale en-CR)
• Flutter version 3.3.2 on channel stable at /Users/keylinwu/fvm/versions/3.3.2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e3c29ec00c (9 weeks ago), 2022-09-14 08:46:55 -0500
• Engine revision a4ff2c53d8
• Dart version 2.18.1
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/keylinwu/Library/Android/sdk
• Platform android-33, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode 14.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.63.2)
• VS Code at /Users/keylinwu/Downloads/Visual Studio Code.app/Contents
• Flutter extension version 3.36.0
[✓] Connected device (3 available)
• Keylin’s iPhone (mobile) • 00008110-001E4D293E86801E • ios • iOS 16.1.1 20B101
• macOS (desktop) • macos • darwin-arm64 • macOS 12.6 21G115 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.110
! Error: Keylin’s Apple Watch needs to connect to determine its availability. Check the connection between the device and its companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to be restarted and unlocked. (code 1)
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
```