Skip to content

[v6] Implement Cloud Storage #2043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 122 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
d1371a8
[skip ci] create storage module
Salakar Mar 28, 2019
1ea2164
[skip ci] enable storage module
Salakar Mar 28, 2019
3eda55b
[skip ci] wip
Salakar Mar 30, 2019
1d9613d
[skip ci] wip
Salakar Mar 31, 2019
f2f7720
[skip ci] wip
Salakar Mar 31, 2019
2d75494
[skip ci] wip
Salakar Apr 1, 2019
435a6e6
[skip ci] wip
Salakar Apr 4, 2019
5ce3e5a
[skip ci]
Salakar Apr 9, 2019
ce3a38f
[skip ci] multi-bucket support
Salakar Apr 10, 2019
5bcbf76
[skip ci] multi-bucket support
Salakar Apr 10, 2019
b73e162
[skip ci] update change log
Salakar Apr 10, 2019
73a001a
[skip ci]
Salakar Apr 13, 2019
20c911f
[skip ci]
Salakar Apr 13, 2019
85baac3
[skip ci]
Salakar Apr 14, 2019
18c4104
[skip ci]
Salakar Apr 14, 2019
ce13340
[skip ci]
Salakar Apr 14, 2019
3a8ba49
[skip ci]
Salakar Apr 14, 2019
e647b2f
[skip ci]
Salakar Apr 14, 2019
6582846
[skip ci]
Salakar Apr 15, 2019
1746587
[skip ci]
Salakar Apr 15, 2019
5de320f
[skip ci]
Salakar Apr 15, 2019
7b4ef8a
[skip ci]
Salakar Apr 15, 2019
988ad0e
[skip ci] destroy all tasks on rn reload/reset
Salakar Apr 15, 2019
8aed1dc
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 18, 2019
6a95006
[ios] update to latest Firebase SDK 5.20.2
Salakar Apr 18, 2019
745d323
[android] gradle + deps update
Salakar Apr 18, 2019
f02229f
[ios] start of ios storage implementation
Salakar Apr 18, 2019
c73dba1
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 22, 2019
b06a809
[skip ci]
Salakar Apr 22, 2019
c7b7689
[skip ci] ios
Salakar Apr 22, 2019
1b918f0
[skip ci] androidx
Salakar Apr 22, 2019
95f256f
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 23, 2019
44bbfb2
[skip ci] gen typedoc
Salakar Apr 23, 2019
b33dd7b
[skip ci] gen typedoc
Salakar Apr 23, 2019
ceda1c1
[skip ci] types
Salakar Apr 23, 2019
e0c7985
[skip ci] types
Salakar Apr 23, 2019
ce78b40
[skip ci] types
Salakar Apr 23, 2019
56056e2
[skip ci] types
Salakar Apr 23, 2019
e0097af
[skip ci] types
Salakar Apr 23, 2019
af8ab8f
[skip ci] types
Salakar Apr 23, 2019
5eb5d3d
[skip ci] types
Salakar Apr 23, 2019
83e1b5e
[skip ci] types
Salakar Apr 23, 2019
526e7fd
[skip ci] types
Salakar Apr 24, 2019
b963386
[skip ci] types
Salakar Apr 24, 2019
617b23f
[skip ci] types
Salakar Apr 24, 2019
372944f
[skip ci] types
Salakar Apr 24, 2019
1a21763
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 24, 2019
f1e0c48
[skip ci] types
Salakar Apr 24, 2019
fbd0e8a
[skip ci] types
Salakar Apr 25, 2019
2b41723
[skip ci] types
Salakar Apr 25, 2019
a11416d
[skip ci] types
Salakar Apr 25, 2019
a1d90bd
[skip ci] types
Salakar Apr 25, 2019
7e11208
[skip ci] types
Salakar Apr 25, 2019
72bd9b4
[skip ci] types
Salakar Apr 25, 2019
c3e332f
[skip ci] types
Salakar Apr 25, 2019
0322281
[skip ci] types
Salakar Apr 25, 2019
5387391
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 25, 2019
ab4d12e
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 25, 2019
4c2f6b7
[skip ci] types
Salakar Apr 25, 2019
49c2a21
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 26, 2019
13ddbc1
[skip ci] rename paths
Salakar Apr 26, 2019
d80d086
[skip ci] 🥺🔫
Salakar Apr 27, 2019
e2e23a2
[skip ci] cleanup
Salakar Apr 27, 2019
7e9e04d
Merge branch 'master' into @salakar/v6/storage
Ehesp Apr 29, 2019
f5362e2
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 29, 2019
6476a02
Merge branch '@salakar/v6/storage' of https://github.com/invertase/re…
Salakar Apr 29, 2019
db68c76
Merge branch 'master' into @salakar/v6/storage
Ehesp Apr 29, 2019
c5502cc
[skip ci] docs
Ehesp Apr 29, 2019
6a124ab
[skip ci]
Salakar Apr 29, 2019
633b28d
Merge remote-tracking branch 'origin/@salakar/v6/storage' into @salak…
Salakar Apr 29, 2019
80ef78b
merge
Ehesp Apr 29, 2019
1bdd662
[skip ci]
Salakar Apr 29, 2019
3c33b0d
Merge remote-tracking branch 'origin/@salakar/v6/storage' into @salak…
Salakar Apr 29, 2019
b2151e1
-
Salakar Apr 29, 2019
b8e73f8
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 29, 2019
9b03843
-
Salakar Apr 29, 2019
d03f773
-
Salakar Apr 29, 2019
f8a6e64
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 29, 2019
1295bc1
Update android.md
Salakar Apr 29, 2019
4e4bbf8
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 29, 2019
59029a8
Merge branch '@salakar/v6/storage' of https://github.com/invertase/re…
Salakar Apr 29, 2019
8dce68c
Update android.md
Salakar Apr 29, 2019
1706070
[skip ci]
Salakar Apr 29, 2019
9c42a81
[skip ci]
Salakar Apr 29, 2019
bb89641
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 29, 2019
06aa1d8
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 29, 2019
4439706
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar Apr 29, 2019
e64b90a
-
Salakar Apr 29, 2019
3086da3
-
Salakar Apr 29, 2019
2c29744
linting
Salakar Apr 29, 2019
76b3258
[skip ci] docs
Ehesp Apr 30, 2019
db50ea7
[skip ci] docs
Ehesp Apr 30, 2019
cb5fac9
[skip ci] docs
Ehesp Apr 30, 2019
b2697e1
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar May 1, 2019
f807d99
[skip ci] export storage op time constants
Salakar May 1, 2019
7c5f501
[skip ci] -
Salakar May 1, 2019
667f29a
[skip ci] path utils cleanup
Salakar May 1, 2019
b13556d
[skip ci] docs
Ehesp May 1, 2019
4f46cd9
[skip ci] docs
Ehesp May 1, 2019
a64548d
[skip ci] cleanup metadata validator
Salakar May 1, 2019
1e4bd63
Merge remote-tracking branch 'origin/@salakar/v6/storage' into @salak…
Salakar May 1, 2019
e3de766
[skip ci] metadata tests
Salakar May 1, 2019
37539d3
[skip ci] tests
Salakar May 1, 2019
df2c9f1
[skip ci] static tests
Salakar May 1, 2019
113cec5
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar May 1, 2019
3a6748f
[skip ci] [android] handle file not found exceptions specifically, ot…
Salakar May 1, 2019
3d06f11
[skip ci] [android] add missing MainBundle & LibraryDirectory path co…
Salakar May 1, 2019
dbf14cf
[skip ci][ios] reword file not found error
Salakar May 1, 2019
a5b9dfd
[skip ci] rework some internal 'on()' behavior
Salakar May 1, 2019
30c412d
[skip ci] update path types
Salakar May 1, 2019
d0b57ed
-
Salakar May 1, 2019
c7631b6
-
Salakar May 1, 2019
f2ba4e9
-
Salakar May 2, 2019
18d1beb
[skip ci] static tests
Salakar May 2, 2019
8c992d6
[skip ci] docs
Ehesp May 2, 2019
26e8ff8
-
Salakar May 2, 2019
3263575
Merge branch '@salakar/v6/storage' of https://github.com/invertase/re…
Salakar May 2, 2019
cf39ca4
[skip ci] -
Salakar May 2, 2019
95aa538
Merge branch 'master' of https://github.com/invertase/react-native-fi…
Salakar May 2, 2019
77160ba
Update android.md
Salakar May 2, 2019
f12d612
[skip ci] static tests
Salakar May 3, 2019
d86d3e4
Merge remote-tracking branch 'origin/@salakar/v6/storage' into @salak…
Salakar May 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# Ignore tests project
.*/tests/.*
.*/packages/template/.*

