@react-native-firebase/analytics 14.11.1 → 15.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
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.1](https://github.com/invertase/react-native-firebase/compare/v15.1.0...v15.1.1) (2022-06-28)
7
+
8
+ **Note:** Version bump only for package @react-native-firebase/analytics
9
+
10
+ # [15.1.0](https://github.com/invertase/react-native-firebase/compare/v15.0.0...v15.1.0) (2022-06-28)
11
+
12
+ ### Features
13
+
14
+ - **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)
15
+
16
+ # [15.0.0](https://github.com/invertase/react-native-firebase/compare/v14.11.1...v15.0.0) (2022-06-20)
17
+
18
+ **Note:** Version bump only for package @react-native-firebase/analytics
19
+
6
20
  ## [14.11.1](https://github.com/invertase/react-native-firebase/compare/v14.11.0...v14.11.1) (2022-06-17)
7
21
 
8
22
  ### Bug Fixes
@@ -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,
@@ -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.1';
2
+ module.exports = '15.1.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/analytics",
3
- "version": "14.11.1",
3
+ "version": "15.1.1",
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.1"
25
+ "@react-native-firebase/app": "15.1.1"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
- "gitHead": "b1a430bbf36a41076b33550fec113fa0e44583b4"
30
+ "gitHead": "8d469f19b9faec54c492f83c0a2dba6a52815da3"
31
31
  }