diff --git a/docs/crashlytics/quick-start.md b/docs/crashlytics/quick-start.md index 020cc243..5bb311fa 100644 --- a/docs/crashlytics/quick-start.md +++ b/docs/crashlytics/quick-start.md @@ -119,4 +119,8 @@ Once your user has consented, enable Crashlytics collection via the JavaScript A await firebase.crashlytics().setCrashlyticsCollectionEnabled(true); ``` -To learn more about all the `firebase.json` options, view the documentation here. + +### Enabling Debug Reports +By default, Crashlytics won't report crashes and logs from builds in debug mode. To enable it, set the `crashlytics_debug_enabled` option to `true` in the `react-native` section of your `firebase.json` config file. + +To learn more about all the `firebase.json` options, view the documentation here. diff --git a/docs/functions/ios.md b/docs/functions/ios.md index 485e344c..90b23d52 100644 --- a/docs/functions/ios.md +++ b/docs/functions/ios.md @@ -17,7 +17,7 @@ Add the `RNFBFunctions` Pod to your projects `/ios/Podfile`: ```ruby{3} target 'app' do ... - pod 'RNFBFirestore', :path => '../node_modules/@react-native-firebase/functions' + pod 'RNFBFunctions', :path => '../node_modules/@react-native-firebase/functions' end ``` diff --git a/docs/iid/quick-start.md b/docs/iid/quick-start.md index eb7b1c09..179b3c8e 100644 --- a/docs/iid/quick-start.md +++ b/docs/iid/quick-start.md @@ -32,7 +32,7 @@ import iid from '@react-native-firebase/iid'; The package also provides access to the firebase instance: ```js -import { firebase } from '@react-native-firebase/perf'; +import { firebase } from '@react-native-firebase/iid'; ``` ### Retrieving the instance token @@ -43,7 +43,7 @@ To retrieve the current instance ID, call the `get` method: import iid from '@react-native-firebase/iid'; async function getInstanceId() { - const id = await iid.get(); + const id = await iid().get(); console.log('Current Instance ID: ', id); } ``` diff --git a/docs/in-app-messaging/android.md b/docs/in-app-messaging/android.md index 3c6b4667..daeb5958 100644 --- a/docs/in-app-messaging/android.md +++ b/docs/in-app-messaging/android.md @@ -13,8 +13,8 @@ description: Manually integrate Firebase In-App Messaging into your Android appl Add the following to your projects `/android/settings.gradle` file: ```groovy -include ':@react-native-firebase_inAppMessaging' -project(':@react-native-firebase_inAppMessaging').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/in-app-messaging/android') +include ':@react-native-firebase_in-app-messaging' +project(':@react-native-firebase_in-app-messaging').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/in-app-messaging/android') ``` #### Update Gradle Dependencies diff --git a/docs/perf/quick-start.md b/docs/perf/quick-start.md index b108ed04..409a8ff8 100644 --- a/docs/perf/quick-start.md +++ b/docs/perf/quick-start.md @@ -80,13 +80,16 @@ async function getRequest(url) { // Define meta details metric.putAttribute('user', 'abcd'); + // Start the metric + await metric.start(); + // Perform a HTTP request and provide response information const response = await fetch(url); metric.setHttpResponseCode(response.status); metric.setResponseContentType(response.headers.get('Content-Type')); metric.setResponsePayloadSize(response.headers.get('Content-Length')); - // Stop the trace + // Stop the metric await metric.stop(); return response.json(); diff --git a/docs/storage/index.md b/docs/storage/index.md index 9145f289..e235ec4f 100644 --- a/docs/storage/index.md +++ b/docs/storage/index.md @@ -40,6 +40,14 @@ directly from your device and from your Firebase Cloud Storage bucket. +## Errors +The functions in this module can throw two different types of errors. If ill-formed urls are passed into them, they will throw +[generic Errors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) with messages +explaining the problem that caused them. + +If error was thrown by Firebase itself, then the function will throw a [NativeFirebaseError](https://invertase.io/oss/react-native-firebase/v6/app/reference/nativefirebaseerror). The codes for these errors are the same as the codes for [Firebase Cloud Storage Web errors](https://firebase.google.com/docs/storage/web/handle-errors). + + ## Learn more Our documentation is a great place to start, however if you're looking for more help or want to help others, diff --git a/packages/app/lib/index.js b/packages/app/lib/index.js index 02a67789..55fc1ca3 100644 --- a/packages/app/lib/index.js +++ b/packages/app/lib/index.js @@ -18,6 +18,6 @@ import { getFirebaseRoot } from './internal/registry/namespace'; export const firebase = getFirebaseRoot(); -export utils from './utils'; +export { default as utils } from './utils'; export default firebase; diff --git a/packages/app/lib/internal/registry/app.js b/packages/app/lib/internal/registry/app.js index da195a8c..f11a4423 100644 --- a/packages/app/lib/internal/registry/app.js +++ b/packages/app/lib/internal/registry/app.js @@ -173,7 +173,7 @@ export function initializeApp(options = {}, configOrName) { return getAppModule() .initializeApp(options, { name }) .then(() => { - app._intialized = true; + app._initialized = true; return app; }); } diff --git a/packages/auth/ios/RNFBAuth/RNFBAuthModule.m b/packages/auth/ios/RNFBAuth/RNFBAuthModule.m index 2be522a5..9e24968e 100644 --- a/packages/auth/ios/RNFBAuth/RNFBAuthModule.m +++ b/packages/auth/ios/RNFBAuth/RNFBAuthModule.m @@ -1145,7 +1145,7 @@ RCT_EXPORT_METHOD(verifyPasswordResetCode: } if (actionCodeSettings[keyDynamicLinkDomain]) { - NSString *dynamicLinkDomain = [actionCodeSettings[keyDynamicLinkDomain] stringValue]; + NSString *dynamicLinkDomain = actionCodeSettings[keyDynamicLinkDomain]; [settings setDynamicLinkDomain:dynamicLinkDomain]; } diff --git a/packages/crashlytics/RNFBCrashlytics.podspec b/packages/crashlytics/RNFBCrashlytics.podspec index ed6cbac7..eb58c780 100644 --- a/packages/crashlytics/RNFBCrashlytics.podspec +++ b/packages/crashlytics/RNFBCrashlytics.podspec @@ -10,7 +10,7 @@ if using_custom_firebase_sdk_version end # Fabric SDK Override -fabric_sdk_version = '~> 1.9.0' +fabric_sdk_version = '~> 1.10.2' using_custom_fabric_sdk_version = defined? $FabricSDKVersion if using_custom_fabric_sdk_version Pod::UI.puts "RNFBCrashlytics: Using user specified Fabric SDK version '#{$FabricSDKVersion}'" @@ -18,7 +18,7 @@ if using_custom_fabric_sdk_version end # Crashlytics SDK Override -crashlytics_sdk_version = '~> 3.12.0' +crashlytics_sdk_version = '~> 3.14.0' using_custom_crashlytics_sdk_version = defined? $CrashlyticsSDKVersion if using_custom_crashlytics_sdk_version Pod::UI.puts "RNFBCrashlytics: Using user specified Crashlytics SDK version '#{$CrashlyticsSDKVersion}'" diff --git a/packages/crashlytics/lib/handlers.js b/packages/crashlytics/lib/handlers.js index 2c8066b1..66184834 100644 --- a/packages/crashlytics/lib/handlers.js +++ b/packages/crashlytics/lib/handlers.js @@ -28,17 +28,22 @@ export function createNativeErrorObj(error, stackFrames, isUnhandledRejection) { nativeObj.frames = []; for (let i = 0; i < stackFrames.length; i++) { const { columnNumber, lineNumber, fileName, functionName, source } = stackFrames[i]; - const subStrLen = fileName.indexOf('?') < 0 ? fileName.length : fileName.indexOf('?'); - const fileNameParsed = - fileName && fileName.length ? fileName.substring(0, subStrLen) : ''; + let fileNameParsed = ''; + if (fileName) { + const subStrLen = fileName.indexOf('?'); + if (subStrLen < 0) { + fileNameParsed = fileName; + } else if (subStrLen > 0) { + fileNameParsed = fileName.substring(0, subStrLen); + } + } nativeObj.frames.push({ src: source, line: lineNumber || 0, col: columnNumber || 0, fn: functionName || '', - file: `${fileNameParsed.length ? fileNameParsed : ''}:${lineNumber || - 0}:${columnNumber || 0}`, + file: `${fileNameParsed}:${lineNumber || 0}:${columnNumber || 0}`, }); } diff --git a/packages/crashlytics/lib/index.d.ts b/packages/crashlytics/lib/index.d.ts index 71782e16..38da376f 100644 --- a/packages/crashlytics/lib/index.d.ts +++ b/packages/crashlytics/lib/index.d.ts @@ -79,7 +79,7 @@ export namespace FirebaseCrashlyticsTypes { isCrashlyticsCollectionEnabled: true; /** - * Cause your app to crash for testing purposes. + * Cause your app to crash for testing purposes. This is a native crash and will not contain a javascript stack trace. * * #### Example * @@ -108,6 +108,8 @@ export namespace FirebaseCrashlyticsTypes { * Record a JavaScript Error. * * The JavaScript stack trace is converted into a mock native iOS or Android exception before submission. + * The line numbers in the stack trace (if available) will be relative to the javascript bundle built by your packager, + * after whatever transpilation or minimization steps happen. You will need to maintain sourcemaps to decode them if desired. * * #### Example * diff --git a/packages/firestore/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCommon.java b/packages/firestore/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCommon.java index 074925f2..3136da16 100644 --- a/packages/firestore/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCommon.java +++ b/packages/firestore/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCommon.java @@ -30,7 +30,10 @@ class ReactNativeFirebaseFirestoreCommon { UniversalFirebaseFirestoreException universalException = new UniversalFirebaseFirestoreException((FirebaseFirestoreException) exception, exception.getCause()); rejectPromiseWithCodeAndMessage(promise, universalException.getCode(), universalException.getMessage()); } else if (exception.getCause() != null && exception.getCause() instanceof FirebaseFirestoreException) { - UniversalFirebaseFirestoreException universalException = new UniversalFirebaseFirestoreException((FirebaseFirestoreException) exception.getCause(), exception.getCause().getCause()); + UniversalFirebaseFirestoreException universalException = new UniversalFirebaseFirestoreException( + (FirebaseFirestoreException) exception.getCause(), + exception.getCause().getCause() != null ? exception.getCause().getCause() : exception.getCause() + ); rejectPromiseWithCodeAndMessage(promise, universalException.getCode(), universalException.getMessage()); } else { rejectPromiseWithExceptionMap(promise, exception); diff --git a/packages/messaging/README.md b/packages/messaging/README.md index 3a06ebb2..cd2f6f47 100644 --- a/packages/messaging/README.md +++ b/packages/messaging/README.md @@ -26,7 +26,7 @@ cost free service, allowing for server-device and device-device communication. The React Native Firebase Messaging module provides a simple JavaScript API to interact with FCM. -[> Learn More](https://firebase.google.com/products/messaging/) +[> Learn More](https://firebase.google.com/products/cloud-messaging/) ## Installation diff --git a/tests/ios/Podfile.lock b/tests/ios/Podfile.lock index 15cdc20c..3e6bd12e 100644 --- a/tests/ios/Podfile.lock +++ b/tests/ios/Podfile.lock @@ -165,10 +165,10 @@ PODS: - BoringSSL-GRPC/Implementation (0.0.3): - BoringSSL-GRPC/Interface (= 0.0.3) - BoringSSL-GRPC/Interface (0.0.3) - - Crashlytics (3.12.0): - - Fabric (~> 1.9.0) + - Crashlytics (3.14.0): + - Fabric (~> 1.10.2) - DoubleConversion (1.1.6) - - Fabric (1.9.0) + - Fabric (1.10.2) - Firebase/AdMob (6.13.0): - Firebase/CoreOnly - Google-Mobile-Ads-SDK (~> 7.50) @@ -556,8 +556,8 @@ PODS: - React - RNFBApp - RNFBCrashlytics (6.2.0): - - Crashlytics (~> 3.12.0) - - Fabric (~> 1.9.0) + - Crashlytics (~> 3.14.0) + - Fabric (~> 1.10.2) - Firebase/Core (~> 6.13.0) - React - RNFBApp @@ -803,9 +803,9 @@ SPEC CHECKSUMS: abseil: 18063d773f5366ff8736a050fe035a28f635fd27 boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c BoringSSL-GRPC: db8764df3204ccea016e1c8dd15d9a9ad63ff318 - Crashlytics: 07fb167b1694128c1c9a5a5cc319b0e9c3ca0933 + Crashlytics: 540b7e5f5da5a042647227a5e3ac51d85eed06df DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 - Fabric: f988e33c97f08930a413e08123064d2e5f68d655 + Fabric: 706c8b8098fff96c33c0db69cbf81f9c551d0d74 Firebase: 458d109512200d1aca2e1b9b6cf7d68a869a4a46 FirebaseABTesting: 0d10f3cdc3fa00f3f175b5b56c1003c8e888299f FirebaseAnalytics: 45f36d9c429fc91d206283900ab75390cd05ee8a @@ -873,7 +873,7 @@ SPEC CHECKSUMS: RNFBAnalytics: 57dc0bfad4e40f68779757653676699072651218 RNFBApp: 5b215aacc09105a1761de31b9a0eb2abcce06253 RNFBAuth: 61673c0d38ce225c315e7be13a1b494904baedd2 - RNFBCrashlytics: 0469cb96b00904e0c9604b9636d8eeab31115b08 + RNFBCrashlytics: 63bb6e8c450075e2b01b98865911ece999da8ac9 RNFBDatabase: 267f476097111054553ecb99208201945961efa5 RNFBDynamicLinks: fc6a123aaa86dc8745dcb3050ecc9c8e199f64df RNFBFirestore: 5de4ae898df51a3ecc16a45db15019836c5cec87 diff --git a/tests/package.json b/tests/package.json index c6ca96a5..1116686e 100644 --- a/tests/package.json +++ b/tests/package.json @@ -80,13 +80,13 @@ "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/testing.app", "build": "xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES -quiet | xcpretty -k", "type": "ios.simulator", - "name": "iPhone X" + "name": "iPhone X, iOS 12.2" }, "ios.ci": { "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/testing.app", "build": "xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES \"RCT_METRO_PORT=$RCT_METRO_PORT\" | xcpretty -k", "type": "ios.simulator", - "name": "iPhone X" + "name": "iPhone X, iOS 12.2" }, "android.emu.debug": { "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",