[include]
packages/**/lib/*.js.flow
Expand Down Expand Up @@ -42,4 +43,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.93.0
^0.96.0
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,26 @@ await analytics().setUserId('12345678');
- [BREAKING] `enableDeveloperMode` has been removed, you can now use `setConfigSettings({ isDeveloperModeEnabled: boolean })` instead
- [BREAKING] `setDefaults` now returns a Promise that resolves when completed

## Storage

<!-- TODO(salakar) change link -->
> **Blog post announcement (NOT LIVE YET)**: [[Firebase Cloud Storage for React Native](https://invertase.io/blog?utm_source=github&utm_medium=changelog)]

- [NEW] Added support for `put` (`Blob` | `ArrayBuffer` | `Uint8Array`)
- `contentType` mime type is automatically inferred from `Blob`
- [NEW] Added support for `putString` and all StringFormat's (raw, base64, base64url & data_url)
- `contentType` mime type is automatically inferred from `data_url` strings
- [NEW] Added support multiple buckets, e.g. `firebase.app().storage('gs://my-other-bucket')`
- [NEW] Added support `pause()`, `resume()` & `cancel()` for Upload & Download Storage tasks
- [NEW] Added an `error` property to TaskSnapshot's for `error` state events - this is an instance of `NativeFirebaseError` (with `code` & `message`)
- [BREAKING] Removed formerly deprecated `UploadTaskSnapshot.downloadUrl` property, use `StorageReference.getDownloadURL(): Promise<string>` instead
- [BREAKING] `StorageReference.downloadFile()` is now deprecated and will be removed in a later release, please rename usages of this to `getFile()` - renamed to match Native SDKs
- [BREAKING] `firebase.storage.Native` is now deprecated and will be removed in a later release, please rename usages of this to `firebase.storage.Path`
- [BREAKING] `firebase.storage.Native.*` properties have been renamed and deprecated and will be removed in a later release, follow the in-app console warnings on how to migrate
- [BUGFIX][ANDROID] Update/set metadata now correctly supports removing metadata values by passing a null property value in `customMetadata`
- [BUGFIX][ANDROID] `contentType` mime type is now correctly determined in all scenarios, there was an edge case where it would just use the default value
- [INTERNAL][ANDROID] `downloadFile` no longer uses a `StreamDownloadTask`, replaced with the newer `FileDownloadTask`

## Messaging

- [NEW] Support `setAutoInitEnabled(enabled: boolean)` - this is useful for opt-in first flows
Expand Down
38 changes: 36 additions & 2 deletions docs/analytics/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,41 @@ description: Manually integrate Analytics into your Android application.

# Android Setup

## Manual Android Integration

> The following steps are only required if your environment does not have access to React Native
auto-linking.
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;

## TODO
// ..
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactNativeFirebaseAnalyticsPackage(),
// ..
```
33 changes: 27 additions & 6 deletions docs/analytics/ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
72 changes: 69 additions & 3 deletions docs/crashlytics/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions docs/database/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions docs/sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/storage/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading