@react-native-firebase/app 13.1.0 → 14.1.0

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,32 @@
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
+ # [14.1.0](https://github.com/invertase/react-native-firebase/compare/v14.0.1...v14.1.0) (2021-12-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **app, android:** firebase-android-sdk 29.0.3 to fix underlying NPE in 29.0.2 ([#5946](https://github.com/invertase/react-native-firebase/issues/5946)) ([051f4a6](https://github.com/invertase/react-native-firebase/commit/051f4a66d64db42f1c615580e185eaf00660fbc1))
11
+
12
+ ### Features
13
+
14
+ - **analytics, config:** expose automatic screenview reporting toggle ([#5948](https://github.com/invertase/react-native-firebase/issues/5948)) ([8836c01](https://github.com/invertase/react-native-firebase/commit/8836c01dcfa2f478f973a1a54253509c3368d963))
15
+
16
+ ## [14.0.1](https://github.com/invertase/react-native-firebase/compare/v14.0.0...v14.0.1) (2021-12-15)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **app, expo:** Update AppDelegate config plugin for Expo SDK 44 ([#5940](https://github.com/invertase/react-native-firebase/issues/5940)) ([185756d](https://github.com/invertase/react-native-firebase/commit/185756df6de238aa8a018007cf6b2fa810cb6055))
21
+
22
+ # [14.0.0](https://github.com/invertase/react-native-firebase/compare/v13.1.1...v14.0.0) (2021-12-14)
23
+
24
+ **Note:** Version bump only for package @react-native-firebase/app
25
+
26
+ ## [13.1.1](https://github.com/invertase/react-native-firebase/compare/v13.1.0...v13.1.1) (2021-12-14)
27
+
28
+ ### Bug Fixes
29
+
30
+ - **deps:** AGP7.0.4, firebase-android-sdk 29.0.2, javascript deps ([55d0a36](https://github.com/invertase/react-native-firebase/commit/55d0a36a0addc54e347f26bb8ee88bb38b0fa4a6))
31
+
6
32
  # [13.1.0](https://github.com/invertase/react-native-firebase/compare/v13.0.1...v13.1.0) (2021-12-02)
7
33
 
8
34
  ### Features
@@ -11,7 +11,7 @@ buildscript {
11
11
  }
12
12
 
13
13
  dependencies {
14
- classpath("com.android.tools.build:gradle:7.0.3")
14
+ classpath("com.android.tools.build:gradle:7.0.4")
15
15
  }
16
16
  }
17
17
  }
@@ -18,5 +18,5 @@ package io.invertase.firebase.app;
18
18
  */
19
19
  // generated file - do not modify or commit
20
20
  public class ReactNativeFirebaseVersion {
21
- public static String VERSION = "13.1.0";
21
+ public static String VERSION = "14.1.0";
22
22
  }
@@ -25,6 +25,10 @@
25
25
  "description": "If you wish to disable collection of SSAID (Settings.Secure.ANDROID_ID) in your Android app,.\n This cannot be altered at runtime once set in the config.",
26
26
  "type": "boolean"
27
27
  },
28
+ "google_analytics_automatic_screen_reporting_enabled": {
29
+ "description": "If you wish to disable automatic screen reporting in your app.\n This cannot be altered at runtime once set in the config.",
30
+ "type": "boolean"
31
+ },
28
32
  "analytics_default_allow_ad_personalization_signals": {
29
33
  "description": "Configure whether a user's Analytics data may be used for personalized advertising in other products.\n If set, may be overridden at runtime by calling setUserProperty on the key 'allow_personalized_ads'",
30
34
  "type": "boolean"
@@ -54,7 +58,7 @@
54
58
  "type": "boolean"
55
59
  },
56
60
  "crashlytics_javascript_exception_handler_chaining_enabled": {
57
- "description": "By default React Native Firebase Crashlytics will preserve existing global javascript-level uhandled exception handlers by reporting to Crashlytics then passing the exception on for further handling. This could lead to duplicate reports, for example a fatal javascript-level report and a fatal native level report for the same crash. Set to false to terminate error handling after logging the javascript-level crash.",
61
+ "description": "By default React Native Firebase Crashlytics will preserve existing global javascript-level unhandled exception handlers by reporting to Crashlytics then passing the exception on for further handling. This could lead to duplicate reports, for example a fatal javascript-level report and a fatal native level report for the same crash. Set to false to terminate error handling after logging the javascript-level crash.",
58
62
  "type": "boolean"
59
63
  },
60
64
  "crashlytics_ndk_enabled": {
@@ -18,4 +18,4 @@
18
18
  #import "RCTVersion.h"
19
19
 
20
20
  // generated file - do not modify or commit
21
- NSString* const RNFBVersionString = @"13.1.0";
21
+ NSString* const RNFBVersionString = @"14.1.0";
package/ios_config.sh CHANGED
@@ -126,6 +126,14 @@ if [[ ${_SEARCH_RESULT} ]]; then
126
126
  _PLIST_ENTRY_VALUES+=("$(jsonBoolToYesNo "$_ANALYTICS_PERSONALIZATION")")
127
127
  fi
128
128
 
129
+ # config.google_analytics_automatic_screen_reporting_enabled
130
+ _ANALYTICS_AUTO_SCREEN_REPORTING=$(getFirebaseJsonKeyValue "$_JSON_OUTPUT_RAW" "google_analytics_automatic_screen_reporting_enabled")
131
+ if [[ $_ANALYTICS_AUTO_SCREEN_REPORTING ]]; then
132
+ _PLIST_ENTRY_KEYS+=("FirebaseAutomaticScreenReportingEnabled")
133
+ _PLIST_ENTRY_TYPES+=("bool")
134
+ _PLIST_ENTRY_VALUES+=("$(jsonBoolToYesNo "$_ANALYTICS_AUTO_SCREEN_REPORTING")")
135
+ fi
136
+
129
137
  # config.perf_auto_collection_enabled
130
138
  _PERF_AUTO_COLLECTION=$(getFirebaseJsonKeyValue "$_JSON_OUTPUT_RAW" "perf_auto_collection_enabled")
131
139
  if [[ $_PERF_AUTO_COLLECTION ]]; then
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- module.exports = '13.1.0';
2
+ module.exports = '14.1.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/app",
3
- "version": "13.1.0",
3
+ "version": "14.1.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Storage and more.",
6
6
  "main": "lib/index.js",
@@ -56,7 +56,7 @@
56
56
  "react-native": "*"
57
57
  },
58
58
  "dependencies": {
59
- "@expo/config-plugins": "^4.0.10",
59
+ "@expo/config-plugins": "^4.0.12",
60
60
  "opencollective-postinstall": "^2.0.1",
61
61
  "superstruct": "^0.6.2"
62
62
  },
@@ -72,12 +72,12 @@
72
72
  "targetSdk": 31,
73
73
  "compileSdk": 31,
74
74
  "buildTools": "30.0.3",
75
- "firebase": "29.0.1",
75
+ "firebase": "29.0.3",
76
76
  "firebaseCrashlyticsGradle": "2.8.1",
77
77
  "firebasePerfGradle": "1.4.0",
78
78
  "gmsGoogleServicesGradle": "4.3.10",
79
- "playServicesAuth": "19.2.0"
79
+ "playServicesAuth": "20.0.0"
80
80
  }
