diff --git a/packages/device_info_plus/device_info_plus/example/ios/Podfile b/packages/device_info_plus/device_info_plus/example/ios/Podfile new file mode 100644 index 0000000000..fcd7841841 --- /dev/null +++ b/packages/device_info_plus/device_info_plus/example/ios/Podfile @@ -0,0 +1,39 @@ +platform :ios, '15.0' + +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end \ No newline at end of file diff --git a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj index e52dbe9053..d4c1006027 100644 --- a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj @@ -451,7 +451,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -469,7 +469,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -579,7 +579,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -628,7 +628,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -648,7 +648,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -671,7 +671,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/packages/device_info_plus/device_info_plus/example/macos/Podfile b/packages/device_info_plus/device_info_plus/example/macos/Podfile new file mode 100644 index 0000000000..d630eaf548 --- /dev/null +++ b/packages/device_info_plus/device_info_plus/example/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '15.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter/ephemeral and run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end \ No newline at end of file diff --git a/packages/device_info_plus/device_info_plus/ios/device_info_plus.podspec b/packages/device_info_plus/device_info_plus/ios/device_info_plus.podspec index 6038dd2988..af9c4c44d5 100644 --- a/packages/device_info_plus/device_info_plus/ios/device_info_plus.podspec +++ b/packages/device_info_plus/device_info_plus/ios/device_info_plus.podspec @@ -17,7 +17,7 @@ Downloaded by pub (not CocoaPods). s.source_files = 'device_info_plus/Sources/device_info_plus/**/*.{h,m}' 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' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.resource_bundles = {'device_info_plus_privacy' => ['device_info_plus/Sources/device_info_plus/PrivacyInfo.xcprivacy']} end diff --git a/packages/device_info_plus/device_info_plus/ios/device_info_plus/Sources/device_info_plus/FPPDeviceInfoPlusPlugin.m b/packages/device_info_plus/device_info_plus/ios/device_info_plus/Sources/device_info_plus/FPPDeviceInfoPlusPlugin.m index 83a9a00e75..7dad780768 100644 --- a/packages/device_info_plus/device_info_plus/ios/device_info_plus/Sources/device_info_plus/FPPDeviceInfoPlusPlugin.m +++ b/packages/device_info_plus/device_info_plus/ios/device_info_plus/Sources/device_info_plus/FPPDeviceInfoPlusPlugin.m @@ -31,8 +31,16 @@ - (void)handleMethodCall:(FlutterMethodCall *)call isiOSAppOnMac = [NSNumber numberWithBool:[info isiOSAppOnMac]]; } NSNumber *isiOSAppOnVision = [NSNumber numberWithBool:NO]; - if (@available(iOS 26.1, *)) { - isiOSAppOnVision = [NSNumber numberWithBool:[info isiOSAppOnVision]]; + if (@available(iOS 15.0, *)) { + if (@available(iOS 26.1, *)) { + SEL isiOSAppOnVisionSelector = NSSelectorFromString(@"isiOSAppOnVision"); + if ([info respondsToSelector:isiOSAppOnVisionSelector]) { + BOOL (*isiOSAppOnVisionIMP)(id, SEL) = + (BOOL (*)(id, SEL))[info methodForSelector:isiOSAppOnVisionSelector]; + isiOSAppOnVision = + [NSNumber numberWithBool:isiOSAppOnVisionIMP(info, isiOSAppOnVisionSelector)]; + } + } } NSError *error = nil; NSDictionary *fsAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error];