mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-06-17 04:09:38 +08:00
Merge branch 'master' into fix-registerForRemoteNotifications-and-requestPermission
This commit is contained in:
@@ -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 <Anchor version group="app" href="/reference/firebasejsonconfig">documentation here</Anchor>.
|
||||
|
||||
### 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 <Anchor version group="app" href="/reference/firebasejsonconfig">documentation here</Anchor>.
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -40,6 +40,14 @@ directly from your device and from your Firebase Cloud Storage bucket.
|
||||
</Block>
|
||||
</Grid>
|
||||
|
||||
## 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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -173,7 +173,7 @@ export function initializeApp(options = {}, configOrName) {
|
||||
return getAppModule()
|
||||
.initializeApp(options, { name })
|
||||
.then(() => {
|
||||
app._intialized = true;
|
||||
app._initialized = true;
|
||||
return app;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1145,7 +1145,7 @@ RCT_EXPORT_METHOD(verifyPasswordResetCode:
|
||||
}
|
||||
|
||||
if (actionCodeSettings[keyDynamicLinkDomain]) {
|
||||
NSString *dynamicLinkDomain = [actionCodeSettings[keyDynamicLinkDomain] stringValue];
|
||||
NSString *dynamicLinkDomain = actionCodeSettings[keyDynamicLinkDomain];
|
||||
[settings setDynamicLinkDomain:dynamicLinkDomain];
|
||||
}
|
||||
|
||||
|
||||
@@ -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}'"
|
||||
|
||||
@@ -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) : '<unknown>';
|
||||
let fileNameParsed = '<unknown>';
|
||||
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 || '<unknown>',
|
||||
file: `${fileNameParsed.length ? fileNameParsed : '<unknown>'}:${lineNumber ||
|
||||
0}:${columnNumber || 0}`,
|
||||
file: `${fileNameParsed}:${lineNumber || 0}:${columnNumber || 0}`,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
4
packages/crashlytics/lib/index.d.ts
vendored
4
packages/crashlytics/lib/index.d.ts
vendored
@@ -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
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user