@react-native-firebase/app-check 23.8.4 → 23.8.5
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 +6 -0
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/namespaced.d.ts +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/lib/version.ts +1 -1
- package/package.json +3 -3
- package/plugin/build/ios/appDelegate.d.ts +3 -1
- package/plugin/build/ios/appDelegate.js +40 -16
- package/plugin/src/ios/appDelegate.ts +42 -21
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
## [23.8.5](https://github.com/invertase/react-native-firebase/compare/v23.8.4...v23.8.5) (2026-01-31)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **app-check:** use bridging header instead of Swift module import ([#8867](https://github.com/invertase/react-native-firebase/issues/8867)) ([320ba01](https://github.com/invertase/react-native-firebase/commit/320ba0104f2260a9a1645b70249f3b2e5a2f6358)), closes [#8700](https://github.com/invertase/react-native-firebase/issues/8700) [#8757](https://github.com/invertase/react-native-firebase/issues/8757)
|
|
11
|
+
|
|
6
12
|
## [23.8.4](https://github.com/invertase/react-native-firebase/compare/v23.8.3...v23.8.4) (2026-01-24)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/dist/module/version.js
CHANGED
|
@@ -5,7 +5,7 @@ export declare class CustomProvider implements AppCheckProvider {
|
|
|
5
5
|
constructor(_customProviderOptions: CustomProviderOptions);
|
|
6
6
|
getToken(): Promise<import(".").AppCheckToken>;
|
|
7
7
|
}
|
|
8
|
-
export declare const SDK_VERSION = "23.8.
|
|
8
|
+
export declare const SDK_VERSION = "23.8.5";
|
|
9
9
|
type AppCheckNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<AppCheck, AppCheckStatics> & {
|
|
10
10
|
appCheck: ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<AppCheck, AppCheckStatics>;
|
|
11
11
|
firebase: ReactNativeFirebase.Module;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "23.8.
|
|
1
|
+
export declare const version = "23.8.5";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '23.8.
|
|
2
|
+
export const version = '23.8.5';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/app-check",
|
|
3
|
-
"version": "23.8.
|
|
3
|
+
"version": "23.8.5",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "React Native Firebase - App Check",
|
|
6
6
|
"main": "./dist/module/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"appCheck"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@react-native-firebase/app": "23.8.
|
|
29
|
+
"@react-native-firebase/app": "23.8.5",
|
|
30
30
|
"expo": ">=47.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"node_modules/",
|
|
75
75
|
"dist/"
|
|
76
76
|
],
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "93815b11aef9f02c24649212771ecaaf1b230ae7"
|
|
78
78
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
|
|
3
3
|
export declare function modifyObjcAppDelegate(contents: string): string;
|
|
4
|
+
export declare function modifySwiftBridgingHeader(projectRoot: string): void;
|
|
5
|
+
export declare function modifySwiftBridgingHeaderContents(contents: string): string;
|
|
4
6
|
export declare function modifySwiftAppDelegate(contents: string): string;
|
|
5
|
-
export declare function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile): Promise<void>;
|
|
7
|
+
export declare function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile, projectRoot?: string): Promise<void>;
|
|
6
8
|
export declare const withFirebaseAppDelegate: ConfigPlugin;
|
|
@@ -5,11 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.withFirebaseAppDelegate = void 0;
|
|
7
7
|
exports.modifyObjcAppDelegate = modifyObjcAppDelegate;
|
|
8
|
+
exports.modifySwiftBridgingHeader = modifySwiftBridgingHeader;
|
|
9
|
+
exports.modifySwiftBridgingHeaderContents = modifySwiftBridgingHeaderContents;
|
|
8
10
|
exports.modifySwiftAppDelegate = modifySwiftAppDelegate;
|
|
9
11
|
exports.modifyAppDelegateAsync = modifyAppDelegateAsync;
|
|
10
12
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
11
13
|
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
12
14
|
const fs_1 = __importDefault(require("fs"));
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
13
16
|
const methodInvocationBlock = `[RNFBAppCheckModule sharedInstance];`;
|
|
14
17
|
// https://regex101.com/r/mPgaq6/1
|
|
15
18
|
const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*@\"([^"]*)\";)|(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
|
|
@@ -59,20 +62,38 @@ function modifyObjcAppDelegate(contents) {
|
|
|
59
62
|
}).contents;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
|
-
function
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
function modifySwiftBridgingHeader(projectRoot) {
|
|
66
|
+
// RNFBAppCheck is an Obj-C pod without a Swift module map, so
|
|
67
|
+
// `import RNFBAppCheck` in Swift fails. Instead, expose the
|
|
68
|
+
// Obj-C header via the bridging header.
|
|
69
|
+
const iosDir = path_1.default.join(projectRoot, 'ios');
|
|
70
|
+
if (!fs_1.default.existsSync(iosDir))
|
|
71
|
+
return;
|
|
72
|
+
// Find the bridging header (ProjectName-Bridging-Header.h)
|
|
73
|
+
const entries = fs_1.default.readdirSync(iosDir, { withFileTypes: true });
|
|
74
|
+
for (const entry of entries) {
|
|
75
|
+
if (!entry.isDirectory())
|
|
76
|
+
continue;
|
|
77
|
+
const bridgingHeader = path_1.default.join(iosDir, entry.name, `${entry.name}-Bridging-Header.h`);
|
|
78
|
+
if (fs_1.default.existsSync(bridgingHeader)) {
|
|
79
|
+
let contents = fs_1.default.readFileSync(bridgingHeader, 'utf-8');
|
|
80
|
+
contents = modifySwiftBridgingHeaderContents(contents);
|
|
81
|
+
fs_1.default.writeFileSync(bridgingHeader, contents);
|
|
82
|
+
break;
|
|
74
83
|
}
|
|
75
84
|
}
|
|
85
|
+
}
|
|
86
|
+
function modifySwiftBridgingHeaderContents(contents) {
|
|
87
|
+
if (!contents.includes('#import <RNFBAppCheckModule.h>')) {
|
|
88
|
+
contents += '\n#import <RNFBAppCheckModule.h>\n';
|
|
89
|
+
}
|
|
90
|
+
return contents;
|
|
91
|
+
}
|
|
92
|
+
function modifySwiftAppDelegate(contents) {
|
|
93
|
+
// Remove any previously added `import RNFBAppCheck` since the pod
|
|
94
|
+
// is Obj-C only and doesn't produce a Swift module. The class is
|
|
95
|
+
// made available to Swift via the bridging header instead.
|
|
96
|
+
contents = contents.replace(/import RNFBAppCheck\n/g, '');
|
|
76
97
|
// Check if App Check code is already added to avoid duplication
|
|
77
98
|
if (contents.includes('RNFBAppCheckModule.sharedInstance()')) {
|
|
78
99
|
return contents;
|
|
@@ -110,26 +131,29 @@ import RNFBAppCheck`);
|
|
|
110
131
|
return contents;
|
|
111
132
|
}
|
|
112
133
|
}
|
|
113
|
-
async function modifyAppDelegateAsync(appDelegateFileInfo) {
|
|
114
|
-
const { language, path, contents } = appDelegateFileInfo;
|
|
134
|
+
async function modifyAppDelegateAsync(appDelegateFileInfo, projectRoot) {
|
|
135
|
+
const { language, path: filePath, contents } = appDelegateFileInfo;
|
|
115
136
|
let newContents;
|
|
116
137
|
if (['objc', 'objcpp'].includes(language)) {
|
|
117
138
|
newContents = modifyObjcAppDelegate(contents);
|
|
118
139
|
}
|
|
119
140
|
else if (language === 'swift') {
|
|
120
141
|
newContents = modifySwiftAppDelegate(contents);
|
|
142
|
+
if (projectRoot) {
|
|
143
|
+
modifySwiftBridgingHeader(projectRoot);
|
|
144
|
+
}
|
|
121
145
|
}
|
|
122
146
|
else {
|
|
123
147
|
throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
|
|
124
148
|
}
|
|
125
|
-
await fs_1.default.promises.writeFile(
|
|
149
|
+
await fs_1.default.promises.writeFile(filePath, newContents);
|
|
126
150
|
}
|
|
127
151
|
const withFirebaseAppDelegate = config => {
|
|
128
152
|
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
129
153
|
'ios',
|
|
130
154
|
async (config) => {
|
|
131
155
|
const fileInfo = config_plugins_1.IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
|
|
132
|
-
await modifyAppDelegateAsync(fileInfo);
|
|
156
|
+
await modifyAppDelegateAsync(fileInfo, config.modRequest.projectRoot);
|
|
133
157
|
return config;
|
|
134
158
|
},
|
|
135
159
|
]);
|
|
@@ -2,6 +2,7 @@ import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@e
|
|
|
2
2
|
import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
|
|
3
3
|
import { mergeContents } from '@expo/config-plugins/build/utils/generateCode';
|
|
4
4
|
import fs from 'fs';
|
|
5
|
+
import path from 'path';
|
|
5
6
|
|
|
6
7
|
const methodInvocationBlock = `[RNFBAppCheckModule sharedInstance];`;
|
|
7
8
|
// https://regex101.com/r/mPgaq6/1
|
|
@@ -68,25 +69,39 @@ export function modifyObjcAppDelegate(contents: string): string {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
export function
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
72
|
+
export function modifySwiftBridgingHeader(projectRoot: string): void {
|
|
73
|
+
// RNFBAppCheck is an Obj-C pod without a Swift module map, so
|
|
74
|
+
// `import RNFBAppCheck` in Swift fails. Instead, expose the
|
|
75
|
+
// Obj-C header via the bridging header.
|
|
76
|
+
const iosDir = path.join(projectRoot, 'ios');
|
|
77
|
+
if (!fs.existsSync(iosDir)) return;
|
|
78
|
+
|
|
79
|
+
// Find the bridging header (ProjectName-Bridging-Header.h)
|
|
80
|
+
const entries = fs.readdirSync(iosDir, { withFileTypes: true });
|
|
81
|
+
for (const entry of entries) {
|
|
82
|
+
if (!entry.isDirectory()) continue;
|
|
83
|
+
const bridgingHeader = path.join(iosDir, entry.name, `${entry.name}-Bridging-Header.h`);
|
|
84
|
+
if (fs.existsSync(bridgingHeader)) {
|
|
85
|
+
let contents = fs.readFileSync(bridgingHeader, 'utf-8');
|
|
86
|
+
contents = modifySwiftBridgingHeaderContents(contents);
|
|
87
|
+
fs.writeFileSync(bridgingHeader, contents);
|
|
88
|
+
break;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function modifySwiftBridgingHeaderContents(contents: string): string {
|
|
94
|
+
if (!contents.includes('#import <RNFBAppCheckModule.h>')) {
|
|
95
|
+
contents += '\n#import <RNFBAppCheckModule.h>\n';
|
|
96
|
+
}
|
|
97
|
+
return contents;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function modifySwiftAppDelegate(contents: string): string {
|
|
101
|
+
// Remove any previously added `import RNFBAppCheck` since the pod
|
|
102
|
+
// is Obj-C only and doesn't produce a Swift module. The class is
|
|
103
|
+
// made available to Swift via the bridging header instead.
|
|
104
|
+
contents = contents.replace(/import RNFBAppCheck\n/g, '');
|
|
90
105
|
|
|
91
106
|
// Check if App Check code is already added to avoid duplication
|
|
92
107
|
if (contents.includes('RNFBAppCheckModule.sharedInstance()')) {
|
|
@@ -140,19 +155,25 @@ import RNFBAppCheck`,
|
|
|
140
155
|
}
|
|
141
156
|
}
|
|
142
157
|
|
|
143
|
-
export async function modifyAppDelegateAsync(
|
|
144
|
-
|
|
158
|
+
export async function modifyAppDelegateAsync(
|
|
159
|
+
appDelegateFileInfo: AppDelegateProjectFile,
|
|
160
|
+
projectRoot?: string,
|
|
161
|
+
) {
|
|
162
|
+
const { language, path: filePath, contents } = appDelegateFileInfo;
|
|
145
163
|
|
|
146
164
|
let newContents;
|
|
147
165
|
if (['objc', 'objcpp'].includes(language)) {
|
|
148
166
|
newContents = modifyObjcAppDelegate(contents);
|
|
149
167
|
} else if (language === 'swift') {
|
|
150
168
|
newContents = modifySwiftAppDelegate(contents);
|
|
169
|
+
if (projectRoot) {
|
|
170
|
+
modifySwiftBridgingHeader(projectRoot);
|
|
171
|
+
}
|
|
151
172
|
} else {
|
|
152
173
|
throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
|
|
153
174
|
}
|
|
154
175
|
|
|
155
|
-
await fs.promises.writeFile(
|
|
176
|
+
await fs.promises.writeFile(filePath, newContents);
|
|
156
177
|
}
|
|
157
178
|
|
|
158
179
|
export const withFirebaseAppDelegate: ConfigPlugin = config => {
|
|
@@ -160,7 +181,7 @@ export const withFirebaseAppDelegate: ConfigPlugin = config => {
|
|
|
160
181
|
'ios',
|
|
161
182
|
async config => {
|
|
162
183
|
const fileInfo = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
|
|
163
|
-
await modifyAppDelegateAsync(fileInfo);
|
|
184
|
+
await modifyAppDelegateAsync(fileInfo, config.modRequest.projectRoot);
|
|
164
185
|
return config;
|
|
165
186
|
},
|
|
166
187
|
]);
|