81
81
  },
82
- "gitHead": "0a9621b1ad2d6592de9906157d121c8ba5460a75"
82
+ "gitHead": "8efda506474b1757f6a0537495a1de581d372299"
83
83
  }
@@ -8,8 +8,11 @@ const config_plugins_1 = require("@expo/config-plugins");
8
8
  const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
9
9
  const fs_1 = __importDefault(require("fs"));
10
10
  const methodInvocationBlock = `[FIRApp configure];`;
11
- // https://regex101.com/r/Imm3E8/1
12
- const methodInvocationLineMatcher = /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[\[RCTBridge alloc\])/g;
11
+ // https://regex101.com/r/mPgaq6/1
12
+ const methodInvocationLineMatcher = /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
13
+ // https://regex101.com/r/nHrTa9/1/
14
+ // if the above regex fails, we can use this one as a fallback:
15
+ const fallbackInvocationLineMatcher = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
13
16
  function modifyObjcAppDelegate(contents) {
14
17
  // Add import
15
18
  if (!contents.includes('@import Firebase;')) {
@@ -20,15 +23,38 @@ function modifyObjcAppDelegate(contents) {
20
23
  if (contents.includes(methodInvocationBlock)) {
21
24
  return contents;
22
25
  }
26
+ if (!methodInvocationLineMatcher.test(contents) &&
27
+ !fallbackInvocationLineMatcher.test(contents)) {
28
+ config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app', 'Unable to determine correct Firebase insertion point in AppDelegate.m. Skipping Firebase addition.');
29
+ return contents;
30
+ }
23
31
  // Add invocation
24
- return (0, generateCode_1.mergeContents)({
25
- tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
26
- src: contents,
27
- newSrc: methodInvocationBlock,
28
- anchor: methodInvocationLineMatcher,
29
- offset: 0,
30
- comment: '//',
31
- }).contents;
32
+ try {
33
+ return (0, generateCode_1.mergeContents)({
34
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
35
+ src: contents,
36
+ newSrc: methodInvocationBlock,
37
+ anchor: methodInvocationLineMatcher,
38
+ offset: 0,
39
+ comment: '//',
40
+ }).contents;
41
+ }
42
+ catch (e) {
43
+ // tests if the opening `{` is in the new line
44
+ const multilineMatcher = new RegExp(fallbackInvocationLineMatcher.source + '.+\\n*{');
45
+ const isHeaderMultiline = multilineMatcher.test(contents);
46
+ // we fallback to another regex if the first one fails
47
+ return (0, generateCode_1.mergeContents)({
48
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions-fallback',
49
+ src: contents,
50
+ newSrc: methodInvocationBlock,
51
+ anchor: fallbackInvocationLineMatcher,
52
+ // new line will be inserted right below matched anchor
53
+ // or two lines, if the `{` is in the new line
54
+ offset: isHeaderMultiline ? 2 : 1,
55
+ comment: '//',
56
+ }).contents;
57
+ }
32
58
  }
33
59
  exports.modifyObjcAppDelegate = modifyObjcAppDelegate;
34
60
  const withFirebaseAppDelegate = config => {
@@ -1,11 +1,16 @@
1
- import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';
1
+ import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';
2
2
  import { mergeContents } from '@expo/config-plugins/build/utils/generateCode';
3
3
  import fs from 'fs';
4
4
 
5
5
  const methodInvocationBlock = `[FIRApp configure];`;
6
- // https://regex101.com/r/Imm3E8/1
6
+ // https://regex101.com/r/mPgaq6/1
7
7
  const methodInvocationLineMatcher =
8
- /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[\[RCTBridge alloc\])/g;
8
+ /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
9
+
10
+ // https://regex101.com/r/nHrTa9/1/
11
+ // if the above regex fails, we can use this one as a fallback:
12
+ const fallbackInvocationLineMatcher =
13
+ /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
9
14
 
10
15
  export function modifyObjcAppDelegate(contents: string): string {
11
16
  // Add import
@@ -22,15 +27,44 @@ export function modifyObjcAppDelegate(contents: string): string {
22
27
  return contents;
23
28
  }
24
29
 
30
+ if (
31
+ !methodInvocationLineMatcher.test(contents) &&
32
+ !fallbackInvocationLineMatcher.test(contents)
33
+ ) {
34
+ WarningAggregator.addWarningIOS(
35
+ '@react-native-firebase/app',
36
+ 'Unable to determine correct Firebase insertion point in AppDelegate.m. Skipping Firebase addition.',
37
+ );
38
+ return contents;
39
+ }
40
+
25
41
  // Add invocation
26
- return mergeContents({
27
- tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
28
- src: contents,
29
- newSrc: methodInvocationBlock,
30
- anchor: methodInvocationLineMatcher,
31
- offset: 0, // new line will be inserted right before matched anchor
32
- comment: '//',
33
- }).contents;
42
+ try {
43
+ return mergeContents({
44
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
45
+ src: contents,
46
+ newSrc: methodInvocationBlock,
47
+ anchor: methodInvocationLineMatcher,
48
+ offset: 0, // new line will be inserted right above matched anchor
49
+ comment: '//',
50
+ }).contents;
51
+ } catch (e: any) {
52
+ // tests if the opening `{` is in the new line
53
+ const multilineMatcher = new RegExp(fallbackInvocationLineMatcher.source + '.+\\n*{');
54
+ const isHeaderMultiline = multilineMatcher.test(contents);
55
+
56
+ // we fallback to another regex if the first one fails
57
+ return mergeContents({
58
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions-fallback',
59
+ src: contents,
60
+ newSrc: methodInvocationBlock,
61
+ anchor: fallbackInvocationLineMatcher,
62
+ // new line will be inserted right below matched anchor
63
+ // or two lines, if the `{` is in the new line
64
+ offset: isHeaderMultiline ? 2 : 1,
65
+ comment: '//',
66
+ }).contents;
67
+ }
34
68
  }
35
69
 
36
70
  export const withFirebaseAppDelegate: ConfigPlugin = config => {