Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
<uses-feature android:name="android.hardware.audio.output"/>
<uses-feature android:name="android.hardware.microphone"/>
<uses-permission android:name="android.permission.POST_NOTIFICATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage" />

<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="wc"/>
</intent>
</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme">
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme" android:requestLegacyExternalStorage="true">
<service android:name="io.wazo.callkeep.VoiceConnectionService" android:label="Wazo" android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE" android:foregroundServiceType="camera|microphone" android:exported="true">
<intent-filter>
<action android:name="android.telecom.ConnectionService"/>
Expand Down
8 changes: 8 additions & 0 deletions src/navigation/screens/chats/helpers/useFileDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ const useFileDownload = (
? `${androidDownloadDir}/${fileName}` // Public Downloads on Android
: `${RNBlobUtil.fs.dirs.CacheDir}/${fileName}`; // Documents directory on iOS

// Check if the file exists
const fileExists = await RNBlobUtil.fs.exists(filePath);

if (fileExists) {
// Delete the file if it exists
await RNBlobUtil.fs.unlink(filePath);
}

// Write the file
await RNBlobUtil.fs.writeFile(filePath, base64Data, 'base64');
if (Platform.OS === 'ios') {
Expand Down
Loading