Skip to content

fix(device_info_plus): update iOS/macOS deployment targets to 15.0 and fix isiOSAppOnVision detection#3812

Closed
Melsaeed276 wants to merge 6 commits intofluttercommunity:mainfrom
Melsaeed276:main
Closed

fix(device_info_plus): update iOS/macOS deployment targets to 15.0 and fix isiOSAppOnVision detection#3812
Melsaeed276 wants to merge 6 commits intofluttercommunity:mainfrom
Melsaeed276:main

Conversation

@Melsaeed276
Copy link
Copy Markdown

@Melsaeed276 Melsaeed276 commented Apr 28, 2026

Description

This PR updates the minimum deployment targets and improves the isiOSAppOnVision detection:

  • iOS: Updated minimum deployment target from 12.0 to 15.0
  • macOS: Updated minimum deployment target from 10.14 to 15.0
  • iOS App on Vision detection: Changed from compile-time @available(iOS 26.1, *) to runtime detection using @available(iOS 15.0, *) + @available(iOS 26.1, *) + respondsToSelector:. This ensures the isiOSAppOnVision property is correctly detected at runtime without causing compile-time warnings on older SDKs.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

Copilot AI review requested due to automatic review settings April 28, 2026 13:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates device_info_plus Apple platform minimum deployment targets and adjusts the iOS implementation to detect isiOSAppOnVision more defensively at runtime.

Changes:

  • Raise iOS minimum deployment target to 15.0 (podspec + example Xcode project).
  • Raise macOS minimum deployment target to 15.0 (macOS podspec).
  • Update isiOSAppOnVision lookup to add runtime gating via @available + respondsToSelector:.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
packages/device_info_plus/device_info_plus/macos/device_info_plus.podspec Bumps macOS deployment target to 15.0.
packages/device_info_plus/device_info_plus/ios/device_info_plus/Sources/device_info_plus/FPPDeviceInfoPlusPlugin.m Adds runtime checks around isiOSAppOnVision access.
packages/device_info_plus/device_info_plus/ios/device_info_plus.podspec Bumps iOS deployment target to 15.0.
packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj Updates the example app’s iOS deployment target to 15.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +38
if (@available(iOS 15.0, *)) {
if (@available(iOS 26.1, *)) {
if ([info respondsToSelector:@selector(isiOSAppOnVision)]) {
isiOSAppOnVision = [NSNumber numberWithBool:[info isiOSAppOnVision]];
}
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the podspec now sets the minimum iOS deployment target to 15.0, the outer @available(iOS 15.0, *) check is redundant (all supported runtimes satisfy it) and adds unnecessary nesting. Consider removing the iOS 15 availability guard and keeping only the version/selector checks that can actually vary at runtime.

Suggested change
if (@available(iOS 15.0, *)) {
if (@available(iOS 26.1, *)) {
if ([info respondsToSelector:@selector(isiOSAppOnVision)]) {
isiOSAppOnVision = [NSNumber numberWithBool:[info isiOSAppOnVision]];
}
if (@available(iOS 26.1, *)) {
if ([info respondsToSelector:@selector(isiOSAppOnVision)]) {
isiOSAppOnVision = [NSNumber numberWithBool:[info isiOSAppOnVision]];

Copilot uses AI. Check for mistakes.
s.public_header_files = 'device_info_plus/Sources/device_info_plus/include/**/*.h'
s.dependency 'Flutter'
s.platform = :ios, '12.0'
s.platform = :ios, '15.0'
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raising the minimum iOS/macOS deployment targets is a breaking change for plugin consumers, but the PR title doesn’t include the Conventional Commits breaking-change marker (!) and the PR description’s breaking-change checklist is contradictory (both Yes and No checked). Please align the PR metadata (title/description) with the actual breaking nature of this change.

Copilot uses AI. Check for mistakes.
Mohamed Elsaeed and others added 5 commits April 28, 2026 16:28
@vbuberen
Copy link
Copy Markdown
Collaborator

This change makes no sense and not useful.

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.

3 participants