diff --git a/CHANGELOG.md b/CHANGELOG.md index 944fa51..ba57a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Versions +## Unreleased + +- iOS: Add Swift Package Manager (SPM) support for the Core integration alongside CocoaPods. Resolves the "plugin does not support Swift Package Manager" warning under Flutter 3.44+. The optional PurchaseConnector subspec remains CocoaPods-only for now (blocked by flutter/flutter#161182). Relates to #364 / #370. + ## 6.18.0 - Updated Android SDK from 6.17.6 to 6.18.0 diff --git a/ios/.gitignore b/ios/.gitignore index 62364b2..7581b6a 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -35,5 +35,7 @@ Icon? /Flutter/Generated.xcconfig +# Swift Package Manager .build/ .swiftpm/ +Package.resolved diff --git a/ios/appsflyer_sdk.podspec b/ios/appsflyer_sdk.podspec index 3c35e2f..ecb464c 100644 --- a/ios/appsflyer_sdk.podspec +++ b/ios/appsflyer_sdk.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |s| s.subspec 'Core' do |ss| ss.source_files = 'appsflyer_sdk/Sources/appsflyer_sdk/**/*.{h,m}' - ss.public_header_files = 'appsflyer_sdk/Sources/appsflyer_sdk/include/appsflyer_sdk/*.h' + ss.public_header_files = 'appsflyer_sdk/Sources/appsflyer_sdk/include/**/*.h' ss.dependency 'Flutter' ss.ios.dependency 'AppsFlyerFramework','6.18.1' end diff --git a/ios/appsflyer_sdk/Package.swift b/ios/appsflyer_sdk/Package.swift index 69faf72..fdc3b6d 100644 --- a/ios/appsflyer_sdk/Package.swift +++ b/ios/appsflyer_sdk/Package.swift @@ -1,21 +1,38 @@ -// swift-tools-version:5.9 +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + import PackageDescription +// This manifest provides Swift Package Manager support for the AppsFlyer "Core" +// integration (the default subspec). The optional PurchaseConnector subspec is +// intentionally NOT included here — it remains CocoaPods-only for now because of +// the open Flutter limitation tracked in flutter/flutter#161182. Apps that use +// PurchaseConnector continue to opt in via the $AppsFlyerPurchaseConnector Podfile +// flag and CocoaPods; everyone else gets SPM support and loses the warning. + let package = Package( name: "appsflyer_sdk", - platforms: [.iOS("12.0")], + platforms: [ + .iOS(.v12) + ], products: [ - .library(name: "appsflyer-sdk", targets: ["appsflyer_sdk"]) + .library(name: "appsflyer_sdk", targets: ["appsflyer_sdk"]) ], dependencies: [ - .package(url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", .exact("6.18.0")) + // Static variant matches the podspec's `static_framework = true`. + // Product "AppsFlyerLib-Static" wraps the binary target "AppsFlyerLib", + // so the existing `#import ` keeps resolving. + .package(url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework-Static.git", exact: "6.18.0") ], targets: [ .target( name: "appsflyer_sdk", dependencies: [ - .product(name: "AppsFlyerLib", package: "AppsFlyerFramework") + .product(name: "AppsFlyerLib-Static", package: "AppsFlyerFramework-Static") ], + // Implementation (.m) files in Sources/appsflyer_sdk/, public headers (.h) + // in Sources/appsflyer_sdk/include/appsflyer_sdk/. The header search path + // lets the .m/.h files resolve their siblings by bare name. cSettings: [ .headerSearchPath("include/appsflyer_sdk") ]