From eefe43f202c889f4bb21303873953a3563ff9251 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 12 Sep 2020 11:21:03 -0700 Subject: [PATCH 1/5] Add stub podspec --- .../ios/url_launcher_windows.podspec | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec 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..cfd6bfb5914f --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec @@ -0,0 +1,20 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# +Pod::Spec.new do |s| + s.name = 'url_launcher_windows' + s.version = '0.0.1' + s.summary = 'No-op implementation of the windows url_launcher plugin to avoid build issues on iOS' + 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/tree/master/packages/url_launcher/url_launcher_windows' + s.license = { :file => '../LICENSE' } + s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + + s.ios.deployment_target = '8.0' +end From a94617076ca8de8972005004f083ee4262141c66 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 12 Sep 2020 11:23:51 -0700 Subject: [PATCH 2/5] Add the endorsement --- packages/url_launcher/url_launcher/CHANGELOG.md | 4 ++++ packages/url_launcher/url_launcher/README.md | 7 ++++--- packages/url_launcher/url_launcher/pubspec.yaml | 5 ++++- 3 files changed, 12 insertions(+), 4 deletions(-) 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/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: From ac60d753f422edc93f9587c2eef3d3d1577db16d Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 12 Sep 2020 11:26:01 -0700 Subject: [PATCH 3/5] Update url_launcher_windows README for endorsement --- .../url_launcher_windows/CHANGELOG.md | 4 ++++ .../url_launcher_windows/README.md | 18 ++++++++++++++---- .../url_launcher_windows/pubspec.yaml | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) 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/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: From f52cb35c7506251df67458f75de38f8031d7956c Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 12 Sep 2020 11:57:56 -0700 Subject: [PATCH 4/5] Copy a more recent podspec to address linter issues --- .../ios/url_launcher_windows.podspec | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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 index cfd6bfb5914f..1c700d49f4b5 100644 --- a/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec +++ b/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec @@ -1,20 +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 = 'No-op implementation of the windows url_launcher plugin to avoid build issues on iOS' + 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/tree/master/packages/url_launcher/url_launcher_windows' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' + 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' - s.ios.deployment_target = '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 From 688c786c720cac6ac10c70c8bc3f970572a9e518 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 12 Sep 2020 16:21:28 -0700 Subject: [PATCH 5/5] Fix test for Windows --- .../url_launcher/example/test_driver/url_launcher_e2e.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }