@react-native-firebase/app-check 23.8.0 → 23.8.2
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 +788 -0
- package/RNFBAppCheck.podspec +50 -0
- package/android/.editorconfig +10 -0
- package/android/build.gradle +110 -0
- package/android/lint.xml +5 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +7 -0
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java +281 -0
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckPackage.java +41 -0
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckProvider.java +97 -0
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckProviderFactory.java +67 -0
- package/app.plugin.js +1 -0
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/web/RNFBAppCheckModule.android.js +3 -2
- package/dist/commonjs/web/RNFBAppCheckModule.android.js.map +1 -2
- package/dist/commonjs/web/RNFBAppCheckModule.ios.js +3 -2
- package/dist/commonjs/web/RNFBAppCheckModule.ios.js.map +1 -2
- package/dist/commonjs/web/RNFBAppCheckModule.js +5 -11
- package/dist/commonjs/web/RNFBAppCheckModule.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/web/RNFBAppCheckModule.android.js +3 -2
- package/dist/module/web/RNFBAppCheckModule.android.js.map +1 -2
- package/dist/module/web/RNFBAppCheckModule.ios.js +3 -2
- package/dist/module/web/RNFBAppCheckModule.ios.js.map +1 -2
- package/dist/module/web/RNFBAppCheckModule.js +6 -7
- package/dist/module/web/RNFBAppCheckModule.js.map +1 -1
- package/dist/typescript/commonjs/lib/namespaced.d.ts +1 -1
- package/dist/typescript/commonjs/lib/version.d.ts +1 -1
- package/dist/typescript/module/lib/namespaced.d.ts +1 -1
- package/dist/typescript/module/lib/version.d.ts +1 -1
- package/ios/RNFBAppCheck/RNFBAppCheckModule.h +30 -0
- package/ios/RNFBAppCheck/RNFBAppCheckModule.m +171 -0
- package/ios/RNFBAppCheck/RNFBAppCheckProvider.h +33 -0
- package/ios/RNFBAppCheck/RNFBAppCheckProvider.m +90 -0
- package/ios/RNFBAppCheck/RNFBAppCheckProviderFactory.h +28 -0
- package/ios/RNFBAppCheck/RNFBAppCheckProviderFactory.m +61 -0
- package/ios/RNFBAppCheck.xcodeproj/project.pbxproj +349 -0
- package/ios/RNFBAppCheck.xcodeproj/xcshareddata/IDETemplateMacros.plist +24 -0
- package/lib/version.ts +1 -1
- package/package.json +5 -15
- package/plugin/build/index.d.ts +3 -0
- package/plugin/build/index.js +15 -0
- package/plugin/build/ios/appDelegate.d.ts +6 -0
- package/plugin/build/ios/appDelegate.js +137 -0
- package/plugin/build/ios/index.d.ts +2 -0
- package/plugin/build/ios/index.js +5 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/lib/web/RNFBAppCheckModule.android.js +0 -2
- package/lib/web/RNFBAppCheckModule.ios.js +0 -2
- package/lib/web/RNFBAppCheckModule.js +0 -95
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present Invertase Limited & Contributors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this library except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#import "RNFBAppCheckProviderFactory.h"
|
|
19
|
+
#import "RNFBApp/RNFBSharedUtils.h"
|
|
20
|
+
|
|
21
|
+
@implementation RNFBAppCheckProviderFactory
|
|
22
|
+
|
|
23
|
+
- (nullable id<FIRAppCheckProvider>)createProviderWithApp:(FIRApp *)app {
|
|
24
|
+
DLog(@"appName %@", app.name);
|
|
25
|
+
|
|
26
|
+
// The SDK may try to call this before we have been configured,
|
|
27
|
+
// so we will configure ourselves and set the provider up as a default to start
|
|
28
|
+
// pre-configure
|
|
29
|
+
if (self.providers == nil) {
|
|
30
|
+
DLog(@"providers dictionary initializing for app %@", app.name);
|
|
31
|
+
self.providers = [NSMutableDictionary new];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (self.providers[app.name] == nil) {
|
|
35
|
+
DLog(@"provider initializing (with default to debug) for app %@", app.name);
|
|
36
|
+
self.providers[app.name] = [RNFBAppCheckProvider new];
|
|
37
|
+
RNFBAppCheckProvider *provider = self.providers[app.name];
|
|
38
|
+
[provider configure:app providerName:@"debug" debugToken:nil];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return self.providers[app.name];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- (void)configure:(FIRApp *)app
|
|
45
|
+
providerName:(NSString *)providerName
|
|
46
|
+
debugToken:(NSString *)debugToken {
|
|
47
|
+
DLog(@"appName/providerName/debugToken: %@/%@/%@", app.name, providerName,
|
|
48
|
+
(debugToken == nil ? @"null" : @"(not shown)"));
|
|
49
|
+
if (self.providers == nil) {
|
|
50
|
+
self.providers = [NSMutableDictionary new];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (self.providers[app.name] == nil) {
|
|
54
|
+
self.providers[app.name] = [RNFBAppCheckProvider new];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
RNFBAppCheckProvider *provider = self.providers[app.name];
|
|
58
|
+
[provider configure:app providerName:providerName debugToken:debugToken];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@end
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 48;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
2744B98621F45429004F8E3F /* RNFBAppCheckModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBAppCheckModule.m */; };
|
|
11
|
+
/* End PBXBuildFile section */
|
|
12
|
+
|
|
13
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
14
|
+
2744B98021F45429004F8E3F /* CopyFiles */ = {
|
|
15
|
+
isa = PBXCopyFilesBuildPhase;
|
|
16
|
+
buildActionMask = 2147483647;
|
|
17
|
+
dstPath = "";
|
|
18
|
+
dstSubfolderSpec = 16;
|
|
19
|
+
files = (
|
|
20
|
+
);
|
|
21
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
22
|
+
};
|
|
23
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
24
|
+
|
|
25
|
+
/* Begin PBXFileReference section */
|
|
26
|
+
2744B98221F45429004F8E3F /* libRNFBAppCheck.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBAppCheck.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
27
|
+
2744B98421F45429004F8E3F /* RNFBAppCheckModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBAppCheckModule.h; path = RNFBAppCheck/RNFBAppCheckModule.h; sourceTree = SOURCE_ROOT; };
|
|
28
|
+
2744B98521F45429004F8E3F /* RNFBAppCheckModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBAppCheckModule.m; path = RNFBAppCheck/RNFBAppCheckModule.m; sourceTree = SOURCE_ROOT; };
|
|
29
|
+
/* End PBXFileReference section */
|
|
30
|
+
|
|
31
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
32
|
+
2744B97F21F45429004F8E3F /* Frameworks */ = {
|
|
33
|
+
isa = PBXFrameworksBuildPhase;
|
|
34
|
+
buildActionMask = 2147483647;
|
|
35
|
+
files = (
|
|
36
|
+
);
|
|
37
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
38
|
+
};
|
|
39
|
+
/* End PBXFrameworksBuildPhase section */
|
|
40
|
+
|
|
41
|
+
/* Begin PBXGroup section */
|
|
42
|
+
2744B97521F452B8004F8E3F /* Products */ = {
|
|
43
|
+
isa = PBXGroup;
|
|
44
|
+
children = (
|
|
45
|
+
2744B98221F45429004F8E3F /* libRNFBAppCheck.a */,
|
|
46
|
+
);
|
|
47
|
+
name = Products;
|
|
48
|
+
sourceTree = "<group>";
|
|
49
|
+
};
|
|
50
|
+
2744B98321F45429004F8E3F /* RNFBAppCheck */ = {
|
|
51
|
+
isa = PBXGroup;
|
|
52
|
+
children = (
|
|
53
|
+
2744B9A121F48736004F8E3F /* converters */,
|
|
54
|
+
2744B98C21F45C64004F8E3F /* common */,
|
|
55
|
+
2744B98421F45429004F8E3F /* RNFBAppCheckModule.h */,
|
|
56
|
+
2744B98521F45429004F8E3F /* RNFBAppCheckModule.m */,
|
|
57
|
+
);
|
|
58
|
+
path = RNFBAppCheck;
|
|
59
|
+
sourceTree = "<group>";
|
|
60
|
+
};
|
|
61
|
+
3323F52AAFE26B7384BE4DE3 = {
|
|
62
|
+
isa = PBXGroup;
|
|
63
|
+
children = (
|
|
64
|
+
2744B98321F45429004F8E3F /* RNFBAppCheck */,
|
|
65
|
+
2744B97521F452B8004F8E3F /* Products */,
|
|
66
|
+
);
|
|
67
|
+
sourceTree = "<group>";
|
|
68
|
+
};
|
|
69
|
+
/* End PBXGroup section */
|
|
70
|
+
|
|
71
|
+
/* Begin PBXNativeTarget section */
|
|
72
|
+
2744B98121F45429004F8E3F /* RNFBAppCheck */ = {
|
|
73
|
+
isa = PBXNativeTarget;
|
|
74
|
+
buildConfigurationList = 2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBAppCheck" */;
|
|
75
|
+
buildPhases = (
|
|
76
|
+
2744B97E21F45429004F8E3F /* Sources */,
|
|
77
|
+
2744B97F21F45429004F8E3F /* Frameworks */,
|
|
78
|
+
2744B98021F45429004F8E3F /* CopyFiles */,
|
|
79
|
+
);
|
|
80
|
+
buildRules = (
|
|
81
|
+
);
|
|
82
|
+
dependencies = (
|
|
83
|
+
);
|
|
84
|
+
name = RNFBAppCheck;
|
|
85
|
+
productName = RNFBAppCheck;
|
|
86
|
+
productReference = 2744B98221F45429004F8E3F /* libRNFBAppCheck.a */;
|
|
87
|
+
productType = "com.apple.product-type.library.static";
|
|
88
|
+
};
|
|
89
|
+
/* End PBXNativeTarget section */
|
|
90
|
+
|
|
91
|
+
/* Begin PBXProject section */
|
|
92
|
+
3323F95273A95DB34F55C6D7 /* Project object */ = {
|
|
93
|
+
isa = PBXProject;
|
|
94
|
+
attributes = {
|
|
95
|
+
CLASSPREFIX = RNFBAppCheck;
|
|
96
|
+
LastUpgradeCheck = 1010;
|
|
97
|
+
ORGANIZATIONNAME = Invertase;
|
|
98
|
+
TargetAttributes = {
|
|
99
|
+
2744B98121F45429004F8E3F = {
|
|
100
|
+
CreatedOnToolsVersion = 10.1;
|
|
101
|
+
ProvisioningStyle = Automatic;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
buildConfigurationList = 3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBAppCheck" */;
|
|
106
|
+
compatibilityVersion = "Xcode 8.0";
|
|
107
|
+
developmentRegion = English;
|
|
108
|
+
hasScannedForEncodings = 0;
|
|
109
|
+
knownRegions = (
|
|
110
|
+
en,
|
|
111
|
+
);
|
|
112
|
+
mainGroup = 3323F52AAFE26B7384BE4DE3;
|
|
113
|
+
productRefGroup = 2744B97521F452B8004F8E3F /* Products */;
|
|
114
|
+
projectDirPath = "";
|
|
115
|
+
projectRoot = "";
|
|
116
|
+
targets = (
|
|
117
|
+
2744B98121F45429004F8E3F /* RNFBAppCheck */,
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
/* End PBXProject section */
|
|
121
|
+
|
|
122
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
123
|
+
2744B97E21F45429004F8E3F /* Sources */ = {
|
|
124
|
+
isa = PBXSourcesBuildPhase;
|
|
125
|
+
buildActionMask = 2147483647;
|
|
126
|
+
files = (
|
|
127
|
+
2744B98621F45429004F8E3F /* RNFBAppCheckModule.m in Sources */,
|
|
128
|
+
);
|
|
129
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
130
|
+
};
|
|
131
|
+
/* End PBXSourcesBuildPhase section */
|
|
132
|
+
|
|
133
|
+
/* Begin XCBuildConfiguration section */
|
|
134
|
+
2744B98921F45429004F8E3F /* Debug */ = {
|
|
135
|
+
isa = XCBuildConfiguration;
|
|
136
|
+
buildSettings = {
|
|
137
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
138
|
+
CLANG_ANALYZER_NONNULL = YES;
|
|
139
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
|
140
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
|
141
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
142
|
+
CLANG_ENABLE_MODULES = YES;
|
|
143
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
144
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
|
145
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
146
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
|
147
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
148
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
|
149
|
+
CODE_SIGN_IDENTITY = "iPhone Developer";
|
|
150
|
+
CODE_SIGN_STYLE = Automatic;
|
|
151
|
+
COPY_PHASE_STRIP = NO;
|
|
152
|
+
DEBUG_INFORMATION_FORMAT = dwarf;
|
|
153
|
+
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
154
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
155
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
156
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
157
|
+
"DEBUG=1",
|
|
158
|
+
"$(inherited)",
|
|
159
|
+
);
|
|
160
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
161
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
162
|
+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
|
163
|
+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
|
164
|
+
MTL_FAST_MATH = YES;
|
|
165
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
166
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
167
|
+
SDKROOT = iphoneos;
|
|
168
|
+
SKIP_INSTALL = YES;
|
|
169
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
170
|
+
};
|
|
171
|
+
name = Debug;
|
|
172
|
+
};
|
|
173
|
+
2744B98A21F45429004F8E3F /* Release */ = {
|
|
174
|
+
isa = XCBuildConfiguration;
|
|
175
|
+
buildSettings = {
|
|
176
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
177
|
+
CLANG_ANALYZER_NONNULL = YES;
|
|
178
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
|
179
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
|
180
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
181
|
+
CLANG_ENABLE_MODULES = YES;
|
|
182
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
183
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
|
184
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
185
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
|
186
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
187
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
|
188
|
+
CODE_SIGN_IDENTITY = "iPhone Developer";
|
|
189
|
+
CODE_SIGN_STYLE = Automatic;
|
|
190
|
+
COPY_PHASE_STRIP = NO;
|
|
191
|
+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
192
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
193
|
+
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
194
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
195
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
196
|
+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
|
197
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
198
|
+
MTL_FAST_MATH = YES;
|
|
199
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
200
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
201
|
+
SDKROOT = iphoneos;
|
|
202
|
+
SKIP_INSTALL = YES;
|
|
203
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
204
|
+
VALIDATE_PRODUCT = YES;
|
|
205
|
+
};
|
|
206
|
+
name = Release;
|
|
207
|
+
};
|
|
208
|
+
3323F77D701E1896E6D239CF /* Release */ = {
|
|
209
|
+
isa = XCBuildConfiguration;
|
|
210
|
+
buildSettings = {
|
|
211
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
212
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
213
|
+
CLANG_WARN_COMMA = YES;
|
|
214
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
215
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
216
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
217
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
218
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
219
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
220
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
221
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
222
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
223
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
224
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
225
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
226
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
227
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
228
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
229
|
+
FRAMEWORK_SEARCH_PATHS = (
|
|
230
|
+
"$(inherited)",
|
|
231
|
+
"${BUILT_PRODUCTS_DIR}/**",
|
|
232
|
+
"${SRCROOT}/../../../ios/Firebase/**",
|
|
233
|
+
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
|
234
|
+
"$(SRCROOT)/../../../ios/Pods/FirebaseAppCheck/Frameworks",
|
|
235
|
+
"$(SRCROOT)/../../../tests/ios/Pods/FirebaseAppCheck/Frameworks",
|
|
236
|
+
);
|
|
237
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
238
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
239
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
240
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
241
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
|
242
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
243
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
244
|
+
HEADER_SEARCH_PATHS = (
|
|
245
|
+
"$(inherited)",
|
|
246
|
+
"$(REACT_SEARCH_PATH)/React/**",
|
|
247
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
248
|
+
"$(SRCROOT)/../../react-native-firebase/ios/**",
|
|
249
|
+
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
|
250
|
+
"${SRCROOT}/../../../ios/Firebase/**",
|
|
251
|
+
"${SRCROOT}/../../../ios/Pods/Headers/Public/**",
|
|
252
|
+
"${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**",
|
|
253
|
+
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
|
254
|
+
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
|
255
|
+
"$(SRCROOT)/../../../packages/app/ios/**",
|
|
256
|
+
);
|
|
257
|
+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
|
258
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
259
|
+
MACH_O_TYPE = staticlib;
|
|
260
|
+
OTHER_LDFLAGS = "$(inherited)";
|
|
261
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
262
|
+
SKIP_INSTALL = YES;
|
|
263
|
+
};
|
|
264
|
+
name = Release;
|
|
265
|
+
};
|
|
266
|
+
3323F7E33E1559A2B9826720 /* Debug */ = {
|
|
267
|
+
isa = XCBuildConfiguration;
|
|
268
|
+
buildSettings = {
|
|
269
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
270
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
271
|
+
CLANG_WARN_COMMA = YES;
|
|
272
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
273
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
274
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
275
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
276
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
277
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
278
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
279
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
280
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
281
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
282
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
283
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
284
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
285
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
286
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
287
|
+
ENABLE_TESTABILITY = YES;
|
|
288
|
+
FRAMEWORK_SEARCH_PATHS = (
|
|
289
|
+
"$(inherited)",
|
|
290
|
+
"${BUILT_PRODUCTS_DIR}/**",
|
|
291
|
+
"${SRCROOT}/../../../ios/Firebase/**",
|
|
292
|
+
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
|
293
|
+
"$(SRCROOT)/../../../ios/Pods/FirebaseAppCheck/Frameworks",
|
|
294
|
+
);
|
|
295
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
296
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
297
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
298
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
299
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
|
300
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
301
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
302
|
+
HEADER_SEARCH_PATHS = (
|
|
303
|
+
"$(inherited)",
|
|
304
|
+
"$(REACT_SEARCH_PATH)/React/**",
|
|
305
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
306
|
+
"$(SRCROOT)/../../react-native-firebase/ios/**",
|
|
307
|
+
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
|
308
|
+
"${SRCROOT}/../../../ios/Firebase/**",
|
|
309
|
+
"${SRCROOT}/../../../ios/Pods/Headers/Public/**",
|
|
310
|
+
"${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**",
|
|
311
|
+
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
|
312
|
+
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
|
313
|
+
"$(SRCROOT)/../../../packages/app/ios/**",
|
|
314
|
+
);
|
|
315
|
+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
|
316
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
317
|
+
MACH_O_TYPE = staticlib;
|
|
318
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
319
|
+
OTHER_LDFLAGS = "$(inherited)";
|
|
320
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
321
|
+
SKIP_INSTALL = YES;
|
|
322
|
+
};
|
|
323
|
+
name = Debug;
|
|
324
|
+
};
|
|
325
|
+
/* End XCBuildConfiguration section */
|
|
326
|
+
|
|
327
|
+
/* Begin XCConfigurationList section */
|
|
328
|
+
2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBAppCheck" */ = {
|
|
329
|
+
isa = XCConfigurationList;
|
|
330
|
+
buildConfigurations = (
|
|
331
|
+
2744B98921F45429004F8E3F /* Debug */,
|
|
332
|
+
2744B98A21F45429004F8E3F /* Release */,
|
|
333
|
+
);
|
|
334
|
+
defaultConfigurationIsVisible = 0;
|
|
335
|
+
defaultConfigurationName = Release;
|
|
336
|
+
};
|
|
337
|
+
3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBAppCheck" */ = {
|
|
338
|
+
isa = XCConfigurationList;
|
|
339
|
+
buildConfigurations = (
|
|
340
|
+
3323F7E33E1559A2B9826720 /* Debug */,
|
|
341
|
+
3323F77D701E1896E6D239CF /* Release */,
|
|
342
|
+
);
|
|
343
|
+
defaultConfigurationIsVisible = 0;
|
|
344
|
+
defaultConfigurationName = Release;
|
|
345
|
+
};
|
|
346
|
+
/* End XCConfigurationList section */
|
|
347
|
+
};
|
|
348
|
+
rootObject = 3323F95273A95DB34F55C6D7 /* Project object */;
|
|
349
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>FILEHEADER</key>
|
|
6
|
+
<string>
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this library except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*
|
|
22
|
+
*/</string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
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.2';
|
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.2",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "React Native Firebase - App Check",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"appCheck"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@react-native-firebase/app": "23.8.
|
|
30
|
+
"@react-native-firebase/app": "23.8.2",
|
|
31
31
|
"expo": ">=47.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"expo": "^54.0.27",
|
|
35
|
-
"react-native-builder-bob": "^0.40.
|
|
36
|
-
"typescript": "^5.
|
|
35
|
+
"react-native-builder-bob": "^0.40.17",
|
|
36
|
+
"typescript": "^5.9.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"expo": {
|
|
@@ -58,16 +58,6 @@
|
|
|
58
58
|
},
|
|
59
59
|
"./package.json": "./package.json"
|
|
60
60
|
},
|
|
61
|
-
"files": [
|
|
62
|
-
"lib",
|
|
63
|
-
"plugin/src",
|
|
64
|
-
"tsconfig.json",
|
|
65
|
-
"plugin/tsconfig.json",
|
|
66
|
-
"dist",
|
|
67
|
-
"!**/__tests__",
|
|
68
|
-
"!**/__fixtures__",
|
|
69
|
-
"!**/__mocks__"
|
|
70
|
-
],
|
|
71
61
|
"react-native-builder-bob": {
|
|
72
62
|
"source": "lib",
|
|
73
63
|
"output": "dist",
|
|
@@ -96,5 +86,5 @@
|
|
|
96
86
|
"node_modules/",
|
|
97
87
|
"dist/"
|
|
98
88
|
],
|
|
99
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "578c1573d9bcb9a83848f34a08be40c7b5722d9b"
|
|
100
90
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
|
+
const ios_1 = require("./ios");
|
|
5
|
+
/**
|
|
6
|
+
* A config plugin for configuring `@react-native-firebase/app-check`
|
|
7
|
+
*/
|
|
8
|
+
const withRnFirebaseAppCheck = config => {
|
|
9
|
+
return (0, config_plugins_1.withPlugins)(config, [
|
|
10
|
+
// iOS
|
|
11
|
+
ios_1.withFirebaseAppDelegate,
|
|
12
|
+
]);
|
|
13
|
+
};
|
|
14
|
+
const pak = require('@react-native-firebase/app-check/package.json');
|
|
15
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withRnFirebaseAppCheck, pak.name, pak.version);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
|
|
3
|
+
export declare function modifyObjcAppDelegate(contents: string): string;
|
|
4
|
+
export declare function modifySwiftAppDelegate(contents: string): string;
|
|
5
|
+
export declare function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile): Promise<void>;
|
|
6
|
+
export declare const withFirebaseAppDelegate: ConfigPlugin;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.withFirebaseAppDelegate = void 0;
|
|
7
|
+
exports.modifyObjcAppDelegate = modifyObjcAppDelegate;
|
|
8
|
+
exports.modifySwiftAppDelegate = modifySwiftAppDelegate;
|
|
9
|
+
exports.modifyAppDelegateAsync = modifyAppDelegateAsync;
|
|
10
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
11
|
+
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
12
|
+
const fs_1 = __importDefault(require("fs"));
|
|
13
|
+
const methodInvocationBlock = `[RNFBAppCheckModule sharedInstance];`;
|
|
14
|
+
// https://regex101.com/r/mPgaq6/1
|
|
15
|
+
const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*@\"([^"]*)\";)|(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
|
|
16
|
+
// https://regex101.com/r/nHrTa9/1/
|
|
17
|
+
// if the above regex fails, we can use this one as a fallback:
|
|
18
|
+
const fallbackInvocationLineMatcher = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
|
|
19
|
+
function modifyObjcAppDelegate(contents) {
|
|
20
|
+
// Add import
|
|
21
|
+
if (!contents.includes('#import <RNFBAppCheckModule.h>')) {
|
|
22
|
+
contents = contents.replace(/#import "AppDelegate.h"/g, `#import "AppDelegate.h"
|
|
23
|
+
#import <RNFBAppCheckModule.h>`);
|
|
24
|
+
}
|
|
25
|
+
// To avoid potential issues with existing changes from older plugin versions
|
|
26
|
+
if (contents.includes(methodInvocationBlock)) {
|
|
27
|
+
return contents;
|
|
28
|
+
}
|
|
29
|
+
if (!methodInvocationLineMatcher.test(contents) &&
|
|
30
|
+
!fallbackInvocationLineMatcher.test(contents)) {
|
|
31
|
+
config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app-check', 'Unable to determine correct Firebase insertion point in AppDelegate.m. Skipping Firebase addition.');
|
|
32
|
+
return contents;
|
|
33
|
+
}
|
|
34
|
+
// Add invocation
|
|
35
|
+
try {
|
|
36
|
+
return (0, generateCode_1.mergeContents)({
|
|
37
|
+
tag: '@react-native-firebase/app-check-didFinishLaunchingWithOptions',
|
|
38
|
+
src: contents,
|
|
39
|
+
newSrc: methodInvocationBlock,
|
|
40
|
+
anchor: methodInvocationLineMatcher,
|
|
41
|
+
offset: 0, // new line will be inserted right above matched anchor
|
|
42
|
+
comment: '//',
|
|
43
|
+
}).contents;
|
|
44
|
+
}
|
|
45
|
+
catch (_) {
|
|
46
|
+
// tests if the opening `{` is in the new line
|
|
47
|
+
const multilineMatcher = new RegExp(fallbackInvocationLineMatcher.source + '.+\\n*{');
|
|
48
|
+
const isHeaderMultiline = multilineMatcher.test(contents);
|
|
49
|
+
// we fallback to another regex if the first one fails
|
|
50
|
+
return (0, generateCode_1.mergeContents)({
|
|
51
|
+
tag: '@react-native-firebase/app-didFinishLaunchingWithOptions-fallback',
|
|
52
|
+
src: contents,
|
|
53
|
+
newSrc: methodInvocationBlock,
|
|
54
|
+
anchor: fallbackInvocationLineMatcher,
|
|
55
|
+
// new line will be inserted right below matched anchor
|
|
56
|
+
// or two lines, if the `{` is in the new line
|
|
57
|
+
offset: isHeaderMultiline ? 2 : 1,
|
|
58
|
+
comment: '//',
|
|
59
|
+
}).contents;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function modifySwiftAppDelegate(contents) {
|
|
63
|
+
// Add imports for Swift
|
|
64
|
+
if (!contents.includes('import RNFBAppCheck')) {
|
|
65
|
+
// Try to add after FirebaseCore if it exists
|
|
66
|
+
if (contents.includes('import FirebaseCore')) {
|
|
67
|
+
contents = contents.replace(/import FirebaseCore/g, `import FirebaseCore
|
|
68
|
+
import RNFBAppCheck`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
// Otherwise add after Expo
|
|
72
|
+
contents = contents.replace(/import Expo/g, `import Expo
|
|
73
|
+
import RNFBAppCheck`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Check if App Check code is already added to avoid duplication
|
|
77
|
+
if (contents.includes('RNFBAppCheckModule.sharedInstance()')) {
|
|
78
|
+
return contents;
|
|
79
|
+
}
|
|
80
|
+
// Find the Firebase initialization end line to insert after
|
|
81
|
+
const firebaseLine = '// @generated end @react-native-firebase/app-didFinishLaunchingWithOptions';
|
|
82
|
+
if (contents.includes(firebaseLine)) {
|
|
83
|
+
// Insert right after Firebase initialization
|
|
84
|
+
return contents.replace(firebaseLine, `${firebaseLine}
|
|
85
|
+
RNFBAppCheckModule.sharedInstance()
|
|
86
|
+
FirebaseApp.configure()
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
// If Firebase initialization block not found, add both Firebase and App Check initialization
|
|
90
|
+
// This is to make sure Firebase is initialized before App Check
|
|
91
|
+
const methodInvocationBlock = `RNFBAppCheckModule.sharedInstance()
|
|
92
|
+
FirebaseApp.configure()`;
|
|
93
|
+
const methodInvocationLineMatcher = /(?:factory\.startReactNative\()/;
|
|
94
|
+
if (!methodInvocationLineMatcher.test(contents)) {
|
|
95
|
+
config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app-check', 'Unable to determine correct insertion point in AppDelegate.swift. Skipping App Check addition.');
|
|
96
|
+
return contents;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
return (0, generateCode_1.mergeContents)({
|
|
100
|
+
tag: '@react-native-firebase/app-check',
|
|
101
|
+
src: contents,
|
|
102
|
+
newSrc: methodInvocationBlock,
|
|
103
|
+
anchor: methodInvocationLineMatcher,
|
|
104
|
+
offset: 0,
|
|
105
|
+
comment: '//',
|
|
106
|
+
}).contents;
|
|
107
|
+
}
|
|
108
|
+
catch (_e) {
|
|
109
|
+
config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app-check', 'Failed to insert App Check initialization code.');
|
|
110
|
+
return contents;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async function modifyAppDelegateAsync(appDelegateFileInfo) {
|
|
114
|
+
const { language, path, contents } = appDelegateFileInfo;
|
|
115
|
+
let newContents;
|
|
116
|
+
if (['objc', 'objcpp'].includes(language)) {
|
|
117
|
+
newContents = modifyObjcAppDelegate(contents);
|
|
118
|
+
}
|
|
119
|
+
else if (language === 'swift') {
|
|
120
|
+
newContents = modifySwiftAppDelegate(contents);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
|
|
124
|
+
}
|
|
125
|
+
await fs_1.default.promises.writeFile(path, newContents);
|
|
126
|
+
}
|
|
127
|
+
const withFirebaseAppDelegate = config => {
|
|
128
|
+
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
129
|
+
'ios',
|
|
130
|
+
async (config) => {
|
|
131
|
+
const fileInfo = config_plugins_1.IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
|
|
132
|
+
await modifyAppDelegateAsync(fileInfo);
|
|
133
|
+
return config;
|
|
134
|
+
},
|
|
135
|
+
]);
|
|
136
|
+
};
|
|
137
|
+
exports.withFirebaseAppDelegate = withFirebaseAppDelegate;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withFirebaseAppDelegate = void 0;
|
|
4
|
+
const appDelegate_1 = require("./appDelegate");
|
|
5
|
+
Object.defineProperty(exports, "withFirebaseAppDelegate", { enumerable: true, get: function () { return appDelegate_1.withFirebaseAppDelegate; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/index.ts","./src/ios/appDelegate.ts","./src/ios/index.ts"],"version":"5.9.3"}
|