@react-native-firebase/app 13.0.1 → 14.0.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 +23 -0
- package/android/build.gradle +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +1 -1
- package/firebase-schema.json +4 -0
- package/ios/RNFBApp/RNFBVersion.m +1 -1
- package/lib/version.js +1 -1
- package/package.json +7 -7
- package/plugin/build/ios/appDelegate.js +36 -10
- package/plugin/src/ios/appDelegate.ts +45 -11
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,29 @@
|
|
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.0.1](https://github.com/invertase/react-native-firebase/compare/v14.0.0...v14.0.1) (2021-12-15)
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
- **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))
|
11
|
+
|
12
|
+
# [14.0.0](https://github.com/invertase/react-native-firebase/compare/v13.1.1...v14.0.0) (2021-12-14)
|
13
|
+
|
14
|
+
**Note:** Version bump only for package @react-native-firebase/app
|
15
|
+
|
16
|
+
## [13.1.1](https://github.com/invertase/react-native-firebase/compare/v13.1.0...v13.1.1) (2021-12-14)
|
17
|
+
|
18
|
+
### Bug Fixes
|
19
|
+
|
20
|
+
- **deps:** AGP7.0.4, firebase-android-sdk 29.0.2, javascript deps ([55d0a36](https://github.com/invertase/react-native-firebase/commit/55d0a36a0addc54e347f26bb8ee88bb38b0fa4a6))
|
21
|
+
|
22
|
+
# [13.1.0](https://github.com/invertase/react-native-firebase/compare/v13.0.1...v13.1.0) (2021-12-02)
|
23
|
+
|
24
|
+
### Features
|
25
|
+
|
26
|
+
- **android, emulator:** add firebase.json config element to bypass localhost remap ([#5852](https://github.com/invertase/react-native-firebase/issues/5852)) ([ddf3f5f](https://github.com/invertase/react-native-firebase/commit/ddf3f5f43d2c8547879934c3169d3e01c0db44c0))
|
27
|
+
- **sdks:** firebase-ios-sdk 8.10.0 / firebase-android-sdk 29.0.1 ([f6949c9](https://github.com/invertase/react-native-firebase/commit/f6949c9f3669df6d8b3f78bbee97bee2f36b7df3))
|
28
|
+
|
6
29
|
## [13.0.1](https://github.com/invertase/react-native-firebase/compare/v13.0.0...v13.0.1) (2021-11-05)
|
7
30
|
|
8
31
|
### Bug Fixes
|
package/android/build.gradle
CHANGED
package/firebase-schema.json
CHANGED
@@ -105,6 +105,10 @@
|
|
105
105
|
"android_background_activity_names": {
|
106
106
|
"description": "The names (as returned by `getShortClassName()` of Activities used outside the context of react native.\nThese are ignored when determining if the app is in foreground for purposes of calling javascript background handlers",
|
107
107
|
"type": "array"
|
108
|
+
},
|
109
|
+
"android_bypass_emulator_url_remap": {
|
110
|
+
"description": "On android devices, the urls of firebase emulators will be remapped from localhost to 10.0.2.2. If you don't need this behaviour set this fleg to `true`.",
|
111
|
+
"type": "boolean"
|
108
112
|
}
|
109
113
|
}
|
110
114
|
}
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// generated by genversion
|
2
|
-
module.exports = '
|
2
|
+
module.exports = '14.0.1';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/app",
|
3
|
-
"version": "
|
3
|
+
"version": "14.0.1",
|
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.
|
59
|
+
"@expo/config-plugins": "^4.0.12",
|
60
60
|
"opencollective-postinstall": "^2.0.1",
|
61
61
|
"superstruct": "^0.6.2"
|
62
62
|
},
|
@@ -65,19 +65,19 @@
|
|
65
65
|
},
|
66
66
|
"sdkVersions": {
|
67
67
|
"ios": {
|
68
|
-
"firebase": "8.
|
68
|
+
"firebase": "8.10.0"
|
69
69
|
},
|
70
70
|
"android": {
|
71
71
|
"minSdk": 21,
|
72
72
|
"targetSdk": 31,
|
73
73
|
"compileSdk": 31,
|
74
74
|
"buildTools": "30.0.3",
|
75
|
-
"firebase": "29.0.
|
76
|
-
"firebaseCrashlyticsGradle": "2.8.
|
75
|
+
"firebase": "29.0.2",
|
76
|
+
"firebaseCrashlyticsGradle": "2.8.1",
|
77
77
|
"firebasePerfGradle": "1.4.0",
|
78
78
|
"gmsGoogleServicesGradle": "4.3.10",
|
79
|
-
"playServicesAuth": "
|
79
|
+
"playServicesAuth": "20.0.0"
|
80
80
|
}
|
81
81
|
},
|
82
|
-
"gitHead": "
|
82
|
+
"gitHead": "c2f5b82e487ba3c05e10ccafaa8cc09b43cb5811"
|
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/
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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/
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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 => {
|