NativeScript / firebase

Modular Firebase 🔥 implementation for NativeScript. Supports both iOS & Android platforms for all Firebase services.
https://docs.nativescript.org/plugins/firebase-core.html
Apache License 2.0
52 stars 46 forks source link

Cannot disable Ad ID support with `$NSFirebaseAnalyticsWithoutAdIdSupport=true` #256

Open meeshkabob opened 2 months ago

meeshkabob commented 2 months ago

Following the instructions to Disable Ad Id usage on iOS, I placed line $NSFirebaseAnalyticsWithoutAdIdSupport = true at the top of my App_Resources/iOS/Podfile.

However, when I then clean and build the project, I see this logged, which indicates that Ad ID support was not disabled:

Installing pods...
Using default Firebase/Analytics with Ad Ids. May require App Tracking Transparency. Not allowed for Kids apps.
You may set variable `$NSFirebaseAnalyticsWithoutAdIdSupport=true` in Podfile to use analytics without ad ids.

When I look in the generated platforms/ios/Podfile, I see that my project podfile with the $NSFirebaseAnalyticsWithoutAdIdSupport = true line appears last, after the firebase-analytics section of the podfile. Therefore, the check if defined?($NSFirebaseAnalyticsWithoutAdIdSupport) does not find my variable. Ad ID support is always included.

Is there something that I should be doing differently? 🙏


System Info

"@nativescript/firebase-analytics": "^3.2.4",
"@nativescript/firebase-core": "^3.2.4",
"@nativescript/firebase-crashlytics": "^3.2.4",
"@nativescript/core": "^8.7.2",
"@nativescript/ios": "~8.7.1",

ns cli 8.7.0 cocoapods 1.15.2 Xcode 15.0.0


My project's App_Resources/iOS/Podfile

$NSFirebaseAnalyticsWithoutAdIdSupport = true

post_install do |pi|
  pi.pods_project.targets.each do |t|
    t.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'

      if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
        xcconfig_path = config.base_configuration_reference.real_path
        IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
      end
    end
  end
end

build.output.txt