@react-native-firebase/analytics 14.11.0 → 15.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [15.1.0](https://github.com/invertase/react-native-firebase/compare/v15.0.0...v15.1.0) (2022-06-28)
7
+
8
+ ### Features
9
+
10
+ - **analytics, ios:** implement on-device conversion ([a1df996](https://github.com/invertase/react-native-firebase/commit/a1df996b36f2b5eb68c6443c49c5185437573fba)), closes [/firebase.google.com/support/release-notes/ios#analytics_1](https://github.com//firebase.google.com/support/release-notes/ios/issues/analytics_1) [#6321](https://github.com/invertase/react-native-firebase/issues/6321)
11
+
12
+ # [15.0.0](https://github.com/invertase/react-native-firebase/compare/v14.11.1...v15.0.0) (2022-06-20)
13
+
14
+ **Note:** Version bump only for package @react-native-firebase/analytics
15
+
16
+ ## [14.11.1](https://github.com/invertase/react-native-firebase/compare/v14.11.0...v14.11.1) (2022-06-17)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **analytics:** allow manual tracking of ad_impression ([931468a](https://github.com/invertase/react-native-firebase/commit/931468ac2380b8a3449456f941caaa7ca8902d5a)), closes [#6307](https://github.com/invertase/react-native-firebase/issues/6307) [#6312](https://github.com/invertase/react-native-firebase/issues/6312)
21
+
6
22
  # [14.11.0](https://github.com/invertase/react-native-firebase/compare/v14.10.1...v14.11.0) (2022-05-27)
7
23
 
8
24
  **Note:** Version bump only for package @react-native-firebase/analytics
@@ -49,6 +49,18 @@ Pod::Spec.new do |s|
49
49
  s.dependency 'Firebase/Analytics', firebase_sdk_version
50
50
  end
51
51
 
52
+ # Special pod for on-device conversion
53
+ if defined?($RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion) && ($RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion == true)
54
+ Pod::UI.puts "#{s.name}: GoogleAppMeasurementOnDeviceConversion pod added"
55
+
56
+ # Releasing as non-breaking change as it is optional but it raises minimum requirements, validate just in case
57
+ if (Gem::Version.new(firebase_sdk_version) < Gem::Version.new("9.0.0"))
58
+ raise "GoogleAppMeasurementOnDeviceConversion requires firebase-ios-sdk 9.0.0 or greater."
59
+ end
60
+
61
+ s.dependency 'GoogleAppMeasurementOnDeviceConversion', firebase_sdk_version
62
+ end
63
+
52
64
  if defined?($RNFirebaseAsStaticFramework)
53
65
  Pod::UI.puts "#{s.name}: Using overridden static_framework value of '#{$RNFirebaseAsStaticFramework}'"
54
66
  s.static_framework = $RNFirebaseAsStaticFramework
@@ -521,4 +521,15 @@ describe('Analytics', function () {
521
521
  );
522
522
  });
523
523
  });
524
+
525
+ describe('initiateOnDeviceConversionMeasurementWithEmailAddress()', function () {
526
+ it('throws if not a string', function () {
527
+ expect(() =>
528
+ // @ts-ignore
529
+ firebase.analytics().initiateOnDeviceConversionMeasurementWithEmailAddress(true),
530
+ ).toThrowError(
531
+ "firebase.analytics().initiateOnDeviceConversionMeasurementWithEmailAddress(*) 'emailAddress' expected a string value.",
532
+ );
533
+ });
534
+ });
524
535
  });
@@ -138,6 +138,19 @@ RCT_EXPORT_METHOD(setDefaultEventParameters
138
138
  return resolve([NSNull null]);
139
139
  }
140
140
 
141
+ RCT_EXPORT_METHOD(initiateOnDeviceConversionMeasurementWithEmailAddress
142
+ : (NSString *)emailAddress resolver
143
+ : (RCTPromiseResolveBlock)resolve rejecter
144
+ : (RCTPromiseRejectBlock)reject) {
145
+ @try {
146
+ [FIRAnalytics initiateOnDeviceConversionMeasurementWithEmailAddress:emailAddress];
147
+ } @catch (NSException *exception) {
148
+ return [RNFBSharedUtils rejectPromiseWithExceptionDict:reject exception:exception];
149
+ }
150
+
151
+ return resolve([NSNull null]);
152
+ }
153
+
141
154
  #pragma mark -
142
155
  #pragma mark Private methods
143
156
 
package/lib/index.d.ts CHANGED
@@ -1502,6 +1502,15 @@ export namespace FirebaseAnalyticsTypes {
1502
1502
  * will clear all parameters.
1503
1503
  */
1504
1504
  setDefaultEventParameters(params?: { [key: string]: any }): Promise<void>;
1505
+
1506
+ /**
1507
+ * start privacy-sensitive on-device conversion management.
1508
+ * This is iOS-only.
1509
+ * This is a no-op if you do not include '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true' in your Podfile
1510
+ *
1511
+ * @param emailAddress email address, properly formatted complete with domain name e.g, 'user@example.com'
1512
+ */
1513
+ initiateOnDeviceConversionMeasurementWithEmailAddress(emailAddress: string): Promise<void>;
1505
1514
  }
1506
1515
  }
1507
1516
 
package/lib/index.js CHANGED
@@ -17,6 +17,7 @@
17
17
 
18
18
  import {
19
19
  isAlphaNumericUnderscore,
20
+ isIOS,
20
21
  isNull,
21
22
  isNumber,
22
23
  isObject,
@@ -40,7 +41,7 @@ const ReservedEventNames = [
40
41
  'ad_activeview',
41
42
  'ad_click',
42
43
  'ad_exposure',
43
- 'ad_impression',
44
+ // 'ad_impression', // manual ad_impression logging is allowed, See #6307
44
45
  'ad_query',
45
46
  'ad_reward',
46
47
  'adunit_exposure',
@@ -676,6 +677,20 @@ class FirebaseAnalyticsModule extends FirebaseModule {
676
677
 
677
678
  return this.native.setDefaultEventParameters(params);
678
679
  }
680
+
681
+ initiateOnDeviceConversionMeasurementWithEmailAddress(emailAddress) {
682
+ if (!isString(emailAddress)) {
683
+ throw new Error(
684
+ "firebase.analytics().initiateOnDeviceConversionMeasurementWithEmailAddress(*) 'emailAddress' expected a string value.",
685
+ );
686
+ }
687
+
688
+ if (!isIOS) {
689
+ return;
690
+ }
691
+
692
+ return this.native.initiateOnDeviceConversionMeasurementWithEmailAddress(emailAddress);
693
+ }
679
694
  }
680
695
 
681
696
  // import { SDK_VERSION } from '@react-native-firebase/analytics';
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '14.11.0';
2
+ module.exports = '15.1.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/analytics",
3
- "version": "14.11.0",
3
+ "version": "15.1.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - The analytics module provides out of the box support with Google Analytics for Firebase. Integration with the Android & iOS allows for in-depth analytical insight reporting, such as device information, location, user actions and more.",
6
6
  "main": "lib/index.js",
@@ -22,10 +22,10 @@
22
22
  "analytics"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@react-native-firebase/app": "14.11.0"
25
+ "@react-native-firebase/app": "15.1.0"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
- "gitHead": "ee740f80501fdd2ea5184515c4840340fca55e63"
30
+ "gitHead": "f9a50496bddab6a4bb740cd18dd7407d219fbda2"
31
31
  }