@react-native-firebase/app 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.
Files changed (101) hide show
  1. package/CHANGELOG.md +1547 -0
  2. package/RNFBApp.podspec +49 -0
  3. package/android/.editorconfig +10 -0
  4. package/android/build.gradle +129 -0
  5. package/android/firebase-json.gradle +73 -0
  6. package/android/gradle.properties +2 -0
  7. package/android/lint.xml +5 -0
  8. package/android/settings.gradle +1 -0
  9. package/android/src/main/AndroidManifest.xml +24 -0
  10. package/android/src/main/java/io/invertase/firebase/app/.gitkeep +0 -0
  11. package/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.java +124 -0
  12. package/android/src/main/java/io/invertase/firebase/common/UniversalFirebaseModule.java +62 -0
  13. package/android/src/main/java/io/invertase/firebase/common/UniversalFirebasePreferences.java +91 -0
  14. package/android/src/main/java/io/invertase/firebase/interfaces/.gitkeep +0 -0
  15. package/android/src/reactnative/AndroidManifest.xml +2 -0
  16. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseApp.java +46 -0
  17. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppInitProvider.java +22 -0
  18. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppModule.java +186 -0
  19. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackage.java +49 -0
  20. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppRegistrar.java +35 -0
  21. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +22 -0
  22. package/android/src/reactnative/java/io/invertase/firebase/common/RCTConvertFirebase.java +191 -0
  23. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEvent.java +53 -0
  24. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java +151 -0
  25. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java +78 -0
  26. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseJSON.java +107 -0
  27. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseMeta.java +93 -0
  28. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java +146 -0
  29. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebasePreferences.java +88 -0
  30. package/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.java +440 -0
  31. package/android/src/reactnative/java/io/invertase/firebase/interfaces/ContextProvider.java +30 -0
  32. package/android/src/reactnative/java/io/invertase/firebase/interfaces/NativeError.java +32 -0
  33. package/android/src/reactnative/java/io/invertase/firebase/interfaces/NativeEvent.java +28 -0
  34. package/android/src/reactnative/java/io/invertase/firebase/utils/ReactNativeFirebaseUtilsModule.java +191 -0
  35. package/app.plugin.js +1 -0
  36. package/dist/commonjs/version.js +1 -1
  37. package/dist/module/version.js +1 -1
  38. package/dist/typescript/commonjs/lib/modular.d.ts +1 -1
  39. package/dist/typescript/commonjs/lib/version.d.ts +1 -1
  40. package/dist/typescript/module/lib/modular.d.ts +1 -1
  41. package/dist/typescript/module/lib/version.d.ts +1 -1
  42. package/firebase-schema.json +149 -0
  43. package/firebase_json.rb +72 -0
  44. package/ios/RNFBApp/RCTConvert+FIRApp.h +23 -0
  45. package/ios/RNFBApp/RCTConvert+FIRApp.m +31 -0
  46. package/ios/RNFBApp/RCTConvert+FIROptions.h +23 -0
  47. package/ios/RNFBApp/RCTConvert+FIROptions.m +36 -0
  48. package/ios/RNFBApp/RNFBAppModule.h +28 -0
  49. package/ios/RNFBApp/RNFBAppModule.m +305 -0
  50. package/ios/RNFBApp/RNFBJSON.h +36 -0
  51. package/ios/RNFBApp/RNFBJSON.m +99 -0
  52. package/ios/RNFBApp/RNFBMeta.h +30 -0
  53. package/ios/RNFBApp/RNFBMeta.m +61 -0
  54. package/ios/RNFBApp/RNFBNullSentinelInterceptor.h +47 -0
  55. package/ios/RNFBApp/RNFBNullSentinelInterceptor.m +74 -0
  56. package/ios/RNFBApp/RNFBPreferences.h +44 -0
  57. package/ios/RNFBApp/RNFBPreferences.m +94 -0
  58. package/ios/RNFBApp/RNFBRCTEventEmitter.h +73 -0
  59. package/ios/RNFBApp/RNFBRCTEventEmitter.m +151 -0
  60. package/ios/RNFBApp/RNFBSharedUtils.h +67 -0
  61. package/ios/RNFBApp/RNFBSharedUtils.m +285 -0
  62. package/ios/RNFBApp/RNFBUtilsModule.h +30 -0
  63. package/ios/RNFBApp/RNFBUtilsModule.m +100 -0
  64. package/ios/RNFBApp/RNFBVersion.h +20 -0
  65. package/ios/RNFBApp/RNFBVersion.m +21 -0
  66. package/ios/RNFBApp.xcodeproj/project.pbxproj +411 -0
  67. package/ios/RNFBApp.xcodeproj/xcshareddata/IDETemplateMacros.plist +24 -0
  68. package/ios_config.sh +269 -0
  69. package/lib/version.ts +1 -1
  70. package/package.json +4 -11
  71. package/plugin/build/android/applyPlugin.d.ts +6 -0
  72. package/plugin/build/android/applyPlugin.js +29 -0
  73. package/plugin/build/android/buildscriptDependency.d.ts +6 -0
  74. package/plugin/build/android/buildscriptDependency.js +31 -0
  75. package/plugin/build/android/constants.d.ts +4 -0
  76. package/plugin/build/android/constants.js +8 -0
  77. package/plugin/build/android/copyGoogleServices.d.ts +5 -0
  78. package/plugin/build/android/copyGoogleServices.js +33 -0
  79. package/plugin/build/android/index.d.ts +4 -0
  80. package/plugin/build/android/index.js +9 -0
  81. package/plugin/build/index.d.ts +3 -0
  82. package/plugin/build/index.js +21 -0
  83. package/plugin/build/ios/appDelegate.d.ts +6 -0
  84. package/plugin/build/ios/appDelegate.js +116 -0
  85. package/plugin/build/ios/googleServicesPlist.d.ts +7 -0
  86. package/plugin/build/ios/googleServicesPlist.js +42 -0
  87. package/plugin/build/ios/index.d.ts +3 -0
  88. package/plugin/build/ios/index.js +7 -0
  89. package/plugin/src/android/applyPlugin.ts +30 -0
  90. package/plugin/src/android/buildscriptDependency.ts +33 -0
  91. package/plugin/src/android/constants.ts +7 -0
  92. package/plugin/src/android/copyGoogleServices.ts +36 -0
  93. package/plugin/src/android/index.ts +5 -0
  94. package/plugin/src/index.ts +27 -0
  95. package/plugin/src/ios/appDelegate.ts +140 -0
  96. package/plugin/src/ios/googleServicesPlist.ts +55 -0
  97. package/plugin/src/ios/index.ts +4 -0
  98. package/plugin/tsconfig.json +9 -0
  99. package/plugin/tsconfig.tsbuildinfo +1 -0
  100. package/react-native.config.js +19 -0
  101. package/tsconfig.json +10 -0
