platform :ios, '15.0'
use_frameworks!

target 'UMessage_Demo' do
  # UMPush 及全部依赖均通过 CocoaPods 引入（不再保留本地 UMPush.xcframework）
  pod 'UMPush', '4.1.4'
  pod 'UMCommon'
  pod 'UMDevice'
end

# UMPushService_Demo（Notification Service Extension）不使用任何 pod，
# 仅依赖本地 libUMessageNotificationExtensionService.a，故不在 Podfile 中集成。

post_install do |installer|
  # UMCommon / UMDevice / UMPush 的 podspec 里 IPHONEOS_DEPLOYMENT_TARGET 仍为 9.0，
  # 低于当前 Xcode 支持的最低版本（15.0），构建时会报错。
  # 这里统一把 pod target 的部署版本抬到与 platform 一致的 15.0。
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      deployment_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
      if deployment_target.nil? || deployment_target.to_f < 15.0
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
      end
    end
  end
end
