Browse Source

修改iOS配置

weicu
tanlongsheng 1 year ago
parent
commit
e6c7642ae1
  1. 50
      ios/Podfile
  2. 4
      pubspec.yaml

50
ios/Podfile

@ -1,7 +1,8 @@
# Uncomment this line to define a global platform for your project
# Define a global platform for your project
platform :ios, '16.0'
$FirebaseSDKVersion = '11.13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -28,6 +29,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
@ -40,5 +42,49 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
# Ensure all pods use the same iOS deployment target
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=1',
## dart: PermissionGroup.notification
'PERMISSION_NOTIFICATIONS=1',
## dart: PermissionGroup.calendar
'PERMISSION_EVENTS=1',
## dart: PermissionGroup.calendarFullAccess
'PERMISSION_EVENTS_FULL_ACCESS=1',
'PERMISSION_LOCATION=1',
'PERMISSION_LOCATION_WHENINUSE=0',
## dart: PermissionGroup.bluetooth
'PERMISSION_BLUETOOTH=1',
]
# 禁用用户跟踪相关功能
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'FBSDK_DISABLE_IDFA=1'
# 移除可能的用户跟踪权限描述
if target.name == 'Runner'
# 确保不包含NSUserTrackingUsageDescription
config.build_settings.delete('NSUserTrackingUsageDescription')
end
end
# 针对Facebook SDK禁用广告ID收集
if target.name.start_with?('FBSDKCoreKit') || target.name.start_with?('FacebookSDK')
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'FBSDK_DISABLE_IDFA=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'FBSDK_DISABLE_AUTO_LOG_APP_EVENTS=1'
end
end
end
end
end

4
pubspec.yaml

@ -62,8 +62,8 @@ dependencies:
app_settings: 5.2.0
fluwx: ^5.7.1
url_launcher: ^6.3.1
firebase_core: ^3.12.1
firebase_auth: ^5.5.1
firebase_core: ^4.0.0
firebase_auth: ^6.0.1
google_sign_in: ^6.2.2
flutter_facebook_auth: ^7.1.1
sign_in_with_apple: ^7.0.1

Loading…
Cancel
Save