@@ -0,0 +1,191 @@
1
+ package io.invertase.firebase.utils;
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import android.app.Activity;
21
+ import android.content.Context;
22
+ import android.content.IntentSender;
23
+ import android.os.Build;
24
+ import android.os.Environment;
25
+ import android.provider.Settings;
26
+ import android.util.Log;
27
+ import com.facebook.react.bridge.*;
28
+ import com.google.android.gms.common.ConnectionResult;
29
+ import com.google.android.gms.common.GoogleApiAvailability;
30
+ import io.invertase.firebase.app.ReactNativeFirebaseApp;
31
+ import io.invertase.firebase.common.ReactNativeFirebaseModule;
32
+ import java.io.File;
33
+ import java.util.HashMap;
34
+ import java.util.Map;
35
+
36
+ public class ReactNativeFirebaseUtilsModule extends ReactNativeFirebaseModule {
37
+ private static final String TAG = "Utils";
38
+ private static final String KEY_MAIN_BUNDLE = "MAIN_BUNDLE";
39
+ private static final String KEY_DOCUMENT_DIRECTORY = "DOCUMENT_DIRECTORY";
40
+ private static final String KEY_LIBRARY_DIRECTORY = "LIBRARY_DIRECTORY";
41
+ private static final String KEY_EXTERNAL_DIRECTORY = "EXTERNAL_DIRECTORY";
42
+ private static final String KEY_EXT_STORAGE_DIRECTORY = "EXTERNAL_STORAGE_DIRECTORY";
43
+ private static final String KEY_PICS_DIRECTORY = "PICTURES_DIRECTORY";
44
+ private static final String KEY_MOVIES_DIRECTORY = "MOVIES_DIRECTORY";
45
+ private static final String KEY_TEMP_DIRECTORY = "TEMP_DIRECTORY";
46
+ private static final String KEY_CACHE_DIRECTORY = "CACHES_DIRECTORY";
47
+ private static final String FIREBASE_TEST_LAB = "firebase.test.lab";
48
+
49
+ public ReactNativeFirebaseUtilsModule(ReactApplicationContext reactContext) {
50
+ super(reactContext, TAG);
51
+ }
52
+
53
+ /**
54
+ * Is this app running in Firebase Test Lab
55
+ *
56
+ * @return Boolean
57
+ */
58
+ private static Boolean isRunningInTestLab() {
59
+ String testLabSetting =
60
+ Settings.System.getString(
61
+ ReactNativeFirebaseApp.getApplicationContext().getContentResolver(), FIREBASE_TEST_LAB);
62
+
63
+ return "true".equals(testLabSetting);
64
+ }
65
+
66
+ @ReactMethod
67
+ public void androidGetPlayServicesStatus(Promise promise) {
68
+ promise.resolve(getPlayServicesStatusMap());
69
+ }
70
+
71
+ /** Prompt the device user to update play services */
72
+ @ReactMethod
73
+ public void androidPromptForPlayServices() {
74
+ int status = isGooglePlayServicesAvailable();
75
+ GoogleApiAvailability gapi = GoogleApiAvailability.getInstance();
76
+
77
+ if (status != ConnectionResult.SUCCESS && gapi.isUserResolvableError(status)) {
78
+ Activity activity = getActivity();
79
+ if (activity != null) {
80
+ gapi.getErrorDialog(activity, status, status).show();
81
+ }
82
+ }
83
+ }
84
+
85
+ /** Prompt the device user to update play services */
86
+ @ReactMethod
87
+ public void androidResolutionForPlayServices() {
88
+ int status = isGooglePlayServicesAvailable();
89
+ ConnectionResult connectionResult = new ConnectionResult(status);
90
+
91
+ if (!connectionResult.isSuccess() && connectionResult.hasResolution()) {
92
+ Activity activity = getActivity();
93
+ if (activity != null) {
94
+ try {
95
+ connectionResult.startResolutionForResult(activity, status);
96
+ } catch (IntentSender.SendIntentException error) {
97
+ Log.d(TAG, "resolutionForPlayServices", error);
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ /** Prompt the device user to update Play Services */
104
+ @ReactMethod
105
+ public void androidMakePlayServicesAvailable() {
106
+ int status = isGooglePlayServicesAvailable();
107
+
108
+ if (status != ConnectionResult.SUCCESS) {
109
+ Activity activity = getActivity();
110
+ if (activity != null) {
111
+ GoogleApiAvailability.getInstance().makeGooglePlayServicesAvailable(activity);
112
+ }
113
+ }
114
+ }
115
+
116
+ private int isGooglePlayServicesAvailable() {
117
+ GoogleApiAvailability gapi = GoogleApiAvailability.getInstance();
118
+ return gapi.isGooglePlayServicesAvailable(getContext());
119
+ }
120
+
121
+ private WritableMap getPlayServicesStatusMap() {
122
+ WritableMap result = Arguments.createMap();
123
+ GoogleApiAvailability gapi = GoogleApiAvailability.getInstance();
124
+
125
+ int status = gapi.isGooglePlayServicesAvailable(getContext());
126
+ result.putInt("status", status);
127
+
128
+ if (status == ConnectionResult.SUCCESS) {
129
+ result.putBoolean("isAvailable", true);
130
+ } else {
131
+ result.putBoolean("isAvailable", false);
132
+ result.putString("error", gapi.getErrorString(status));
133
+ result.putBoolean("isUserResolvableError", gapi.isUserResolvableError(status));
134
+ result.putBoolean("hasResolution", new ConnectionResult(status).hasResolution());
135
+ }
136
+
137
+ return result;
138
+ }
139
+
140
+ @Override
141
+ public Map<String, Object> getConstants() {
142
+ Map<String, Object> constants = new HashMap<>();
143
+
144
+ constants.put("isRunningInTestLab", isRunningInTestLab());
145
+ constants.put("androidPlayServices", getPlayServicesStatusMap());
146
+
147
+ Context context = getReactApplicationContext();
148
+ constants.put(KEY_MAIN_BUNDLE, "");
149
+ constants.put(KEY_LIBRARY_DIRECTORY, context.getFilesDir().getAbsolutePath());
150
+ constants.put(KEY_TEMP_DIRECTORY, context.getCacheDir().getAbsolutePath());
151
+ constants.put(KEY_CACHE_DIRECTORY, context.getCacheDir().getAbsolutePath());
152
+
153
+ File externalDirectory = context.getExternalFilesDir(null);
154
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
155
+ if (externalDirectory != null) {
156
+ constants.put(KEY_DOCUMENT_DIRECTORY, externalDirectory.getAbsolutePath());
157
+ } else {
158
+ // The external directory may be null if it is truly external *and*
159
+ // the device's external storage environment changes. We will use the regular
160
+ // Files directory as a backup and note in the documentation that the directory may
161
+ // vary under rare conditions
162
+ constants.put(KEY_DOCUMENT_DIRECTORY, context.getFilesDir().getAbsolutePath());
163
+ }
164
+ }
165
+
166
+ if (!constants.containsKey(KEY_DOCUMENT_DIRECTORY)) {
167
+ constants.put(KEY_DOCUMENT_DIRECTORY, context.getFilesDir().getAbsolutePath());
168
+ }
169
+
170
+ constants.put(
171
+ KEY_PICS_DIRECTORY,
172
+ Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)
173
+ .getAbsolutePath());
174
+
175
+ constants.put(
176
+ KEY_MOVIES_DIRECTORY,
177
+ Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES)
178
+ .getAbsolutePath());
179
+
180
+ File externalStorageDirectory = Environment.getExternalStorageDirectory();
181
+ if (externalStorageDirectory != null) {
182
+ constants.put(KEY_EXT_STORAGE_DIRECTORY, externalStorageDirectory.getAbsolutePath());
183
+ }
184
+
185
+ if (externalDirectory != null) {
186
+ constants.put(KEY_EXTERNAL_DIRECTORY, externalDirectory.getAbsolutePath());
187
+ }
188
+
189
+ return constants;
190
+ }
191
+ }
package/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./plugin/build');
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = exports.version = '23.8.0';
8
+ const version = exports.version = '23.8.2';
9
9
  //# sourceMappingURL=version.js.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '23.8.0';
4
+ export const version = '23.8.2';
5
5
  //# sourceMappingURL=version.js.map
@@ -91,5 +91,5 @@ export declare function preferencesSetBool(key: string, value: boolean): Promise
91
91
  * @returns Promise<void>
92
92
  */
93
93
  export declare function preferencesSetString(key: string, value: string): Promise<void>;
94
- export declare const SDK_VERSION = "23.8.0";
94
+ export declare const SDK_VERSION = "23.8.2";
95
95
  //# sourceMappingURL=modular.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare const version = "23.8.0";
1
+ export declare const version = "23.8.2";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -91,5 +91,5 @@ export declare function preferencesSetBool(key: string, value: boolean): Promise
91
91
  * @returns Promise<void>
92
92
  */
93
93
  export declare function preferencesSetString(key: string, value: string): Promise<void>;
94
- export declare const SDK_VERSION = "23.8.0";
94
+ export declare const SDK_VERSION = "23.8.2";
95
95
  //# sourceMappingURL=modular.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare const version = "23.8.0";
1
+ export declare const version = "23.8.2";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,149 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "react-native": {
6
+ "type": "object",
7
+ "properties": {
8
+ "analytics_auto_collection_enabled": {
9
+ "description": "Disable or enable auto collection of analytics data.\n This is useful for opt-in-first data flows, for example when dealing with GDPR compliance. This can be overridden in JavaScript. \n Re-enable analytics data collection, e.g. once user has granted permission.",
10
+ "type": "boolean"
11
+ },
12
+ "analytics_collection_deactivated": {
13
+ "description": "If you need to deactivate Analytics collection permanently in a version of your app.\n This cannot be altered at runtime once set in the config.",
14
+ "type": "boolean"
15
+ },
16
+ "analytics_idfv_collection_enabled": {
17
+ "description": "If you wish to disable collection of the IDFV (Identifier for Vendor) in your iOS app.\n This cannot be altered at runtime once set in the config.",
18
+ "type": "boolean"
19
+ },
20
+ "google_analytics_adid_collection_enabled": {
21
+ "description": " If you wish to disable collection of the Advertising ID in your Android app.\n This cannot be altered at runtime once set in the config.",
22
+ "type": "boolean"
23
+ },
24
+ "google_analytics_ssaid_collection_enabled": {
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
+ "type": "boolean"
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
+ },
32
+ "google_analytics_registration_with_ad_network_enabled": {
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
+ "type": "boolean"
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
+ },
48
+ "analytics_default_allow_ad_personalization_signals": {
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'",
50
+ "type": "boolean"
51
+ },
52
+ "app_data_collection_default_enabled": {
53
+ "description": "Whether automatic data collection is enabled for all products, unless overridden by product-specific data collection settings.\n Setting this to false is useful for opt-in-first data flows, for example when dealing with GDPR compliance. \nThis may be overridden dynamically in Javascript via automaticDataCollectionEnabled FirebaseAppConfig property.",
54
+ "type": "boolean"
55
+ },
56
+ "app_log_level": {
57
+ "description": "Set the log level across all modules. Only applies to iOS currently. Can be 'error', 'warn', 'info', 'debug'.\n Logs messages at the configured level or lower.\n Note that if an app is running from AppStore, it will never log above info even if level is set to a higher (more verbose) setting",
58
+ "type": "string",
59
+ "enum": ["error", "warn", "info", "debug"]
60
+ },
61
+ "app_check_token_auto_refresh": {
62
+ "description": "If this flag is disabled then Firebase App Check will not periodically auto-refresh the app check token.\n This is useful for opt-in-first data flows, for example when dealing with GDPR compliance. \nIf unset it will default to the SDK-wide data collection default enabled setting. This may be overridden dynamically in Javascript.",
63
+ "type": "boolean"
64
+ },
65
+ "crashlytics_auto_collection_enabled": {
66
+ "description": "Additionally, you can configure whether Crashlytics sends out any reports through the auto_collection_enabled option in your firebase.json config. If you want users to opt-in, it is recommended that you disable this here and enable it later through the method once they opt-in.",
67
+ "type": "boolean"
68
+ },
69
+ "crashlytics_debug_enabled": {
70
+ "description": "Stack traces are readily available while you`re debugging your app, so Crashlytics is disabled by default in debug mode. You can set Crashlytics to be enabled regardless of debug mode through the debug_enabled option in your firebase.json. This may be useful to test your integration, remembering reports are sent next app start.",
71
+ "type": "boolean"
72
+ },
73
+ "crashlytics_is_error_generation_on_js_crash_enabled": {
74
+ "description": "By default React Native Firebase Crashlytics installs a global javascript-level unhandled exception handler that will log unhandled javascript exceptions as fatal crashes (since v11.3.0, non-fatal prior) with javascript stacks. Set to false to disable javascript-level crash handling.",
75
+ "type": "boolean"
76
+ },
77
+ "crashlytics_javascript_exception_handler_chaining_enabled": {
78
+ "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.",
79
+ "type": "boolean"
80
+ },
81
+ "crashlytics_ndk_enabled": {
82
+ "description": "React Native Firebase supports Crashlytics NDK reporting which is enabled by default. This allows Crashlytics to capture crashes originating from the Yoga layout engine used by React Native. You can disable Crashlytics NDK in your firebase.json config.",
83
+ "type": "boolean"
84
+ },
85
+ "in_app_messaging_auto_collection_enabled": {
86
+ "description": "In App Messaging can be further configured to enable or disable automatic data collection for Firebase In-App Messaging. This is useful for opt-in-first data flows, for example when dealing with GDPR compliance. This can be overridden in JavaScript.",
87
+ "type": "boolean"
88
+ },
89
+ "messaging_auto_init_enabled": {
90
+ "description": "Firebase generates an Instance ID, which FCM uses to generate a registration token and which Analytics uses for data collection. When an Instance ID is generated, the library will upload the identifier and configuration data to Firebase. In most cases, you do not need to change this behavior. \nIf you prefer to prevent Instance ID auto-generation, disable auto initialization for FCM and Analytics",
91
+ "type": "boolean"
92
+ },
93
+ "messaging_android_headless_task_timeout": {
94
+ "description": "On Android, a background event sent to setBackgroundMessageHandler has 60 seconds to resolve before it is automatically canceled to free up device resources. If you wish to override this value, set the number of milliseconds in your config.",
95
+ "type": "number",
96
+ "minimum": 0
97
+ },
98
+ "messaging_android_notification_delegation_enabled": {
99
+ "description": "On Android Q+ and current Play Services, your FCM may be delegated which disables firebase message listeners. Disabled by default. You may re-enable if necessary",
100
+ "type": "boolean"
101
+ },
102
+ "messaging_android_notification_channel_id": {
103
+ "description": "On Android, any message which displays a Notification use a default Notification Channel (created by FCM called `Miscellaneous`). This channel contains basic notification settings which may not be appropriate for your application. You can change what Channel is used by updating the `messaging_android_notification_channel_id` property.",
104
+ "type": "string"
105
+ },
106
+ "messaging_android_notification_delivery_metrics_export_enabled": {
107
+ "description": "Determines whether Firebase Cloud Messaging exports message delivery metrics to BigQuery. Defaults to disabled.",
108
+ "type": "boolean"
109
+ },
110
+ "messaging_android_notification_color": {
111
+ "description": "On Android, any messages which display a Notification do not use a color to tint the content (such as the small icon, title etc). To provide a custom tint color, update the messaging_android_notification_color property with a Android color resource name. \n The library provides a set of predefined colors corresponding to the HTML colors for convenience",
112
+ "type": "string"
113
+ },
114
+ "messaging_ios_auto_register_for_remote_messages": {
115
+ "description": "Whether RNFirebase Messaging automatically calls `[[UIApplication sharedApplication] registerForRemoteNotifications];`\nautomatically on app launch (recommended) - defaults to true.\n If set to false; make sure to call `firebase.messaging().registerDeviceForRemoteMessages()`\nearly on in your app startup - otherwise you will NOT receive remote messages/notifications\nin your app.\n",
116
+ "type": "boolean"
117
+ },
118
+ "messaging_ios_foreground_presentation_options": {
119
+ "description": "On iOS, indicating how to present a notification in a foreground app.",
120
+ "type": "array"
121
+ },
122
+ "perf_auto_collection_enabled": {
123
+ "description": "Disable or enable auto collection of performance monitoring data collection.\n This is useful for opt-in-first data flows, for example when dealing with GDPR compliance.\nThis can be overridden in JavaScript.",
124
+ "type": "boolean"
125
+ },
126
+ "perf_collection_deactivated": {
127
+ "description": "If you need to deactivate Performance collection permanently in a version of your app.\n This cannot be altered at runtime once set in the config.",
128
+ "type": "boolean"
129
+ },
130
+ "android_task_executor_maximum_pool_size": {
131
+ "description": "Maximum pool size of ThreadPoolExecutor used by RNFirebase for Android. Defaults to `1`.\n Larger values typically improve performance when executing large numbers of asynchronous tasks, e.g. Firestore queries.",
132
+ "type": "number"
133
+ },
134
+ "android_task_executor_keep_alive_seconds": {
135
+ "description": "Keep-alive time of ThreadPoolExecutor used by RNFirebase for Android, in seconds. Defaults to `3`.\n Excess threads in the pool executor will be terminated if they have been idle for more than the keep-alive time.",
136
+ "type": "number"
137
+ },
138
+ "android_background_activity_names": {
139
+ "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",
140
+ "type": "array"
141
+ },
142
+ "android_bypass_emulator_url_remap": {
143
+ "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`.",
144
+ "type": "boolean"
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ #
4
+ # Copyright (c) 2016-present Invertase Limited & Contributors
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this library except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'json'
20
+ require 'pathname'
21
+
22
+ $firebase_json_path = nil
23
+ $firebase_json_config = nil
24
+
25
+ unless $firebase_json_path
26
+ react_native_firebase_path = __dir__
27
+ current_search_directory = File.join(react_native_firebase_path)
28
+
29
+ is_test_project = false
30
+
31
+ if File.expand_path(current_search_directory).include? '/packages/app'
32
+ is_test_project = true
33
+ end
34
+
35
+ i = 0
36
+ while i < 5
37
+ current_search_directory = File.join(current_search_directory, '..')
38
+
39
+ if is_test_project
40
+ firebase_json = File.expand_path(File.join(current_search_directory, 'tests', 'firebase.json'))
41
+ else
42
+ firebase_json = File.expand_path(File.join(current_search_directory, 'firebase.json'))
43
+ end
44
+
45
+ if File.exist?(firebase_json)
46
+ $firebase_json_path = firebase_json
47
+ begin
48
+ $firebase_json_config = JSON.parse(File.read(firebase_json))['react-native']
49
+ Pod::UI.puts "Using firebase.json from '#{firebase_json}'"
50
+ # Pod::UI.puts $firebase_json_config
51
+ rescue => error
52
+ Pod::UI.warn "An error occurred parsing the firebase.json located at '#{firebase_json}':"
53
+ Pod::UI.warn error
54
+ end
55
+ break
56
+ end
57
+ i += 1
58
+ end
59
+ end
60
+
61
+ module FirebaseJSON
62
+ class Config
63
+ def self.get_value_or_default(key, default)
64
+ if $firebase_json_config.nil? || !$firebase_json_config.key?(key)
65
+ default
66
+ else
67
+ $firebase_json_config[key]
68
+ end
69
+ end
70
+ end
71
+ PATH = nil
72
+ end
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2016-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 <FirebaseCore/FirebaseCore.h>
19
+ #import <React/RCTConvert.h>
20
+
21
+ @interface RCTConvert (FIRApp)
22
+ + (FIRApp *)firAppFromString:(NSString *)appName;
23
+ @end
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) 2016-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 "RCTConvert+FIRApp.h"
19
+ #import "RNFBSharedUtils.h"
20
+
21
+ @implementation RCTConvert (FIRApp)
22
+ + (FIRApp *)firAppFromString:(NSString *)appName {
23
+ if ([appName isEqualToString:DEFAULT_APP_DISPLAY_NAME]) {
24
+ return [FIRApp defaultApp];
25
+ }
26
+
27
+ return [FIRApp appNamed:appName];
28
+ }
29
+
30
+ RCT_CUSTOM_CONVERTER(FIRApp *, FIRApp, [self firAppFromString:[self NSString:json]]);
31
+ @end
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2016-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 <FirebaseCore/FirebaseCore.h>
19
+ #import <React/RCTConvert.h>
20
+
21
+ @interface RCTConvert (FIROptions)
22
+ + (FIROptions *)convertRawOptions:(NSDictionary *)rawOptions;
23
+ @end
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright (c) 2016-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 "RCTConvert+FIROptions.h"
19
+
20
+ @implementation RCTConvert (FIROptions)
21
+
22
+ + (FIROptions *)convertRawOptions:(NSDictionary *)rawOptions {
23
+ FIROptions *firOptions =
24
+ [[FIROptions alloc] initWithGoogleAppID:[rawOptions valueForKey:@"appId"]
25
+ GCMSenderID:[rawOptions valueForKey:@"messagingSenderId"]];
26
+ firOptions.APIKey = [rawOptions valueForKey:@"apiKey"];
27
+ firOptions.projectID = [rawOptions valueForKey:@"projectId"];
28
+ firOptions.clientID = [rawOptions valueForKey:@"clientId"];
29
+ firOptions.databaseURL = [rawOptions valueForKey:@"databaseURL"];
30
+ firOptions.storageBucket = [rawOptions valueForKey:@"storageBucket"];
31
+ firOptions.bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
32
+ return firOptions;
33
+ }
34
+
35
+ RCT_CUSTOM_CONVERTER(FIROptions *, FIROptions, [self convertRawOptions:[self NSDictionary:json]]);
36
+ @end
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) 2016-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 <Foundation/Foundation.h>
19
+
20
+ #import <React/RCTBridgeModule.h>
21
+
22
+ @interface RNFBAppModule : NSObject <RCTBridgeModule>
23
+
24
+ + (NSString *)getCustomDomain:(NSString *)appName;
25
+
26
+ - (void)setLogLevel:(NSString *)logLevel;
27
+
28
+ @end