Browse Source

FIX | Fix send voice message on android

merge-requests/296/head
Oksana Stepanenko 3 years ago
parent
commit
a8aa6bd4f9
  1. 6
      src/services/system/fs.service.ts

6
src/services/system/fs.service.ts

@ -27,7 +27,10 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => { @@ -27,7 +27,10 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => {
return {
name: getFileName(data),
size: data.size,
type: getFileExtension(getFileName(data)),
type: Platform.select({
ios: getFileExtension(getFileName(data)),
android: 'audio/mpeg'
}) ,
uri: getFileUri(data),
}
}
@ -35,7 +38,6 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => { @@ -35,7 +38,6 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => {
const getFileStat = async (filePath: string): Promise<IFile> => {
try {
const fileStat = await RNFS.stat(prepareUriToRNFS(filePath))
return prepareRNFSFile(fileStat)
} catch (err) {
console.log('getFileStat ERR:', err)

Loading…
Cancel
Save