Skip to content

fix(share_plus): remove deprecated UIApplication.keyWindow fallback on iOS - #3970

Open
ledexsoft wants to merge 1 commit into
fluttercommunity:mainfrom
ledexsoft:fix/share_plus-remove-deprecated-keywindow
Open

fix(share_plus): remove deprecated UIApplication.keyWindow fallback on iOS#3970
ledexsoft wants to merge 1 commit into
fluttercommunity:mainfrom
ledexsoft:fix/share_plus-remove-deprecated-keywindow

Conversation

@ledexsoft

Copy link
Copy Markdown

Fixes a compile warning surfaced when building the iOS pod with Flutter 3.44.8 / Xcode 26 (iOS 26 SDK):

warning: 'keyWindow' is deprecated: first deprecated in iOS 13.0

Cause

FPPSharePlusPlugin.m keeps a legacy fallback branch that reads [UIApplication sharedApplication].keyWindow for iOS < 13. That branch still compiles (and warns) because the CocoaPods podspec declares s.platform = :ios, '12.0', even though:

Fix

  • Remove the @available(iOS 13, *) conditional and the deprecated keyWindow fallback, keeping only the iOS 13+ scene-based lookup (connectedScenesUIWindowScene.windowsisKeyWindow), which is the code already used on iOS 13+.
  • Align the CocoaPods deployment target with SwiftPM by raising the podspec to 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-only against the iOS 26 simulator SDK (deployment target 13.0) passes with no keyWindow reference remaining.
  • No behavior change on iOS 13+; the removed branch was only reachable on iOS 12, which is below the Flutter engine minimum.

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.

@ledexsoft ledexsoft changed the title [share_plus] Remove deprecated UIApplication.keyWindow fallback on iOS fix(share_plus): remove deprecated UIApplication.keyWindow fallback on iOS Sep 7, 2026
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