diff --git a/.github/bash_scripts/podfile_creation.sh b/.github/bash_scripts/podfile_creation.sh index 6731370..a75e978 100644 --- a/.github/bash_scripts/podfile_creation.sh +++ b/.github/bash_scripts/podfile_creation.sh @@ -1,6 +1,5 @@ #!/bin/bash -echo "# Uncomment the next line to define a global platform for your project -# platform :ios, '9.0' +echo "platform :ios, '12.0' target 'segment-appsflyer-ios' do # Comment the next line if you don't want to use dynamic frameworks @@ -19,5 +18,36 @@ target 'SegmentAppsFlyeriOSTests' do # Pods for SegmentAppsFlyeriOSTests pod 'OCMock' +end + +# Post-install hook to ensure Swift framework compatibility +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' + end + end + + # Configure main project for Swift framework compatibility + installer.aggregate_targets.each do |aggregate_target| + aggregate_target.user_project.native_targets.each do |target| + target.build_configurations.each do |config| + if target.name == 'segment-appsflyer-ios' + # Make missing Swift compatibility libraries non-fatal + # These are backward compatibility shims removed in Xcode 16+ + config.build_settings['OTHER_LDFLAGS'] ||= ['\$(inherited)'] + # Use -weak-l prefix to make these libraries optional + config.build_settings['OTHER_LDFLAGS'] << '-Wl,-weak-lswiftCompatibility56' + config.build_settings['OTHER_LDFLAGS'] << '-Wl,-weak-lswiftCompatibilityConcurrency' + config.build_settings['OTHER_LDFLAGS'] << '-Wl,-weak-lswiftCompatibilityPacks' + # Suppress linker warnings + config.build_settings['OTHER_LDFLAGS'] << '-Wl,-w' + end + if target.name == 'SegmentAppsFlyeriOSTests' + config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES' + end + end + end + end end" > Podfile diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index 7f31d39..71b1f96 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -12,10 +12,27 @@ jobs: - uses: actions/checkout@v2 - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '16.4' - name: create Podfile run: bash .github/bash_scripts/podfile_creation.sh - name: CocoaPod Install run: pod install + - name: Detect Available iOS Simulator + id: detect-simulator + run: | + echo "Listing available iOS Simulators..." + xcrun simctl list devices available iOS + + # Find the first available and booted/bootable iPhone simulator + SIMULATOR_ID=$(xcrun simctl list devices available iOS | grep -m 1 "iPhone" | grep -oE '\([A-Z0-9-]+\)' | tr -d '()') + + if [ -n "$SIMULATOR_ID" ]; then + echo "Using simulator ID: $SIMULATOR_ID" + echo "destination=platform=iOS Simulator,id=$SIMULATOR_ID" >> $GITHUB_OUTPUT + else + # Fallback to generic iOS Simulator (uses default for the Xcode version) + echo "No specific iPhone found, using generic iOS Simulator" + echo "destination=generic/platform=iOS Simulator" >> $GITHUB_OUTPUT + fi - name: Test - run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' | xcpretty && exit ${PIPESTATUS[0]} + run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination '${{ steps.detect-simulator.outputs.destination }}' | xcpretty && exit ${PIPESTATUS[0]} diff --git a/Package.resolved b/Package.resolved index 88f6aba..aa94445 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", "state": { "branch": null, - "revision": "7a3cd712a77b30e487e53102b101c5e9ff96a95e", - "version": "6.9.1" + "revision": "6cc9a9400a9d15e26d1ccf83ed9924c1dfbe8b75", + "version": "6.17.8" } } ] diff --git a/Package.swift b/Package.swift index 57e4197..e4807d1 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. .package(name: "Segment", url: "https://github.com/segmentio/analytics-ios.git" , from: "4.0.0"), - .package(name: "AppsFlyerLib" , url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", .exact("6.17.7")), + .package(name: "AppsFlyerLib" , url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", .exact("6.17.8")), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. diff --git a/README.md b/README.md index 450dffc..b5f57ff 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # AppsFlyer integration for Segment. -## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v6.17.7. +## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v6.17.8. [![Version](https://img.shields.io/badge/cocoapods-compatible-brightgreen?logo=cocoapods&logoColor=green&style=flat)](http://cocoapods.org/pods/segment-appsflyer-ios) [![Carthage compatible](https://img.shields.io/badge/Carthage-not_compatible-C20000.svg?style=flat)](https://github.com/Carthage/Carthage) @@ -49,12 +49,12 @@ To install the segment-appsflyer-ios integration: **Production** version: ```ruby -pod 'segment-appsflyer-ios', '6.17.7' +pod 'segment-appsflyer-ios', '6.17.8' ``` **Strict mode SDK** version: ```ruby -pod 'segment-appsflyer-ios/Strict', '6.17.7' +pod 'segment-appsflyer-ios/Strict', '6.17.8' ``` Use the strict mode SDK to completely remove IDFA collection functionality and AdSupport framework dependencies (for example, when developing apps for kids). diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 9cd5ad4..46e9c90 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,3 +1,8 @@ +### 6.17.8 +* Updated AppsFlyer iOS SDK to 6.17.8 +* Refactored plugin version to use a single internal constant for improved maintainability +* Improved CI workflow with dynamic iOS simulator detection for enhanced compatibility + ### 6.17.7 * Update to Appsflyer SDK 6.17.7. diff --git a/examples/ObjcPodsSample/Podfile b/examples/ObjcPodsSample/Podfile index 1bab624..2f6333a 100644 --- a/examples/ObjcPodsSample/Podfile +++ b/examples/ObjcPodsSample/Podfile @@ -6,5 +6,5 @@ target 'ObjcPodsSample' do use_frameworks! # Pods for ObjcPodsSample - pod 'segment-appsflyer-ios','6.17.7' + pod 'segment-appsflyer-ios','6.17.8' end diff --git a/examples/SwiftPodsSample/Podfile b/examples/SwiftPodsSample/Podfile index afa8770..6f82a57 100644 --- a/examples/SwiftPodsSample/Podfile +++ b/examples/SwiftPodsSample/Podfile @@ -6,6 +6,6 @@ target 'SwiftPodsSample' do use_frameworks! # Pods for SwiftPodsSample - pod 'segment-appsflyer-ios', '6.17.7' + pod 'segment-appsflyer-ios', '6.17.8' end diff --git a/segment-appsflyer-ios.podspec b/segment-appsflyer-ios.podspec index 1bf62ed..f9e6939 100644 --- a/segment-appsflyer-ios.podspec +++ b/segment-appsflyer-ios.podspec @@ -1,5 +1,5 @@ -version_appsflyerLib = '6.17.7' -version_plugin = '6.17.7' +version_appsflyerLib = '6.17.8' +version_plugin = '6.17.8' Pod::Spec.new do |s| s.name = "segment-appsflyer-ios" diff --git a/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.m b/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.m index 98d982d..41153b9 100644 --- a/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.m +++ b/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.m @@ -9,8 +9,9 @@ #import "SEGAppsFlyerIntegration.h" #import "SEGAppsFlyerIntegrationFactory.h" -@implementation SEGAppsFlyerIntegration +static NSString *const kSEGAFPluginVersion = @"6.17.8"; +@implementation SEGAppsFlyerIntegration - (instancetype)initWithSettings:(NSDictionary *)settings withAnalytics:(SEGAnalytics *)analytics { if (self = [super init]) { @@ -35,7 +36,7 @@ - (instancetype)initWithSettings:(NSDictionary *)settings withAnalytics:(SEGAnal self.appsflyer = [self appsflyerLib]; [self.appsflyer setPluginInfoWith:AFSDKPluginSegment - pluginVersion:@"6.17.7" + pluginVersion:kSEGAFPluginVersion additionalParams:nil]; [self.appsflyer setAppsFlyerDevKey:afDevKey]; [self.appsflyer setAppleAppID:appleAppId]; @@ -93,7 +94,7 @@ - (instancetype)initWithSettings:(NSDictionary *)settings withAppsflyer:(AppsFly self.appsflyer = aAppsflyer; [self.appsflyer setPluginInfoWith:AFSDKPluginSegment - pluginVersion:@"6.17.7" + pluginVersion:kSEGAFPluginVersion additionalParams:nil]; NSString *afDevKey = [self.settings objectForKey:@"appsFlyerDevKey"];