Skip to content

Commit ab9991e

Browse files
committed
Add Swift Package Manager support and bump version to 0.0.4
1 parent 49111cd commit ab9991e

File tree

10 files changed

+71
-10
lines changed

10 files changed

+71
-10
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.0.4] - 2026-01-27
9+
10+
### Added
11+
12+
- **Swift Package Manager (SPM) support**: Added `Package.swift` for iOS to support Swift Package Manager alongside CocoaPods
13+
- Full SPM compatibility while maintaining CocoaPods backward compatibility
14+
15+
### Changed
16+
17+
- Updated iOS plugin structure to support both CocoaPods and Swift Package Manager
18+
- Podspec updated to point to new SPM-compatible source file locations
19+
820
## [0.0.3] - 2026-01-27
921

1022
## [0.0.2] - 2026-01-27

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
2121

2222
```yaml
2323
dependencies:
24-
connectivity_validator: ^0.0.3
24+
connectivity_validator: ^0.0.4
2525
```
2626
2727
Then run:
@@ -56,6 +56,8 @@ The plugin uses `ConnectivityManager` with `NET_CAPABILITY_VALIDATED` and HTTPS
5656

5757
No additional setup required. The plugin uses `NWPathMonitor` with `.satisfied` status and HTTPS connectivity testing to detect validated connectivity.
5858

59+
**Note**: The plugin supports both CocoaPods and Swift Package Manager (SPM). Flutter will automatically use the appropriate dependency manager based on your project configuration.
60+
5961
## Basic Usage
6062

6163
The plugin provides a simple stream-based API:

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '13.0'
2+
platform :ios, '13.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PODS:
2-
- connectivity_validator (3):
2+
- connectivity_validator (0.0.3):
33
- Flutter
44
- Flutter (1.0.0)
5-
- integration_test (0.0.3):
5+
- integration_test (0.0.1):
66
- Flutter
77

88
DEPENDENCIES:
@@ -19,10 +19,10 @@ EXTERNAL SOURCES:
1919
:path: ".symlinks/plugins/integration_test/ios"
2020

2121
SPEC CHECKSUMS:
22-
connectivity_validator: e35fde120b7241d8d13f67f3780a5a39612de7b3
22+
connectivity_validator: bf4e7fc18738fca085f5a7adac35d8b556d333d6
2323
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
2424
integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e
2525

26-
PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e
26+
PODFILE CHECKSUM: 251cb053df7158f337c0712f2ab29f4e0fa474ce
2727

2828
COCOAPODS: 1.16.2

ios/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ Icon?
3636
/Flutter/Generated.xcconfig
3737
/Flutter/ephemeral/
3838
/Flutter/flutter_export_environment.sh
39+
40+
# Swift Package Manager
41+
.build/
42+
.swiftpm/

ios/connectivity_validator.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'connectivity_validator'
7-
s.version = '0.0.3'
7+
s.version = '0.0.4'
88
s.summary = 'A robust internet connectivity checker that validates actual network access using native Android (NET_CAPABILITY_VALIDATED) and iOS (NWPathMonitor) APIs.'
99
s.description = <<-DESC
1010
A robust internet connectivity checker that validates actual network access using native Android (NET_CAPABILITY_VALIDATED) and iOS (NWPathMonitor) APIs.
@@ -13,7 +13,7 @@ A robust internet connectivity checker that validates actual network access usin
1313
s.license = { :file => '../LICENSE' }
1414
s.author = { 'Sabeel KM' => 'sabeelmuttil@gmail.com' }
1515
s.source = { :path => '.' }
16-
s.source_files = 'Classes/**/*'
16+
s.source_files = 'connectivity_validator/Sources/connectivity_validator/**/*.swift'
1717
s.dependency 'Flutter'
1818
s.platform = :ios, '13.0'
1919

@@ -25,5 +25,5 @@ A robust internet connectivity checker that validates actual network access usin
2525
# required reason APIs, update the PrivacyInfo.xcprivacy file to describe your
2626
# plugin's privacy impact, and then uncomment this line. For more information,
2727
# see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
28-
# s.resource_bundles = {'connectivity_validator_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
28+
s.resource_bundles = {'connectivity_validator_privacy' => ['connectivity_validator/Sources/connectivity_validator/PrivacyInfo.xcprivacy']}
2929
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "connectivity_validator",
8+
platforms: [
9+
.iOS("13.0"),
10+
],
11+
products: [
12+
// If the plugin name contains "_", replace with "-" for the library name.
13+
.library(
14+
name: "connectivity-validator",
15+
targets: ["connectivity_validator"]
16+
),
17+
],
18+
dependencies: [],
19+
targets: [
20+
.target(
21+
name: "connectivity_validator",
22+
dependencies: [],
23+
resources: [
24+
// Privacy manifest file
25+
.process("PrivacyInfo.xcprivacy"),
26+
]
27+
),
28+
]
29+
)

ios/Classes/ConnectivityValidatorPlugin.swift renamed to ios/connectivity_validator/Sources/connectivity_validator/ConnectivityValidatorPlugin.swift

File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyTrackingDomains</key>
6+
<array/>
7+
<key>NSPrivacyAccessedAPITypes</key>
8+
<array/>
9+
<key>NSPrivacyCollectedDataTypes</key>
10+
<array/>
11+
<key>NSPrivacyTracking</key>
12+
<false/>
13+
</dict>
14+
</plist>

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: connectivity_validator
22
description: "A robust internet connectivity checker that validates actual network access using native Android (NET_CAPABILITY_VALIDATED) and iOS (NWPathMonitor) APIs."
3-
version: 0.0.3
3+
version: 0.0.4
44
homepage: https://github.com/sabeelmuttil/connectivity_validator
55
repository: https://github.com/sabeelmuttil/connectivity_validator
66

0 commit comments

Comments
 (0)