invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.53k stars 2.19k forks source link

"google_analytics_automatic_screen_reporting_enabled": false not working on iOS #6261

Closed fdobre closed 2 years ago

fdobre commented 2 years ago

Setting "google_analytics_automatic_screen_reporting_enabled": false seems to work fine on Android but on iOS automatic screen view logs are still being sent:

firebase.json

{
  "react-native": {
    "crashlytics_disable_auto_disabler": true,
    "analytics_auto_collection_enabled": false,
    "google_analytics_automatic_screen_reporting_enabled": false
  }
}

package.json

"dependencies": {
    "@react-native-community/async-storage": "1.12.1",
    "@react-native-community/checkbox": "^0.5.5",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^6.1.2",
    "@react-native-community/masked-view": "^0.1.5",
    "@react-native-community/netinfo": "^8.2.0",
    "@react-native-firebase/analytics": "^14.7.0",
    "@react-native-firebase/app": "^14.7.0",
    "@react-native-firebase/crashlytics": "^14.7.0",
    "@react-native-firebase/dynamic-links": "^14.7.0",
    "@react-native-firebase/perf": "^14.7.0",
    "@react-native-picker/picker": "^2.3.0",
    "@react-navigation/bottom-tabs": "^5.10.6",
    "@react-navigation/material-top-tabs": "^5.3.15",
    "@react-navigation/native": "^5.8.6",
    "@react-navigation/routers": "^5.6.0",
    "@react-navigation/stack": "^5.12.3",
    "@testing-library/react-hooks": "^3.4.2",
    "@types/escape-string-regexp": "^2.0.1",
    "@types/jwt-decode": "^2.2.1",
    "@types/qs": "^6.9.5",
    "@types/react-native-background-timer": "^2.0.0",
    "@types/react-native-share": "^3.3.3",
    "@types/react-native-video": "^5.0.3",
    "@types/uuid": "^8.3.0",
    "@types/yup": "^0.29.9",
    "ably-react-native": "^1.1.1",
    "axios": "^0.21.0",
    "escape-string-regexp": "^4.0.0",
    "formik": "^2.2.1",
    "html-entities": "^2.3.3",
    "i18n-iso-countries": "^7.4.0",
    "i18n-js": "^3.8.0",
    "jwt-decode": "^3.1.1",
    "moment": "^2.29.1",
    "pubsub-js": "^1.9.0",
    "qs": "^6.9.4",
    "query-string": "^7.1.1",
    "react": "17.0.2",
    "react-airplay": "^1.0.1",
    "react-content-loader": "^5.1.4",
    "react-native": "0.66.4",
    "react-native-app-auth": "^6.4.3",
    "react-native-autoheight-webview": "^1.5.8",
    "react-native-background-timer": "^2.4.0",
    "react-native-collapsible": "^1.5.3",
    "react-native-color-matrix-image-filters": "^5.2.2",
    "react-native-config": "^1.4.0",
    "react-native-device-info": "8.4.9",
    "react-native-email-link": "^1.13.1",
    "react-native-fast-image": "^8.5.11",
    "react-native-fbsdk-next": "^4.6.0",
    "react-native-gesture-handler": "1.10.3",
    "react-native-get-random-values": "^1.7.0",
    "react-native-google-cast": "^4.0.3",
    "react-native-iap": "7.5.6",
    "react-native-image-pan-zoom": "^2.1.12",
    "react-native-in-app-review": "^3.3.2",
    "react-native-inappbrowser-reborn": "3.5.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^2.2.1",
    "react-native-location-enabler": "^4.1.0",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^13.1.2",
    "react-native-orientation-locker": "^1.2.0",
    "react-native-passkit-wallet": "^0.1.4",
    "react-native-permissions": "^3.0.1",
    "react-native-picker-select": "8.0.4",
    "react-native-qrcode-svg": "^6.1.1",
    "react-native-reanimated": "2.2.4",
    "react-native-safe-area-context": "^3.1.8",
    "react-native-screen-brightness": "./packages/react-native-screen-brightness",
    "react-native-screens": "^2.13.0",
    "react-native-section-list-get-item-layout": "^2.2.3",
    "react-native-share": "^7.3.7",
    "react-native-shimmer": "^0.6.0",
    "react-native-shimmer-placeholder": "^2.0.6",
    "react-native-snap-carousel": "4.0.0-beta.6",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^12.3.0",
    "react-native-swipeable-item": "^1.5.2",
    "react-native-tab-view": "^2.16.0",
    "react-native-table-component": "^1.2.1",
    "react-native-video": "react-native-video/react-native-video#d681e5505f7c4827fc1f2fb9833aa3edb8f005f6",
    "react-native-wallet": "^1.0.8",
    "react-native-webview": "^11.6.5",
    "react-native-wonderpush": "^2.0.15",
    "react-native-wonderpush-fcm": "1.0.6",
    "react-redux": "^7.1.3",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.8",
    "redux-persist": "^6.0.0",
    "redux-persist-filesystem-storage": "^3.0.0",
    "reselect": "^4.0.0",
    "rn-fetch-blob": "^0.12.0",
    "rn-range-slider": "^1.3.3",
    "styled-components": "^5.1.1",
    "ts-json-schema-generator": "^0.77.0",
    "typesafe-actions": "^5.1.0",
    "typescript-json-schema": "^0.43.0",
    "typescript-to-json-schema": "^0.6.1",
    "uuid": "^8.3.1",
    "yup": "^0.29.3"
  },

