diff --git a/analytics/Podfile b/analytics/Podfile index bc052afde..704c43b98 100644 --- a/analytics/Podfile +++ b/analytics/Podfile @@ -38,3 +38,20 @@ target 'AnalyticsExampleTV' do # Pods for testing end end + +post_install do |installer| + installer.pods_project.targets.each do |target| + if target.name == "Pods-AnalyticsExample" + puts "Updating #{target.name} to include GoogleAdsOnDeviceConversion for iPhone only" + target.build_configurations.each do |config| + xcconfig_path = config.base_configuration_reference.real_path + xcconfig = File.read(xcconfig_path) + xcconfig =~ /OTHER_LDFLAGS = (.+)/ + other_ld_flags = "#{$1}" + xcconfig.sub!('-framework "GoogleAdsOnDeviceConversion"', '') + new_xcconfig = xcconfig + "OTHER_LDFLAGS[sdk=iphone*] = #{other_ld_flags}" + File.open(xcconfig_path, "w") { |file| file << new_xcconfig } + end + end + end +end diff --git a/analytics/Podfile.lock b/analytics/Podfile.lock index 26811e720..f3eebcbaf 100644 --- a/analytics/Podfile.lock +++ b/analytics/Podfile.lock @@ -114,6 +114,6 @@ SPEC CHECKSUMS: nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 -PODFILE CHECKSUM: 226b4d62d9972e44620a8caea7219e8f54926256 +PODFILE CHECKSUM: 6097b0ced448df423a1a885a6de5c1c6b63e4559 COCOAPODS: 1.16.2