Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/url_launcher/url_launcher_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.3.0

* Adds Swift Package Manager compatibility.

## 6.2.5

* Adds explicit imports for UIKit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ A Flutter plugin for making the underlying platform (Android or iOS) launch a UR
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_ios' }
s.documentation_url = 'https://pub.dev/packages/url_launcher'
s.swift_version = '5.0'
s.source_files = 'Classes/**/*.swift'
s.source_files = 'url_launcher_ios/Sources/**/*.swift'
s.xcconfig = {
'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift',
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',
}
s.dependency 'Flutter'
s.platform = :ios, '12.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.resource_bundles = {'url_launcher_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
s.resource_bundles = {'url_launcher_ios_privacy' => ['url_launcher_ios/Sources/url_launcher_ios/Resources/PrivacyInfo.xcprivacy']}
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import PackageDescription

let package = Package(
name: "url_launcher_ios",
platforms: [
.iOS("12.0")
],
products: [
.library(name: "url-launcher-ios", targets: ["url_launcher_ios"])
],
dependencies: [],
targets: [
.target(
name: "url_launcher_ios",
dependencies: [],
resources: [
.process("Resources")
]
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:pigeon/pigeon.dart';

@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
swiftOut: 'ios/Classes/messages.g.swift',
swiftOut: 'ios/url_launcher_ios/Sources/url_launcher_ios/messages.g.swift',
copyrightHeader: 'pigeons/copyright.txt',
))

Expand Down
2 changes: 1 addition & 1 deletion packages/url_launcher/url_launcher_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: url_launcher_ios
description: iOS implementation of the url_launcher plugin.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 6.2.5
version: 6.3.0

environment:
sdk: ^3.2.3
Expand Down
3 changes: 2 additions & 1 deletion packages/url_launcher/url_launcher_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 3.2.0

* Adds Swift Package Manager compatibility.
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.

## 3.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import XCTest

@testable import url_launcher_macos

// Tests whether NSURL parsing is strict. When linking against the macOS 14 SDK or later,
// NSURL uses a more lenient parser which will not return nil.
private func urlParsingIsStrict() -> Bool {
return URL(string: "b a d U R L") == nil
}

/// A stub to simulate the system Url handler.
class StubWorkspace: SystemURLHandler {

Expand Down Expand Up @@ -43,7 +49,11 @@ class RunnerTests: XCTestCase {
let plugin = UrlLauncherPlugin()

let result = try plugin.canLaunch(url: "invalid url")
XCTAssertEqual(result.error, .invalidUrl)
if urlParsingIsStrict() {
XCTAssertEqual(result.error, .invalidUrl)
} else {
XCTAssertFalse(result.value)
}
}

func testLaunchSuccessReturnsTrue() throws {
Expand All @@ -69,6 +79,10 @@ class RunnerTests: XCTestCase {
let plugin = UrlLauncherPlugin()

let result = try plugin.launch(url: "invalid url")
XCTAssertEqual(result.error, .invalidUrl)
if urlParsingIsStrict() {
XCTAssertEqual(result.error, .invalidUrl)
} else {
XCTAssertFalse(result.value)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ Pod::Spec.new do |s|
s.license = { :type => 'BSD', :file => '../LICENSE' }
s.author = { 'Flutter Team' => '[email protected]' }
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos' }
s.source_files = 'Classes/**/*'
s.source_files = 'url_launcher_macos/Sources/url_launcher_macos/**/*.swift'
s.dependency 'FlutterMacOS'

s.platform = :osx, '10.14'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting: Add back end of line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My editor automatically removes blank lines at the end of the file; I don't think we should keep them.

(This isn't a file without an EOL; my editor fixes those automatically too. And GitHub would show a warning marker in the diff.)

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import PackageDescription

let package = Package(
name: "url_launcher_macos",
platforms: [
.macOS("10.14")
],
products: [
.library(name: "url-launcher-macos", targets: ["url_launcher_macos"])
],
dependencies: [],
targets: [
.target(
name: "url_launcher_macos",
dependencies: [],
resources: [
.process("Resources")
]
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import 'package:pigeon/pigeon.dart';

@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
swiftOut: 'macos/Classes/messages.g.swift',
swiftOut:
'macos/url_launcher_macos/Sources/url_launcher_macos/messages.g.swift',
copyrightHeader: 'pigeons/copyright.txt',
))

Expand Down
2 changes: 1 addition & 1 deletion packages/url_launcher/url_launcher_macos/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: url_launcher_macos
description: macOS implementation of the url_launcher plugin.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 3.1.0
version: 3.2.0

environment:
sdk: ^3.1.0
Expand Down