diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index e7e31acfd968..063aa99d5d51 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.6.0 + +* Support Windows by default. + ## 5.5.3 * Suppress deprecation warning on the `shouldOverrideUrlLoading` method on Android. diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md index 53c7fe96cde7..811dcd5b4ea1 100644 --- a/packages/url_launcher/url_launcher/README.md +++ b/packages/url_launcher/url_launcher/README.md @@ -2,7 +2,8 @@ [![pub package](https://img.shields.io/pub/v/url_launcher.svg)](https://pub.dartlang.org/packages/url_launcher) -A Flutter plugin for launching a URL in the mobile platform. Supports iOS and Android. +A Flutter plugin for launching a URL in the mobile platform. Supports +iOS, Android, web, Windows, macOS, and Linux. ## Usage To use this plugin, add `url_launcher` as a [dependency in your pubspec.yaml file](https://flutter.dev/platform-plugins/). @@ -91,8 +92,8 @@ web page using a URL following the `http` scheme. ## Browser vs In-app Handling By default, Android opens up a browser when handling URLs. You can pass -`forceWebView: true` parameter to tell the plugin to open a WebView instead. -If you do this for a URL of a page containing JavaScript, make sure to pass in +`forceWebView: true` parameter to tell the plugin to open a WebView instead. +If you do this for a URL of a page containing JavaScript, make sure to pass in `enableJavaScript: true`, or else the launch method will not work properly. On iOS, the default behavior is to open all web URLs within the app. Everything else is redirected to the app handler. diff --git a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart index fe51d94aa3a9..9fb5eaa34b4c 100644 --- a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart +++ b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart @@ -19,7 +19,7 @@ void main() { expect(await canLaunch('http://flutter.dev'), true); // SMS handling is available by default on most platforms. - if (kIsWeb || !Platform.isLinux) { + if (kIsWeb || !(Platform.isLinux || Platform.isWindows)) { expect(await canLaunch('sms:5555555555'), true); } diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 57048a2b3f98..965a4318d0f8 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher -version: 5.5.3 +version: 5.6.0 flutter: plugin: @@ -18,6 +18,8 @@ flutter: default_package: url_laucher_linux macos: default_package: url_laucher_macos + windows: + default_package: url_laucher_windows dependencies: flutter: @@ -31,6 +33,7 @@ dependencies: url_launcher_web: ^0.1.3 url_launcher_linux: ^0.0.1 url_launcher_macos: ^0.0.1 + url_launcher_windows: ^0.0.1 dev_dependencies: flutter_test: diff --git a/packages/url_launcher/url_launcher_windows/CHANGELOG.md b/packages/url_launcher/url_launcher_windows/CHANGELOG.md index dd3395afab0a..7f534a7e5a38 100644 --- a/packages/url_launcher/url_launcher_windows/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+1 + +* Update README to reflect endorsement. + ## 0.0.1 * Initial Windows implementation of `url_launcher`. diff --git a/packages/url_launcher/url_launcher_windows/README.md b/packages/url_launcher/url_launcher_windows/README.md index 685adc59a1a4..fb5ad6700d26 100644 --- a/packages/url_launcher/url_launcher_windows/README.md +++ b/packages/url_launcher/url_launcher_windows/README.md @@ -13,9 +13,9 @@ For more details see: https://github.com/flutter/flutter/wiki/Package-migration- ### Import the package -This package has not yet been endorsed. Once it is you only need to add -`url_launcher` as a dependency in your `pubspec.yaml`, but for now you -need to include both `url_launcher` and `url_launcher_windows`. +This package has been endorsed, meaning that you only need to add `url_launcher` +as a dependency in your `pubspec.yaml`. It will be automatically included in your app +when you depend on `package:url_launcher`. This is what the above means to your `pubspec.yaml`: @@ -23,7 +23,17 @@ This is what the above means to your `pubspec.yaml`: ... dependencies: ... - url_launcher: ^5.5.3 + url_launcher: ^5.6.0 + ... +``` + +If you wish to use the Windows package only, you can add `url_launcher_windows` as a +dependency: + +```yaml +... +dependencies: + ... url_launcher_windows: ^0.0.1 ... ``` diff --git a/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec b/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec new file mode 100644 index 000000000000..1c700d49f4b5 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# Run `pod lib lint url_launcher_windows.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'url_launcher_windows' + s.version = '0.0.1' + s.summary = 'url_launcher_windows iOS stub' + s.description = <<-DESC + No-op implementation of the windows url_launcher plugin to avoid build issues on iOS + DESC + s.homepage = 'https://github.com/flutter/plugins' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_windows' } + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end diff --git a/packages/url_launcher/url_launcher_windows/pubspec.yaml b/packages/url_launcher/url_launcher_windows/pubspec.yaml index 8a0beb70163a..6a653b7f7665 100644 --- a/packages/url_launcher/url_launcher_windows/pubspec.yaml +++ b/packages/url_launcher/url_launcher_windows/pubspec.yaml @@ -3,7 +3,7 @@ description: Windows implementation of the url_launcher plugin. # 0.0.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.0.1 +version: 0.0.1+1 homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_windows flutter: