From 20ecbd25fb9c33700e9ca2fb75df87b3a4481205 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 7 Oct 2020 14:14:17 -0300 Subject: [PATCH] changes to new rn-extensions-share --- .../chat/rocket/reactnative/share/ShareApplication.java | 2 +- app/views/ShareListView/index.js | 3 ++- package.json | 2 +- yarn.lock | 7 ++++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/chat/rocket/reactnative/share/ShareApplication.java b/android/app/src/main/java/chat/rocket/reactnative/share/ShareApplication.java index 94cd8b861..725e216d9 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/share/ShareApplication.java +++ b/android/app/src/main/java/chat/rocket/reactnative/share/ShareApplication.java @@ -2,7 +2,7 @@ package chat.rocket.reactnative.share; import chat.rocket.reactnative.BuildConfig; -import chat.rocket.SharePackage; +import chat.rocket.rnshareextension.SharePackage; import android.app.Application; diff --git a/app/views/ShareListView/index.js b/app/views/ShareListView/index.js index 1f94ee743..aa6bf880b 100644 --- a/app/views/ShareListView/index.js +++ b/app/views/ShareListView/index.js @@ -72,6 +72,7 @@ class ShareListView extends React.Component { if (isAndroid) { await this.askForPermission(data); } + console.log(data); const info = await Promise.all(data.filter(item => item.type === 'media').map(file => FileSystem.getInfoAsync(this.uriToPath(file.value), { size: true }))); const attachments = info.map(file => ({ filename: file.uri.substring(file.uri.lastIndexOf('/') + 1), @@ -247,7 +248,7 @@ class ShareListView extends React.Component { return Promise.resolve(); } - uriToPath = uri => decodeURIComponent(isIOS ? uri.replace(/^file:\/\//, '') : uri); + uriToPath = uri => decodeURIComponent(isIOS ? uri.replace(/^file:\/\//, '') : `file://${ uri }`); getRoomTitle = (item) => { const { serverInfo } = this.state; diff --git a/package.json b/package.json index 52531a5c3..6201f6057 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "redux-saga": "1.1.3", "remove-markdown": "^0.3.0", "reselect": "^4.0.0", - "rn-extensions-share": "^2.4.0", + "rn-extensions-share": "RocketChat/rn-extensions-share#android-allow-all-file-share", "rn-fetch-blob": "0.12.0", "rn-root-view": "^1.0.3", "semver": "7.3.2", diff --git a/yarn.lock b/yarn.lock index 9ed8e2def..01bfc74c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13683,10 +13683,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rn-extensions-share@^2.4.0: +rn-extensions-share@RocketChat/rn-extensions-share#android-allow-all-file-share: version "2.4.0" - resolved "https://registry.yarnpkg.com/rn-extensions-share/-/rn-extensions-share-2.4.0.tgz#a614f6bf6cdd3948fbd7e0f2519592d4bb5f551f" - integrity sha512-zX3HcOhib805fVHR7TMYfFXrVBJWYgcrLYNB89RxbKqmSjaqUyWlHYuF61SKOs/dXXeic91e/L8d1YJa6TdzGA== + resolved "https://codeload.github.com/RocketChat/rn-extensions-share/tar.gz/be23d7bab731f34d889d1fc58d6a1dcaf7bb8ba4" + dependencies: + react-native "^0.63.1" rn-fetch-blob@0.12.0: version "0.12.0"