mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
[v6] Implement Cloud Storage (#2043)
See the changelog for detailed changes.
This commit is contained in:
@@ -5,7 +5,41 @@ description: Manually integrate Analytics into your Android application.
|
||||
|
||||
# Android Setup
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
auto-linking.
|
||||
## Manual Android Integration
|
||||
|
||||
## TODO
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
auto-linking.
|
||||
|
||||
#### Add Analytics to Gradle Settings
|
||||
|
||||
**`android/settings.gradle`**:
|
||||
```groovy
|
||||
include ':@react-native-firebase_analytics'
|
||||
project(':@react-native-firebase_analytics').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/analytics/android')
|
||||
```
|
||||
|
||||
#### Add Analytics to App Gradle Dependencies
|
||||
|
||||
**`android/app/build.gradle`**:
|
||||
```groovy{4}
|
||||
// ..
|
||||
dependencies {
|
||||
// ..
|
||||
implementation project(path: ":@react-native-firebase_analytics")
|
||||
}
|
||||
```
|
||||
|
||||
#### Add Analytics to Main Android Application:
|
||||
|
||||
**`android/app/src/main/java/**/MainApplication.java`**:
|
||||
```java{2,8}
|
||||
// ..
|
||||
import io.invertase.firebase.analytics.ReactNativeFirebaseAnalyticsPackage;
|
||||
|
||||
// ..
|
||||
protected List<ReactPackage> getPackages() {
|
||||
return Arrays.asList(
|
||||
new MainReactPackage(),
|
||||
new ReactNativeFirebaseAnalyticsPackage(),
|
||||
// ..
|
||||
```
|
||||
|
||||
@@ -5,17 +5,38 @@ description: Manually integrate Analytics into your iOS application.
|
||||
|
||||
# iOS Setup
|
||||
|
||||
## Manual iOS Integration via CocoaPods
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
auto-linking.
|
||||
|
||||
#### Add Analytics Pod
|
||||
|
||||
**`ios/Podfile`**:
|
||||
```ruby{4}
|
||||
// ..
|
||||
target 'app' do
|
||||
// ..
|
||||
pod 'RNFBAnalytics', :path => '../node_modules/@react-native-firebase/analytics/ios'
|
||||
end
|
||||
```
|
||||
|
||||
## Manual iOS Integration via Frameworks
|
||||
|
||||
*TODO*
|
||||
|
||||
## Device Identification
|
||||
|
||||
If you would like to enable Firebase Analytics to generate automatic audience metrics for iOS (as it does by default in Android), you must link additional iOS libraries, [as documented by the Google Firebase team](https://support.google.com/firebase/answer/6318039). Specifically you need `libAdIdAccess.a` and `AdSupport.framework`.
|
||||
|
||||
The way to do this using Cocoapods is to add this to your Podfile (though please use [the most current Pod version](https://cocoapods.org/pods/GoogleIDFASupport) supported by react-native-firebase):
|
||||
|
||||
```ruby
|
||||
**`ios/Podfile`**:
|
||||
```ruby{5}
|
||||
// ..
|
||||
target 'app' do
|
||||
// ..
|
||||
pod 'RNFBAnalytics', :path => '../node_modules/@react-native-firebase/analytics/ios'
|
||||
pod 'GoogleIDFASupport', '~> 3.14.0'
|
||||
end
|
||||
```
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
auto-linking.
|
||||
|
||||
## TODO
|
||||
|
||||
@@ -5,10 +5,76 @@ description: Manually integrate Crashlytics into your Android application.
|
||||
|
||||
# Android Setup
|
||||
|
||||
> If you're migrating from Fabric ensure you remove the `fabric.properties` file from your android project - if you do not do this you will not receive crash reports on the Firebase console.
|
||||
|
||||
## Additional Installation Steps
|
||||
|
||||
### Add Fabric Gradle Tools
|
||||
|
||||
These steps are required, if you do not add these your app will most likely crash at startup with the following Error: *"The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account."*
|
||||
|
||||
#### Add the Fabric Maven repository
|
||||
|
||||
**`android/build.gradle`**:
|
||||
```groovy{6-8}
|
||||
// ..
|
||||
buildscript {
|
||||
// ..
|
||||
repositories {
|
||||
// ..
|
||||
maven {
|
||||
url 'https://maven.fabric.io/public'
|
||||
}
|
||||
}
|
||||
// ..
|
||||
}
|
||||
```
|
||||
|
||||
#### Add the Fabric Tools Plugin dependency
|
||||
|
||||
**`android/build.gradle`**:
|
||||
```groovy{6}
|
||||
// ..
|
||||
buildscript {
|
||||
// ..
|
||||
dependencies {
|
||||
// ..
|
||||
classpath 'io.fabric.tools:gradle:1.28.1'
|
||||
}
|
||||
// ..
|
||||
}
|
||||
```
|
||||
|
||||
#### Apply the Fabric Tools Plugin to your app
|
||||
|
||||
|
||||
**`android/app/build.gradle`**:
|
||||
```groovy{2}
|
||||
apply plugin: 'com.android.application' // apply after this line
|
||||
apply plugin: 'io.fabric'
|
||||
// ..
|
||||
```
|
||||
|
||||
#### Enable Crashlytics NDK reporting
|
||||
|
||||
> OPTIONAL
|
||||
|
||||
Crashlytics NDK reporting allows you to capture Native Development Kit crashes, e.g. in React Native this will capture crashes originating from the Yoga layout engine.
|
||||
|
||||
**`android/app/build.gradle`**:
|
||||
```groovy{4-6}
|
||||
// ..
|
||||
apply plugin: 'io.fabric'
|
||||
// ..
|
||||
crashlytics {
|
||||
enableNdk true
|
||||
}
|
||||
```
|
||||
|
||||
## Manual Linking
|
||||
|
||||
> The following steps are only required if your environment does not have access to React Native
|
||||
auto-linking.
|
||||
|
||||
|
||||
> If you're migrating from Fabric ensure you remove the `fabric.properties` file from your android project - if you do not do this you will not receive crash reports on the Firebase console.
|
||||
|
||||
## TODO
|
||||
TODO
|
||||
|
||||
@@ -82,7 +82,7 @@ data changing, being added, being removed or moved to another location.
|
||||
|
||||
```jsx
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Text, FlatList } from 'react-native';
|
||||
import { Text } from 'react-native';
|
||||
import database from '@react-native-firebase/database';
|
||||
|
||||
function Role({ uid }) {
|
||||
@@ -128,7 +128,7 @@ a performant, scrollable list simple:
|
||||
|
||||
```jsx
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Text } from 'react-native';
|
||||
import { Text, FlatList } from 'react-native';
|
||||
import database from '@react-native-firebase/database';
|
||||
|
||||
function Games() {
|
||||
|
||||
@@ -185,8 +185,8 @@
|
||||
to: "/android"
|
||||
- text: iOS Setup
|
||||
to: "/ios"
|
||||
- text: Migrating to Dynamic Links
|
||||
to: "/migrating-to-dynamic-links"
|
||||
- text: Migrate to Dynamic Links
|
||||
to: "/migrate-to-dynamic-links"
|
||||
|
||||
- module: ml-kit
|
||||
group: ML Kit
|
||||
|
||||
@@ -31,7 +31,7 @@ dependencies {
|
||||
|
||||
#### Add Cloud Storage to Main Android Application:
|
||||
|
||||
**`android/app/src/main/java/**/MainApplication.java`**:
|
||||
**android/app/src/main/java/\*\*/MainApplication.java**:
|
||||
```java{2,8}
|
||||
// ..
|
||||
import io.invertase.firebase.storage.ReactNativeFirebaseStoragePackage;
|
||||
|
||||
6791
docs/typedoc.json
6791
docs/typedoc.json
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user