iOS

ios/Podfile:


require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

$RNFirebaseAnalyticsWithoutAdIdSupport = true

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

target 'WonderPushNotificationServiceExtension' do
  platform :ios, '10.0'

  pod 'WonderPushExtension', '~> 4.0'
end

target 'MYPROJECT' do
  permissions_path = '../node_modules/react-native-permissions/ios'
  config = use_native_modules!
  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )

  pod 'SwiftLint'
  # pod 'KalturaPlayerSDKStreamamg/Core', :git => 'https://bitbucket.org/sukdev/kaltura-ios-sdk.git', :branch => 'master'
  pod 'KalturaPlayerSDKStreamamg/Core', :git => 'https://bitbucket.org/sukdev/kaltura-ios-sdk.git', :branch => 'HERMES-245-ima-sdk-add-feature'
  pod 'GoogleAds-IMA-iOS-SDK', '~> 3.13.0'
  pod 'react-native-google-cast/NoBluetooth', path: '../node_modules/react-native-google-cast/ios/'
  pod 'google-cast-sdk-no-bluetooth'
  pod 'DailymotionPlayerSDK', '4.0.0'

  pod 'Adyen','~> 3.8.0'

  pod 'Didomi-XCFramework', '1.69.0'

  pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"

  target 'MYYPROJECTTests' do
    inherit! :complete
    # Pods for testing
  end

  use_flipper!({ 'Flipper' => '0.99.0' }, configurations: ['debug'])
end

post_install do |installer|
  flipper_post_install(installer)

  react_native_post_install(installer)
  __apply_Xcode_12_5_M1_post_install_workaround(installer)

  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end

Environment

react-native info output:

System:
    OS: macOS 12.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 32.11 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 7.24.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 26, 27, 28, 29, 30, 31, 32
      Build Tools: 27.0.3, 28.0.3, 29.0.0, 29.0.2, 29.0.3, 30.0.0, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0, 33.0.0, 33.0.0
      System Images: android-26 | Intel x86 Atom_64, android-26 | Google Play Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google X86_ARM Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64, android-31 | Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a, android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play ARM 64 v8a, android-31 | Google Play Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64, android-32 | Google Play Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.4 => 0.66.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
mikehardy commented 2 years ago

Hmm, I suspect it is this - #6194 (also #6226 and #6203) / PR #6234 - released first time in v14.9.2

Why? Versions appear outdated

    "@react-native-firebase/analytics": "^14.7.0",
    "@react-native-firebase/app": "^14.7.0",
    "@react-native-firebase/crashlytics": "^14.7.0",
    "@react-native-firebase/dynamic-links": "^14.7.0",
    "@react-native-firebase/perf": "^14.7.0",

And macOS version is updated and is missing stock python:

OS: macOS 12.3.1

It's a very unfortunate bug, especially in that it manifests itself in "silent failure" instead of fail-fast, can you check your installed react-native-firebase/app version and see if you have this fix or not?

fdobre commented 2 years ago
Screenshot 2022-05-23 at 22 19 10

Python 3 fix is not there for version 14.7.0:

Content of my lines:

Screenshot 2022-05-23 at 22 32 51

If you think an update to 14.9.4 could fix the issue please let me know.

fdobre commented 2 years ago

It seems there was an issue on my side on iOS. Closed issue since react-native-firebase/analytics google_analytics_automatic_screen_reporting_enabled set to false seems to work as expected on iOS.

mikehardy commented 2 years ago

Glad to hear it's working! Good luck with your project

omarkhaled11 commented 1 year ago

I am also facing this issue, even disabling automatic screen_view on the native side in AndroidManifest and iOS info.plist doesn't work. my firebase packages are pretty outdated though "@react-native-firebase/app": "11.4.1"

@fdobre can you please confirm if upgrading the package to 14.9.4 fixed your issue?

fdobre commented 1 year ago

@omarkhaled11 I am still using ^14.7.0 there was a local issue on my side. I haven't tested this in 14.9.4 yet.