Skip to content

Commit da6b811

Browse files
committed
feat(analytics, ATT): allow use of AnalyticsWithoutAdIdSupport pod
- not compatible with AdMob, so put a warning in there - requires firebase-ios-sdk 7.11.0 but desire non-breaking, fail on install if req not met - add messaging during install to make new option more developer discoverable
1 parent f25d25d commit da6b811

File tree

6 files changed

+82
-27
lines changed

6 files changed

+82
-27
lines changed

.spellcheck.dict.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ APIs
88
APIs.
99
APNs
1010
async
11+
ATT
12+
ATT-compatible
1113
auth
1214
Auth
1315
authenticator
@@ -46,6 +48,7 @@ Fastlane
4648
FCM
4749
firebase
4850
Firebase
51+
firebase-ios-sdk
4952
Firestore
5053
GDPR
5154
globals
@@ -55,6 +58,7 @@ Hesp
5558
Homebrew
5659
HTTP
5760
HTTPS
61+
IDFA
5862
installable
5963
Interstitials
6064
interstitials

docs/analytics/usage/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ import analytics from '@react-native-firebase/analytics';
132132
const appInstanceId = await analytics().getAppInstanceId();
133133
```
134134

135+
# Disable Ad Id usage on iOS
136+
137+
Apple has a strict ban on the usage of Ad Ids ("IDFA") in Kids Category apps. They will not accept any app
138+
in the Kids category if the app accesses the IDFA iOS symbols.
139+
140+
Additionally, apps must implement Apples "App Tracking Transparency" (or "ATT") requirements if they access IDFA symbols.
141+
However, if an app does not use IDFA and otherwise handles data in an ATT-compatible way, it eliminates this ATT requirement.
142+
143+
If avoiding the usage of IDFA is a requirement for your app, you must use firebase-ios-sdk 7.11.0 or greater, then you may define a variable in your Podfile like this:
144+
145+
```ruby
146+
$RNFirebaseAnalyticsWithoutAdIdSupport = true
147+
```
148+
149+
During `pod install`, using that variable installs a new
150+
["Analytics With No Ad Ids"](https://firebase.google.com/support/release-notes/ios#version_7110_-_april_20_2021)
151+
pod the firebase-ios-sdk team has created, and allows both the use of Firebase Analytics in Kids Category apps,
152+
and use of Firebase Analytics without needing the App Tracking Transparency handling (assuming no other parts
153+
of your app handle data in a way that requires ATT)
154+
155+
Note that for obvious reasons, configuring Firebase Analytics for use without IDFA is incompatible with AdMob
135156
# firebase.json
136157

137158
## Disable Auto-Initialization

packages/admob/RNFBAdMob.podspec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ Pod::Spec.new do |s|
3737
firebase_sdk_version = $FirebaseSDKVersion
3838
end
3939

40+
if defined?($RNFirebaseAnalyticsWithoutAdIdSupport)
41+
# Trying to use AdMob *and* AnalyticsWIthoutAdIdSupport is not a valid combination
42+
raise "#{s.name} and Firebase/AnalyticsWithoutAdIdSupport are not compatible. Ad Ids are required for #{s.name}"
43+
end
44+
4045
# Firebase dependencies
4146
s.dependency 'Firebase/AdMob', firebase_sdk_version
4247

packages/analytics/RNFBAnalytics.podspec

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,20 @@ Pod::Spec.new do |s|
3434
end
3535

3636
# Firebase dependencies
37-
s.dependency 'Firebase/Analytics', firebase_sdk_version
37+
if defined?($RNFirebaseAnalyticsWithoutAdIdSupport)
38+
Pod::UI.puts "#{s.name}: Using Firebase/AnalyticsWithoutAdIdSupport pod in place of default Firebase/Analytics"
39+
40+
# Releasing as non-breaking change as it is optional but it raises minimum requirements, validate just in case
41+
if (Gem::Version.new(firebase_sdk_version) < Gem::Version.new("7.11.0"))
42+
raise "Firebase/AnalyticsWithoutAdIdSupport requires firebase-ios-sdk 7.11.0 or greater."
43+
end
44+
45+
s.dependency 'Firebase/AnalyticsWithoutAdIdSupport', firebase_sdk_version
46+
else
47+
Pod::UI.puts "#{s.name}: Using default Firebase/Analytics with Ad Ids. May require App Tracking Transparency. Not allowed for Kids apps."
48+
Pod::UI.puts "#{s.name}: You may set variable `$RNFirebaseAnalyticsWithoutAdIdSupport=true` in Podfile to use analytics without ad ids."
49+
s.dependency 'Firebase/Analytics', firebase_sdk_version
50+
end
3851

3952
if defined?($RNFirebaseAsStaticFramework)
4053
Pod::UI.puts "#{s.name}: Using overridden static_framework value of '#{$RNFirebaseAsStaticFramework}'"

tests/ios/Podfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ $FirebaseSDKVersion = appPackage['sdkVersions']['ios']['firebase']
77
Pod::UI.puts "react-native-firebase/tests: Using Firebase SDK version '#{$FirebaseSDKVersion}'"
88
#$RNFirebaseAsStaticFramework = false # toggle this to true (and set 'use_frameworks!' below to test static frameworks)
99

10+
# Toggle this to true for the no-ad-tracking Analytics subspec. Useful at minimum for Kids category apps.
11+
# See: https://firebase.google.com/support/release-notes/ios#analytics - requires firebase-ios-sdk 7.11.0+
12+
#$RNFirebaseAnalyticsWithoutAdIdSupport = true # toggle this to true for the no-ad-tracking Analytics subspec
13+
14+
# This is needed to reduce flakiness where leveldb is transitively included by database, and packed as framework
15+
# from the pre-compiled firestore-ios-sdk-frameworks
16+
$FirebaseFirestoreExcludeLeveldb = true
17+
1018
# Versions used below, for quick reference / outdated+upgrade checks
1119
$iOSMinimumDeployVersion = '10.0'
1220

@@ -28,7 +36,6 @@ target 'testing' do
2836
)
2937

3038
# Use pre-compiled firestore frameworks to optimize compile time. But make sure there are not leveldb conflicts.
31-
$FirebaseFirestoreExcludeLeveldb = true
3239
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => $FirebaseSDKVersion
3340

3441
# Enables Flipper.

tests/ios/Podfile.lock

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ PODS:
1212
- Firebase/AdMob (7.11.0):
1313
- Firebase/CoreOnly
1414
- Google-Mobile-Ads-SDK (~> 7.66)
15-
- Firebase/AnalyticsWithoutAdIdSupport (7.11.0):
16-
- Firebase/CoreOnly
17-
- FirebaseAnalytics/WithoutAdIdSupport (~> 7.11.0)
15+
- Firebase/Analytics (7.11.0):
16+
- Firebase/Core
1817
- Firebase/Auth (7.11.0):
1918
- Firebase/CoreOnly
2019
- FirebaseAuth (~> 7.11.0)
20+
- Firebase/Core (7.11.0):
21+
- Firebase/CoreOnly
22+
- FirebaseAnalytics (~> 7.11.0)
2123
- Firebase/CoreOnly (7.11.0):
2224
- FirebaseCore (= 7.11.0)
2325
- Firebase/Crashlytics (7.11.0):
@@ -55,19 +57,28 @@ PODS:
5557
- FirebaseStorage (~> 7.11.0)
5658
- FirebaseABTesting (7.11.0):
5759
- FirebaseCore (~> 7.0)
58-
- FirebaseAnalytics/Base (7.11.0):
60+
- FirebaseAnalytics (7.11.0):
61+
- FirebaseAnalytics/AdIdSupport (= 7.11.0)
5962
- FirebaseCore (~> 7.0)
6063
- FirebaseInstallations (~> 7.0)
6164
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
6265
- GoogleUtilities/MethodSwizzler (~> 7.0)
6366
- GoogleUtilities/Network (~> 7.0)
6467
- "GoogleUtilities/NSData+zlib (~> 7.0)"
6568
- nanopb (~> 2.30908.0)
66-
- FirebaseAnalytics/WithoutAdIdSupport (7.11.0):
69+
- FirebaseAnalytics/AdIdSupport (7.11.0):
6770
- FirebaseAnalytics/Base (= 7.11.0)
6871
- FirebaseCore (~> 7.0)
6972
- FirebaseInstallations (~> 7.0)
70-
- GoogleAppMeasurement/WithoutAdIdSupport (= 7.11.0)
73+
- GoogleAppMeasurement/AdIdSupport (= 7.11.0)
74+
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
75+
- GoogleUtilities/MethodSwizzler (~> 7.0)
76+
- GoogleUtilities/Network (~> 7.0)
77+
- "GoogleUtilities/NSData+zlib (~> 7.0)"
78+
- nanopb (~> 2.30908.0)
79+
- FirebaseAnalytics/Base (7.11.0):
80+
- FirebaseCore (~> 7.0)
81+
- FirebaseInstallations (~> 7.0)
7182
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
7283
- GoogleUtilities/MethodSwizzler (~> 7.0)
7384
- GoogleUtilities/Network (~> 7.0)
@@ -184,12 +195,6 @@ PODS:
184195
- GoogleUtilities/Network (~> 7.0)
185196
- "GoogleUtilities/NSData+zlib (~> 7.0)"
186197
- nanopb (~> 2.30908.0)
187-
- GoogleAppMeasurement/WithoutAdIdSupport (7.11.0):
188-
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
189-
- GoogleUtilities/MethodSwizzler (~> 7.0)
190-
- GoogleUtilities/Network (~> 7.0)
191-
- "GoogleUtilities/NSData+zlib (~> 7.0)"
192-
- nanopb (~> 2.30908.0)
193198
- GoogleDataTransport (8.4.0):
194199
- GoogleUtilities/Environment (~> 7.2)
195200
- nanopb (~> 2.30908.0)
@@ -207,25 +212,25 @@ PODS:
207212
- "GoogleToolboxForMac/NSString+URLArguments (= 2.3.1)"
208213
- "GoogleToolboxForMac/NSString+URLArguments (2.3.1)"
209214
- GoogleUserMessagingPlatform (1.4.0)
210-
- GoogleUtilities/AppDelegateSwizzler (7.3.1):
215+
- GoogleUtilities/AppDelegateSwizzler (7.4.0):
211216
- GoogleUtilities/Environment
212217
- GoogleUtilities/Logger
213218
- GoogleUtilities/Network
214-
- GoogleUtilities/Environment (7.3.1):
219+
- GoogleUtilities/Environment (7.4.0):
215220
- PromisesObjC (~> 1.2)
216-
- GoogleUtilities/ISASwizzler (7.3.1)
217-
- GoogleUtilities/Logger (7.3.1):
221+
- GoogleUtilities/ISASwizzler (7.4.0)
222+
- GoogleUtilities/Logger (7.4.0):
218223
- GoogleUtilities/Environment
219-
- GoogleUtilities/MethodSwizzler (7.3.1):
224+
- GoogleUtilities/MethodSwizzler (7.4.0):
220225
- GoogleUtilities/Logger
221-
- GoogleUtilities/Network (7.3.1):
226+
- GoogleUtilities/Network (7.4.0):
222227
- GoogleUtilities/Logger
223228
- "GoogleUtilities/NSData+zlib"
224229
- GoogleUtilities/Reachability
225-
- "GoogleUtilities/NSData+zlib (7.3.1)"
226-
- GoogleUtilities/Reachability (7.3.1):
230+
- "GoogleUtilities/NSData+zlib (7.4.0)"
231+
- GoogleUtilities/Reachability (7.4.0):
227232
- GoogleUtilities/Logger
228-
- GoogleUtilities/UserDefaults (7.3.1):
233+
- GoogleUtilities/UserDefaults (7.4.0):
229234
- GoogleUtilities/Logger
230235
- GTMSessionFetcher (1.5.0):
231236
- GTMSessionFetcher/Full (= 1.5.0)
@@ -506,7 +511,7 @@ PODS:
506511
- React-Core
507512
- RNFBApp
508513
- RNFBAnalytics (11.3.3):
509-
- Firebase/AnalyticsWithoutAdIdSupport (= 7.11.0)
514+
- Firebase/Analytics (= 7.11.0)
510515
- React-Core
511516
- RNFBApp
512517
- RNFBApp (11.3.3):
@@ -786,7 +791,7 @@ SPEC CHECKSUMS:
786791
GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7
787792
GoogleToolboxForMac: 471e0c05d39506e50e6398f46fa9a12ae0efeff9
788793
GoogleUserMessagingPlatform: b168e8c46cd8f92aa3e34b584c4ca78a411ce367
789-
GoogleUtilities: e1d9ed4e544fc32a93e00e721400cbc3f377200d
794+
GoogleUtilities: 284cddc7fffc14ae1907efb6f78ab95c1fccaedc
790795
GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52
791796
Jet: 84fd0e2e9d49457fc04bc79b5d8857737a01c507
792797
leveldb-library: 50c7b45cbd7bf543c81a468fe557a16ae3db8729
@@ -818,7 +823,7 @@ SPEC CHECKSUMS:
818823
React-runtimeexecutor: cad74a1eaa53ee6e7a3620231939d8fe2c6afcf0
819824
ReactCommon: cfe2b7fd20e0dbd2d1185cd7d8f99633fbc5ff05
820825
RNFBAdMob: 7d5a6b026782a1b5f91bd863d2299e4a328cade0
821-
RNFBAnalytics: 45e0aaa4919d5dc82a2605f01984cd4dfff706c8
826+
RNFBAnalytics: 4747ea51be1b2f003c889aad0207bf3fcc8309ad
822827
RNFBApp: 097a73b10972939bade8ad720ef92c3867baf2e5
823828
RNFBAuth: e554b8c1d3cddcb1ead741794be055acc1defcda
824829
RNFBCrashlytics: a045da0758ed559db99ed049a11ffc995fececb9
@@ -835,6 +840,6 @@ SPEC CHECKSUMS:
835840
RNFBStorage: af7814531e503ea094f65f24fc5aa98491823bb8
836841
Yoga: 8c8436d4171c87504c648ae23b1d81242bdf3bbf
837842

838-
PODFILE CHECKSUM: 425de7af0490cb14d4d9a6f7f39d3eb34cd31fb6
843+
PODFILE CHECKSUM: 89dba385c805fb62e8343576922b9b86427aa683
839844

840845
COCOAPODS: 1.10.1

0 commit comments

Comments
 (0)