@react-native-firebase/app 18.7.3 → 18.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +16 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppModule.java +14 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/common/RCTConvertFirebase.java +5 -0
- package/firebase-schema.json +12 -0
- package/ios/RNFBApp/RNFBAppModule.h +2 -0
- package/ios/RNFBApp/RNFBAppModule.m +46 -1
- package/ios/RNFBApp/RNFBSharedUtils.m +5 -0
- package/ios/RNFBApp/RNFBVersion.m +1 -1
- package/ios_config.sh +36 -0
- package/lib/version.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,22 @@
|
|
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
|
+
## [18.9.0](https://github.com/invertase/react-native-firebase/compare/v18.8.0...v18.9.0) (2024-02-21)
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
- **analytics:** add setConsent implementation ([#7629](https://github.com/invertase/react-native-firebase/issues/7629)) ([7816985](https://github.com/invertase/react-native-firebase/commit/78169854f16a2715f5d2657ab08f54d5a4b05281))
|
11
|
+
|
12
|
+
## [18.8.0](https://github.com/invertase/react-native-firebase/compare/v18.7.3...v18.8.0) (2024-01-25)
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
- **auth, authDomain:** implement FirebaseOptions.authDomain on Auth ([a1f4710](https://github.com/invertase/react-native-firebase/commit/a1f471029352b7597d7e83a8c1ea06145768cf89))
|
17
|
+
|
18
|
+
### Bug Fixes
|
19
|
+
|
20
|
+
- **app:** firebase-ios-sdk 10.20.0 / firebase-android-sdk 32.7.1 ([8d3c3a0](https://github.com/invertase/react-native-firebase/commit/8d3c3a02689d8ec7dd7d705adb941808039cdd50))
|
21
|
+
|
6
22
|
## [18.7.3](https://github.com/invertase/react-native-firebase/compare/v18.7.2...v18.7.3) (2023-12-13)
|
7
23
|
|
8
24
|
### Bug Fixes
|
package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppModule.java
CHANGED
@@ -17,6 +17,7 @@ package io.invertase.firebase.app;
|
|
17
17
|
*
|
18
18
|
*/
|
19
19
|
|
20
|
+
import android.util.Log;
|
20
21
|
import com.facebook.react.bridge.Promise;
|
21
22
|
import com.facebook.react.bridge.ReactApplicationContext;
|
22
23
|
import com.facebook.react.bridge.ReactMethod;
|
@@ -38,6 +39,8 @@ import java.util.Map;
|
|
38
39
|
public class ReactNativeFirebaseAppModule extends ReactNativeFirebaseModule {
|
39
40
|
private static final String TAG = "App";
|
40
41
|
|
42
|
+
public static Map<String, String> authDomains = new HashMap<>();
|
43
|
+
|
41
44
|
ReactNativeFirebaseAppModule(ReactApplicationContext reactContext) {
|
42
45
|
super(reactContext, TAG);
|
43
46
|
}
|
@@ -52,11 +55,22 @@ public class ReactNativeFirebaseAppModule extends ReactNativeFirebaseModule {
|
|
52
55
|
public void initializeApp(ReadableMap options, ReadableMap appConfig, Promise promise) {
|
53
56
|
FirebaseApp firebaseApp =
|
54
57
|
RCTConvertFirebase.readableMapToFirebaseApp(options, appConfig, getContext());
|
58
|
+
ReactNativeFirebaseAppModule.configureAuthDomain(
|
59
|
+
appConfig.getString("name"), options.getString("authDomain"));
|
55
60
|
|
56
61
|
WritableMap firebaseAppMap = RCTConvertFirebase.firebaseAppToWritableMap(firebaseApp);
|
57
62
|
promise.resolve(firebaseAppMap);
|
58
63
|
}
|
59
64
|
|
65
|
+
public static void configureAuthDomain(String name, String authDomain) {
|
66
|
+
if (authDomain != null) {
|
67
|
+
Log.d(TAG, name + " custom authDomain " + authDomain);
|
68
|
+
authDomains.put(name, authDomain);
|
69
|
+
} else {
|
70
|
+
authDomains.remove(name);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
60
74
|
@ReactMethod
|
61
75
|
public void setAutomaticDataCollectionEnabled(String appName, Boolean enabled) {
|
62
76
|
FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
|
@@ -25,6 +25,7 @@ import com.facebook.react.bridge.ReadableMap;
|
|
25
25
|
import com.facebook.react.bridge.WritableMap;
|
26
26
|
import com.google.firebase.FirebaseApp;
|
27
27
|
import com.google.firebase.FirebaseOptions;
|
28
|
+
import io.invertase.firebase.app.ReactNativeFirebaseAppModule;
|
28
29
|
import java.util.HashMap;
|
29
30
|
import java.util.List;
|
30
31
|
import java.util.Map;
|
@@ -56,6 +57,10 @@ public class RCTConvertFirebase {
|
|
56
57
|
options.put("messagingSenderId", appOptions.getGcmSenderId());
|
57
58
|
options.put("storageBucket", appOptions.getStorageBucket());
|
58
59
|
|
60
|
+
if (ReactNativeFirebaseAppModule.authDomains.get(name) != null) {
|
61
|
+
options.put("authDomain", ReactNativeFirebaseAppModule.authDomains.get(name));
|
62
|
+
}
|
63
|
+
|
59
64
|
root.put("options", options);
|
60
65
|
root.put("appConfig", appConfig);
|
61
66
|
|
package/firebase-schema.json
CHANGED
@@ -33,6 +33,18 @@
|
|
33
33
|
"description": "For your convenience, on iOS the SDK automatically registers your app with Apple for ad network attribution with SKAdNetwork.\nDefaults to true, include this key as false to disable.",
|
34
34
|
"type": "boolean"
|
35
35
|
},
|
36
|
+
"analytics_default_allow_analytics_storage": {
|
37
|
+
"description": "Enables storage (such as app identifiers) related to analytics, e.g. visit duration.",
|
38
|
+
"type": "boolean"
|
39
|
+
},
|
40
|
+
"analytics_default_allow_ad_storage": {
|
41
|
+
"description": "Enables storage (such as device identifiers) related to advertising.",
|
42
|
+
"type": "boolean"
|
43
|
+
},
|
44
|
+
"analytics_default_allow_ad_user_data": {
|
45
|
+
"description": "Sets consent for sending user data to Google for advertising purposes.",
|
46
|
+
"type": "boolean"
|
47
|
+
},
|
36
48
|
"analytics_default_allow_ad_personalization_signals": {
|
37
49
|
"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'",
|
38
50
|
"type": "boolean"
|
@@ -168,7 +168,7 @@ RCT_EXPORT_METHOD(removeListeners : (NSInteger)count) {
|
|
168
168
|
#pragma mark Firebase App Methods
|
169
169
|
|
170
170
|
RCT_EXPORT_METHOD(initializeApp
|
171
|
-
: (
|
171
|
+
: (NSDictionary *)options appConfig
|
172
172
|
: (NSDictionary *)appConfig resolver
|
173
173
|
: (RCTPromiseResolveBlock)resolve rejecter
|
174
174
|
: (RCTPromiseRejectBlock)reject) {
|
@@ -176,6 +176,44 @@ RCT_EXPORT_METHOD(initializeApp
|
|
176
176
|
FIRApp *firApp;
|
177
177
|
NSString *appName = [appConfig valueForKey:@"name"];
|
178
178
|
|
179
|
+
NSString *appId = [options valueForKey:@"appId"];
|
180
|
+
NSString *messagingSenderId = [options valueForKey:@"messagingSenderId"];
|
181
|
+
FIROptions *firOptions = [[FIROptions alloc] initWithGoogleAppID:appId
|
182
|
+
GCMSenderID:messagingSenderId];
|
183
|
+
firOptions.APIKey = [options valueForKey:@"apiKey"];
|
184
|
+
firOptions.projectID = [options valueForKey:@"projectId"];
|
185
|
+
// kFirebaseOptionsDatabaseUrl
|
186
|
+
if (![[options valueForKey:@"databaseURL"] isEqual:[NSNull null]]) {
|
187
|
+
firOptions.databaseURL = [options valueForKey:@"databaseURL"];
|
188
|
+
}
|
189
|
+
// kFirebaseOptionsStorageBucket
|
190
|
+
if (![[options valueForKey:@"storageBucket"] isEqual:[NSNull null]]) {
|
191
|
+
firOptions.storageBucket = [options valueForKey:@"storageBucket"];
|
192
|
+
}
|
193
|
+
// kFirebaseOptionsDeepLinkURLScheme
|
194
|
+
if (![[options valueForKey:@"deepLinkURLScheme"] isEqual:[NSNull null]]) {
|
195
|
+
firOptions.deepLinkURLScheme = [options valueForKey:@"deepLinkURLScheme"];
|
196
|
+
}
|
197
|
+
// kFirebaseOptionsIosBundleId
|
198
|
+
if (![[options valueForKey:@"iosBundleId"] isEqual:[NSNull null]]) {
|
199
|
+
firOptions.bundleID = [options valueForKey:@"iosBundleId"];
|
200
|
+
}
|
201
|
+
// kFirebaseOptionsIosClientId
|
202
|
+
if (![[options valueForKey:@"iosClientId"] isEqual:[NSNull null]]) {
|
203
|
+
firOptions.clientID = [options valueForKey:@"iosClientId"];
|
204
|
+
}
|
205
|
+
// kFirebaseOptionsAppGroupId
|
206
|
+
if (![[options valueForKey:@"appGroupId"] isEqual:[NSNull null]]) {
|
207
|
+
firOptions.appGroupID = [options valueForKey:@"appGroupId"];
|
208
|
+
}
|
209
|
+
|
210
|
+
if ([options valueForKey:@"authDomain"] != nil) {
|
211
|
+
DLog(@"RNFBAuth app: %@ customAuthDomain: %@", appName, [options valueForKey:@"authDomain"]);
|
212
|
+
if (customAuthDomains == nil) {
|
213
|
+
customAuthDomains = [[NSMutableDictionary alloc] init];
|
214
|
+
}
|
215
|
+
customAuthDomains[appName] = [options valueForKey:@"authDomain"];
|
216
|
+
}
|
179
217
|
@try {
|
180
218
|
if (!appName || [appName isEqualToString:DEFAULT_APP_DISPLAY_NAME]) {
|
181
219
|
[FIRApp configureWithOptions:firOptions];
|
@@ -195,6 +233,13 @@ RCT_EXPORT_METHOD(initializeApp
|
|
195
233
|
});
|
196
234
|
}
|
197
235
|
|
236
|
+
static NSMutableDictionary<NSString *, NSString *> *customAuthDomains;
|
237
|
+
|
238
|
+
+ (NSString *)getCustomDomain:(NSString *)appName {
|
239
|
+
DLog(@"authDomains: %@", customAuthDomains);
|
240
|
+
return customAuthDomains[appName];
|
241
|
+
}
|
242
|
+
|
198
243
|
RCT_EXPORT_METHOD(setLogLevel : (NSString *)logLevel) {
|
199
244
|
int level = FIRLoggerLevelError;
|
200
245
|
if ([logLevel isEqualToString:@"verbose"]) {
|
@@ -16,6 +16,7 @@
|
|
16
16
|
*/
|
17
17
|
|
18
18
|
#import "RNFBSharedUtils.h"
|
19
|
+
#import "RNFBAppModule.h"
|
19
20
|
#import "RNFBJSON.h"
|
20
21
|
#import "RNFBMeta.h"
|
21
22
|
#import "RNFBPreferences.h"
|
@@ -65,6 +66,10 @@ static NSString *const RNFBErrorDomain = @"RNFBErrorDomain";
|
|
65
66
|
firAppOptions[@"clientId"] = firOptions.clientID;
|
66
67
|
firAppOptions[@"androidClientID"] = firOptions.androidClientID;
|
67
68
|
firAppOptions[@"deepLinkUrlScheme"] = firOptions.deepLinkURLScheme;
|
69
|
+
// not in FIROptions API but in JS SDK and project config JSON
|
70
|
+
if ([RNFBAppModule getCustomDomain:name] != nil) {
|
71
|
+
firAppOptions[@"authDomain"] = [RNFBAppModule getCustomDomain:name];
|
72
|
+
}
|
68
73
|
|
69
74
|
firAppDictionary[@"options"] = firAppOptions;
|
70
75
|
firAppDictionary[@"appConfig"] = firAppConfig;
|
package/ios_config.sh
CHANGED
@@ -14,6 +14,18 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
|
+
|
18
|
+
##########################################################################
|
19
|
+
##########################################################################
|
20
|
+
#
|
21
|
+
# NOTE THAT IF YOU CHANGE THIS FILE YOU MUST RUN pod install AFTERWARDS
|
22
|
+
#
|
23
|
+
# This file is installed as an Xcode build script in the project file
|
24
|
+
# by cocoapods, and you will not see your changes until you pod install
|
25
|
+
#
|
26
|
+
##########################################################################
|
27
|
+
##########################################################################
|
28
|
+
|
17
29
|
set -e
|
18
30
|
|
19
31
|
_MAX_LOOKUPS=2;
|
@@ -119,6 +131,30 @@ if [[ ${_SEARCH_RESULT} ]]; then
|
|
119
131
|
_PLIST_ENTRY_VALUES+=("$(jsonBoolToYesNo "$_ANALYTICS_IDFV_COLLECTION")")
|
120
132
|
fi
|
121
133
|
|
134
|
+
# config.analytics_default_allow_analytics_storage
|
135
|
+
_ANALYTICS_STORAGE=$(getFirebaseJsonKeyValue "$_JSON_OUTPUT_RAW" "analytics_default_allow_analytics_storage")
|
136
|
+
if [[ $_ANALYTICS_STORAGE ]]; then
|
137
|
+
_PLIST_ENTRY_KEYS+=("GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE")
|
138
|
+
_PLIST_ENTRY_TYPES+=("bool")
|
139
|
+
_PLIST_ENTRY_VALUES+=("$(jsonBoolToYesNo "$_ANALYTICS_STORAGE")")
|
140
|
+
fi
|
141
|
+
|
142
|
+
# config.analytics_default_allow_ad_storage
|
143
|
+
_ANALYTICS_AD_STORAGE=$(getFirebaseJsonKeyValue "$_JSON_OUTPUT_RAW" "analytics_default_allow_ad_storage")
|
144
|
+
if [[ $_ANALYTICS_AD_STORAGE ]]; then
|
145
|
+
_PLIST_ENTRY_KEYS+=("GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE")
|
146
|
+
_PLIST_ENTRY_TYPES+=("bool")
|
147
|
+
_PLIST_ENTRY_VALUES+=("$(jsonBoolToYesNo "$_ANALYTICS_AD_STORAGE")")
|
148
|
+
fi
|
149
|
+
|
150
|
+
# config.analytics_default_allow_ad_user_data
|
151
|
+
_ANALYTICS_AD_USER_DATA=$(getFirebaseJsonKeyValue "$_JSON_OUTPUT_RAW" "analytics_default_allow_ad_user_data")
|
152
|
+
if [[ $_ANALYTICS_AD_USER_DATA ]]; then
|
153
|
+
_PLIST_ENTRY_KEYS+=("GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA")
|
154
|
+
_PLIST_ENTRY_TYPES+=("bool")
|
155
|
+
_PLIST_ENTRY_VALUES+=("$(jsonBoolToYesNo "$_ANALYTICS_AD_USER_DATA")")
|
156
|
+
fi
|
157
|
+
|
122
158
|
# config.analytics_default_allow_ad_personalization_signals
|
123
159
|
_ANALYTICS_PERSONALIZATION=$(getFirebaseJsonKeyValue "$_JSON_OUTPUT_RAW" "analytics_default_allow_ad_personalization_signals")
|
124
160
|
if [[ $_ANALYTICS_PERSONALIZATION ]]; then
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '18.
|
2
|
+
module.exports = '18.9.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/app",
|
3
|
-
"version": "18.
|
3
|
+
"version": "18.9.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",
|
@@ -73,7 +73,7 @@
|
|
73
73
|
},
|
74
74
|
"sdkVersions": {
|
75
75
|
"ios": {
|
76
|
-
"firebase": "10.
|
76
|
+
"firebase": "10.20.0",
|
77
77
|
"iosTarget": "11.0",
|
78
78
|
"macosTarget": "10.13"
|
79
79
|
},
|
@@ -81,12 +81,12 @@
|
|
81
81
|
"minSdk": 19,
|
82
82
|
"targetSdk": 33,
|
83
83
|
"compileSdk": 33,
|
84
|
-
"firebase": "32.7.
|
84
|
+
"firebase": "32.7.1",
|
85
85
|
"firebaseCrashlyticsGradle": "2.9.9",
|
86
86
|
"firebasePerfGradle": "1.4.2",
|
87
87
|
"gmsGoogleServicesGradle": "4.4.0",
|
88
88
|
"playServicesAuth": "20.7.0"
|
89
89
|
}
|
90
90
|
},
|
91
|
-
"gitHead": "
|
91
|
+
"gitHead": "695265641dcf2243ab9f27b25776f11616225f68"
|
92
92
|
}
|