Skip to content

fix(spm): Lower iOS deployment target to v13 in Package.swift#69

Open
waitwalker wants to merge 2 commits into
prongbang:masterfrom
waitwalker:master
Open

fix(spm): Lower iOS deployment target to v13 in Package.swift#69
waitwalker wants to merge 2 commits into
prongbang:masterfrom
waitwalker:master

Conversation

@waitwalker

Copy link
Copy Markdown

Description

This PR lowers the minimum iOS platform version in ios/screen_protector/Package.swift from .v15 to .v13.

Why is this needed?

  • Avoid build failures: The current .v15 restriction causes dependency resolution failures (version mismatch) when integrating this plugin into Flutter apps targeting iOS 13.0 or 14.0 via Swift Package Manager.
  • No iOS 15+ API dependencies: The plugin's native implementation (ScreenProtectorPlugin.swift) does not use any iOS 15+ exclusive APIs. In fact, it already contains backward-compatible checks like #available(iOS 13.0, *) and #available(iOS 11.0, *).
  • Underlying support: The native ScreenProtectorKit library itself specifies iOS 12.0 as its minimum version.
  • Setting the SPM platform target to .v13 provides a much better out-of-the-box experience for the majority of Flutter apps using SPM.

- Lower the iOS platform deployment target in `ios/screen_protector/Package.swift` from `.v15` to `.v12`.
- Align the Swift Package Manager (SPM) platform configuration with the existing CocoaPods `.podspec` deployment target, which is already set to `s.ios.deployment_target = '12.0'`.
- The plugin's Swift implementation (`ScreenProtectorPlugin.swift`) already contains backward-compatible checks such as `#available(iOS 13.0, *)` and `#available(iOS 11.0, *)`, meaning it is fully capable of running on older iOS versions and has no strict dependency on iOS 15 APIs.
- The underlying dependency `ScreenProtectorKit` also specifies `.iOS(.v12)` in its package manifest.
- This change prevents build failures due to version mismatch when integrating this plugin into Flutter apps targeting iOS versions below 15.0 using SPM.
- Lower the iOS platform deployment target in `ios/screen_protector/Package.swift` from `.v15` to `.v13`.
- Align the Swift Package Manager (SPM) platform configuration with the existing CocoaPods `.podspec` deployment target, which is already set to `s.ios.deployment_target = '12.0'`.
- The plugin's Swift implementation (`ScreenProtectorPlugin.swift`) already contains backward-compatible checks such as `#available(iOS 13.0, *)` and `#available(iOS 11.0, *)`, meaning it is fully capable of running on older iOS versions and has no strict dependency on iOS 15 APIs.
- The underlying dependency `ScreenProtectorKit` also specifies `.iOS(.v13)` in its package manifest.
- This change prevents build failures due to version mismatch when integrating this plugin into Flutter apps targeting iOS versions below 15.0 using SPM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant