diff --git a/app/mobile/android/app/src/main/AndroidManifest.xml b/app/mobile/android/app/src/main/AndroidManifest.xml
index ce584331..77235871 100644
--- a/app/mobile/android/app/src/main/AndroidManifest.xml
+++ b/app/mobile/android/app/src/main/AndroidManifest.xml
@@ -15,6 +15,7 @@
+
{
if (shareIntent) {
- Alert.alert('SHARING', JSON.stringify(shareIntent));
shareIntent.forEach(share => {
if (share.text) {
actions.setMessage(share.text);
@@ -27,14 +26,14 @@ export function AddTopic({ contentKey, shareIntent, setShareIntent }) {
if (share.weblink) {
actions.setMessage(share.weblink);
}
- const mimeType = share.mimeType?.toLowerCase();
- if (mimeType === '.jpg' || mimeType === '.png') {
+ const mime = share.mimeType?.toLowerCase();
+ if (mime === '.jpg' || mime === '.png' || mime === 'image/jpeg' || mime == 'image/png' ) {
actions.addImage(share.filePath)
}
- if (mimeType === '.mp4') {
+ if (mime === '.mp4' || mime === 'video/mp4' || mime == 'video/mpeg') {
actions.addVideo(share.filePath)
}
- if (mimeType === '.mp3') {
+ if (mime === '.mp3') {
actions.addAudio(share.filePath)
}
});
diff --git a/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js b/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js
index 2763e0ff..6e783f6b 100644
--- a/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js
+++ b/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js
@@ -85,20 +85,24 @@ export function useAddTopic(contentKey) {
updateState({ message });
},
addImage: (data) => {
+ const url = data.startsWith('file:') ? data : 'file://' + data;
+
assetId.current++;
- Image.getSize(data, (width, height) => {
- const asset = { key: assetId.current, type: 'image', data: data, ratio: width/height };
+ Image.getSize(url, (width, height) => {
+ const asset = { key: assetId.current, type: 'image', data: url, ratio: width/height };
updateState({ assets: [ ...state.assets, asset ] });
- });
+ })
},
addVideo: (data) => {
+ const url = data.startsWith('file:') ? data : 'file://' + data
assetId.current++;
- const asset = { key: assetId.current, type: 'video', data: data, ratio: 1, duration: 0, position: 0 };
+ const asset = { key: assetId.current, type: 'video', data: url, ratio: 1, duration: 0, position: 0 };
updateState({ assets: [ ...state.assets, asset ] });
},
addAudio: (data, label) => {
+ const url = data.startsWith('file:') ? data : 'file://' + data
assetId.current++;
- const asset = { key: assetId.current, type: 'audio', data: data, label };
+ const asset = { key: assetId.current, type: 'audio', data: url, label };
updateState({ assets: [ ...state.assets, asset ] });
},
setVideoPosition: (key, position) => {
diff --git a/app/mobile/src/session/sharing/sharingItem/SharingItem.jsx b/app/mobile/src/session/sharing/sharingItem/SharingItem.jsx
index b8f4aefe..0dad879f 100644
--- a/app/mobile/src/session/sharing/sharingItem/SharingItem.jsx
+++ b/app/mobile/src/session/sharing/sharingItem/SharingItem.jsx
@@ -1,5 +1,4 @@
-import { Text, View } from 'react-native';
-import { TouchableOpacity } from 'react-native-gesture-handler';
+import { TouchableOpacity, Alert, Text, View } from 'react-native';
import { Logo } from 'utils/Logo';
import { styles } from './SharingItem.styled';
import Colors from 'constants/Colors';