Apps Kit SDK logoApps Kit SDK
文档 · iOS 集成

1. 依赖项(Podfile)

1.1 为什么仍然需要 Podfile

AKSKit.xcframework/AppsKit.xcframework 以二进制框架的形式直接链接(§2),而不是通过 pod 集成。但 AppsKit.xcframework 中已编译的 Swift 模块会引用多个第三方 SDK(Firebase、Google Mobile Ads、IronSource、Adjust、AppsFlyer、AppLovin)的符号。即使你从不直接调用其中的大多数 SDK,也必须通过 CocoaPods 将它们纳入依赖图,否则构建时会链接失败。

1.2 必需的 pod(始终需要)

ruby
source 'https://cdn.cocoapods.org'

platform :ios, '15.0'

target 'YourApp' do
  use_frameworks!

  # Remote Config drives almost all AKS behavior; Analytics/Crashlytics back AKS events and crash reporting
  pod 'Firebase/Analytics',    '~> 12.15.0'
  pod 'Firebase/Crashlytics',  '~> 12.15.0'
  pod 'Firebase/RemoteConfig', '~> 12.15.0'

  pod 'Google-Mobile-Ads-SDK'

  # Required by AppsKit.xcframework's compiled swiftinterface — these are transitive
  # dependencies of the AKS facade itself, not direct calls you make.
  pod 'IronSourceSDK',         '~> 9.1.0.0'
  pod 'Adjust',                '~> 5.4.6'
  pod 'AppsFlyerFramework'
  pod 'AppsFlyer-AdRevenue'

  pod 'AppLovinSDK'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
      config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
    end
  end
end

上述版本来自一个已验证可正常运行的参考集成,其当前解析结果(Podfile.lock)为:Firebase/* 12.15.0、未锁定版本以跟进最新版的 Google-Mobile-Ads-SDK(会通过传递依赖引入 GoogleUserMessagingPlatform)、IronSourceSDK 9.1.0.0、Adjust 5.4.6、AppsFlyerFramework/AppsFlyer-AdRevenue 6.14.3、AppLovinSDK 13.5.0。请将这些版本视为已验证可用的基线,而非必须锁定的版本;你可以根据应用自身需求升级,但请将 IPHONEOS_DEPLOYMENT_TARGET 保持为 15.0 或更高,以匹配构建 AppsKit.xcframework/AKSKit.xcframework 时使用的部署目标版本。

post_install 中的 DEBUG_INFORMATION_FORMAT = 'dwarf-with-dsym' 并非可有可无的配置。缺少这一行时,部分 pod(尤其是 AppLovinSDK)不会生成 dSYM,导致崩溃日志无法符号化,还可能在上传时无法通过 App Store Connect 的 dSYM 验证。

1.3 MMP SDK

Solar Engine 不是需要你添加的 pod——它已经编译到 AKSKit.xcframework 中,因此你不会在 Podfile 中找到它,也无需添加。相比之下,AppsFlyer 和 Adjust 确实需要由接入方通过 pod 添加(见上文 §1.2),因为 AppsKit.xcframework 的 Swift 代码会直接调用它们的实际 SDK 方法(IOSBridgeImp.swift 中的 initializeAppsFlyer/initializeAdjust)。

1.4 广告平台 / 广告聚合 SDK

参考 Podfile 仅添加了 Google-Mobile-Ads-SDK、IronSourceSDK 和 AppLovinSDK,没有单独添加任何“AdMob 广告聚合适配器”pod。如果你的 AKS 门户配置启用了通过 AdMob 对上述列表之外的广告平台进行竞价/瀑布流聚合,请确认相应平台是否需要单独的 CocoaPods 适配器(例如 GoogleMobileAdsMediation* pod)。本指南仅涵盖已在参考应用中验证可用的配置。