All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Remove privacy manifest from
Package.swift
andConnectivity.podspec
which doesn’t appear to be needed given that the framework doesn’t access any of the resources described in https://developer.apple.com/documentation/bundleresources/describing-use-of-required-reason-api.
- Updated build settings for Xcode 16.
- Added Privacy Manifest to Swift package.
- Bumped platform targets in
Package.swift
from iOS/tvOS 9 -> 12 and macOS 10_10 -> 10_13.- Also updated in
Connectivity.podspec
.
- Also updated in
- Added the
connectivityURLs
property back as this was a breaking change see issue #78.
Connectivity
propertyconnectivityURLs: [URL]
swapped toconnectivityURLRequests: [URLRequest]
. The framework now usesURLRequest
primarily throughout. Suggestion by @brunomiguens - #67.URLRequest
objects used for connectivity checks may not be configured via configuration initialiser or via the fluent configuration API e.g.-
URL
objects may still be used rather thanURLRequesd
objects via the fluent configuration API only e.g.-
- Changed the default framework used to monitor network interface changes to
.network
. To continue using the System Configuration (Apple's Reachability) framework for monitoring network interface changes set theframework
property to.systemConfiguration
. - Fixed a typo in
ConnectivityConfiguration
.validationMode
was incorrectly spelt asvalidatioMode
.
- Added ability to set the authorization header to be used when contacting an endpoint (thanks to Nils Bergmann - see #73).
- iOS deployment target updated to iOS 11.0 (dropped support for iOS 9.0 and 10.0 in-line with Xcode 14).
- macOS deployment target updated to macOS 10.13.
- Fixed being unable to set
bearerToken
,framework
andvalidationMode
using the configuration object (thanks to Nils Bergmann - see #73).
Applied Carthage fix - see: #66 and #65.
A Connectivity publisher now accepts a configuration object which can be used to configure the framework.
let publisher = Connectivity.Publisher(
configuration:
.init()
.configureURLSession(.default)
)
- Fluent configuration API: Connectivity may now be configured by passing a
ConnectivityConfiguration
object to the initializer.
- Internal
DispatchQueue
used by the framework now uses.default
QOS rather than.background
.
- Updated to Xcode 13.3.1 and resolved warnings.
- Support for determining connection state of Ethernet connections.
- Support compilation under Xcode 12.5.1.
- OHHTTPStubs 8.0.0 -> 9.1.0 for testing
- Updated documentation in README.md
- Headers search path added to Package.swift with thanks to @larryonoff
- Support for Xcode 12.
- Dropped support for iOS 8
- Support for macOS.
- Fixes Swift Package Manager integration.
- Added
checkWhenApplicationDidBecomeActive
flag which when enabled will check connectivity status when an app returns from the background. - Added
pollWhileOfflineOnly
flag which ensures that Connectivity only polls after recording an unsuccessful connection result. Following a successful result polling will cease.
- The entirety of the logic that was previously in
checkConnectivity
is now offloaded tointernalQueue
immediately. - Where polling, it was possible for a successful connection check to not be able to report the network interface used (as Reachability returned
NotReachable
) where using the.systemConfiguration
framework option. In this instance, Connectivity now usesNWPathMonitor
as a fallback on iOS 12+ even where.systemConfiguration
is the selected option.
Connectivity.Publisher
introduced providing support for Combine in iOS 13.0.
- Lowered the default connectivity threshold to 50% as it was recently reported that in certain parts of the world the recently added iOS 13 connectivity URL is inaccessible causing an offline result to be returned with the previous default threshold of 75% and only the two example connectivity URLs used. See issue #41.
- Added iOS 13 URL to default connectivity URLs.
- Made
ConnectivityStatus
enum Objective-C compatible.
- Made
ConnectivityFramework
enum Objective-C compatible.
-
Added new validators including:
ConnectivityResponseStringEqualityValidator
: Determines whether the response string is equal to an expected string.ConnectivityResponseContainsStringValidator
: Determines whether the response string contains an expected string.ConnectivityResponseRegExValidator
: Determines whether the response string matches a given regular expression.
These validators can be composed when creating a custom validator conforming to ConnectivityResponseValidator
protocol.
- Property
validationMode
on the Connectivity object may now take a value of.custom
allowing an implementation ofConnectivityResponseValidator
protocol to be supplied to theresponseValidator
property. This custom validator will be used to validate the response returned when accessing the connectivity URLs.
- Updated podspec to include
Network.framework
as part of theweak_frameworks
entry rather than as part offrameworks
.
- Fixed missing framework dependencies in podspec, see Issue #24.
- Properties
availableInterfaces
andcurrentInterface
indicate the network interfaces used in the most recent connectivity check. - New
Connectivity.Status
case.determining
will be returned prior to a connectivity check having completed.
- Refactor of
status
property which is now set on most recent connectivity check rather than computed on read.
- Ensure reading from and writing to the
path
property occurs in a thread-safe manner.
- Removed superfluous
canImport
around properties usingNetwork
framework.
- Support for Swift Package Manager where using Xcode 11.0 beta.
- Makes Connectivity a
NSObject
subclass for compatibility with Objective-C.
- Now targets Swift 5.0 instead of Swift 4.2.
- Made the
Connectivity.Percentage
initializerpublic
.
- Added the ability to specify a bearer token for authorization by setting the
bearerToken
property.
- Added the ability to determine the method used to validate the response returned by a connectivity endpoint.
- Added support for tvOS.
- Makes
pollingInterval
publicly accessible.
- Use
Timer.scheduledTimer(timeInterval:target:selector:userInfo:repeats:)
rather thanTimer.scheduledTimer(withTimeInterval:repeats:block:)
making polling available prior to iOS 10.
- Enabled
Allow app extension API only
in target deployment info.
- Provided the ability to switch between Reachability and the Network framework (from iOS 12 onwards) using the new
framework
property on theConnectivity
object.
- Makes a
checkConnectivity
call required to reliably query connectivity state for one-off checks (see the example app). - Properties referring to
WWAN
have been renamed toCellular
e.g.isConnectedViaWWAN
->isConnectedViaCellular
.
- Refactored code into smaller reusable functions to eliminate code duplication and improve maintainability.
- Allows the polling interval to be configured.
- Exposes the
ConnectivityDidChange
notification name as part of the public interface.
- Enforces SSL by default.
- Updated for Xcode 10 and Swift 4.2.
- Fixed an issue whereby the callback could be invoked more frequently than necessary if using the polling option.
- Adds a sample application to demonstrate how to use Connectivity.
- Improvements to code structure and an early exit mechanism such that once the required number of successful connectivity checks has been met any pending checks will be cancelled as they will no longer affect the result.
-
This release introduces support for Swift 4 and integration using the Carthage dependency manager. In order to integrate Connectivity into your project via Carthage, add the following line to your project's Cartfile:
github "rwbutler/Connectivity"
- Connectivity is a framework which improves on Reachability by allowing developers to detect whether true Internet connectivity is available or whether a captive portal is blocking Internet traffic.