fix(share_plus): remove deprecated UIApplication.keyWindow fallback on iOS - #3970
Open
ledexsoft wants to merge 1 commit into
Open
fix(share_plus): remove deprecated UIApplication.keyWindow fallback on iOS#3970ledexsoft wants to merge 1 commit into
ledexsoft wants to merge 1 commit into
Conversation
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a compile warning surfaced when building the iOS pod with Flutter 3.44.8 / Xcode 26 (iOS 26 SDK):
Cause
FPPSharePlusPlugin.mkeeps a legacy fallback branch that reads[UIApplication sharedApplication].keyWindowfor iOS < 13. That branch still compiles (and warns) because the CocoaPods podspec declaress.platform = :ios, '12.0', even though:ios/share_plus/Package.swift) already requires iOS 13.0 (raised in fix(share_plus): raise Apple platform minimums in SPM manifests to match FlutterFramework #3923 to matchFlutterFramework), andMinimumOSVersion13.0.Fix
@available(iOS 13, *)conditional and the deprecatedkeyWindowfallback, keeping only the iOS 13+ scene-based lookup (connectedScenes→UIWindowScene.windows→isKeyWindow), which is the code already used on iOS 13+.s.platform = :ios, '13.0'.This supersedes the earlier #1157, which introduced the scene-based lookup but had to keep the deprecated fallback because the podspec still targeted iOS 12.
Verification
clang -fsyntax-onlyagainst the iOS 26 simulator SDK (deployment target 13.0) passes with nokeyWindowreference remaining.Detected with Flutter 3.44.8 / Xcode 26 (iOS 26 SDK). Note: per plus_plugins convention, CHANGELOG/version bumps are handled by the maintainers' release flow, so this PR touches only the plugin sources.