Skip to content
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

DMAPP-156: Fix file download issue #158

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

meKushdeepSingh
Copy link
Collaborator

Details:

  • Added logic to check if a deleted file exists.
  • Unlink the file before downloading the new file.

Details:
- Added logic to check if a deleted file exists in the cache.
- Removed the file from the cache before downloading the new file.
Copy link

  • It seems that the import statement for useState from 'react' is not being used in the code. You can remove it.
  • The import path for Toaster and ToasterOptions seems incorrect. You might need to adjust the path according to the correct file structure.
  • In the useFileDownload function, the conditional check for Android version in the permission request Platform.Version <= 28 might need further testing or validation.
  • There is a comment mentioning "Public Downloads on Android" while defining the file path for Android, but the actual directory seems to be '/storage/emulated/0/Download'. It would be good to update the comment for clarity.
  • There is a typo in the comment in the function handleIOSDownload, it should be "file saved" instead of "File Saved".
  • The error handling in the handleIOSDownload function could be improved by showing the error message to the user or handling it differently.
  • It's recommended to add more descriptive error messages or logging in the catch block of the saveBase64File function to provide better context in case of failures.
All looks good.

Copy link

In the AndroidManifest.xml file:

  1. The package name should not have 'android.' prefix. So instead of android.permission.INTERNET, it should be android.permission.INTERNET.
  2. In the <uses-permission> tag for WRITE_EXTERNAL_STORAGE, the android:maxSdkVersion should be defined without space between '=' and '28'. So, it should be android:maxSdkVersion="28".
  3. The <intent> section inside <queries> should use <intent-filter> instead of <queries>.

In the code file:

  1. Check the import statement in line 69. There is no need to include the JavaScript code inside the AndroidManifest file.
  2. Check the import for React in line 2, it should be imported correctly as import React from 'react';.
  3. In the requestStoragePermission function, the condition for checking Android version should be Platform.Version < 28 instead of Platform.Version <= 28.
  4. In the Share.share method, the check should be if (res.action === 'sharedAction' && res.activityType === 'com.apple.UIKit.activity.SaveToCameraRoll') instead of 'com.apple.DocumentManagerUICore.SaveToFiles'.
  5. In the import statements for React Native components, make sure all the paths are correct and exist in the project.
All looks good.

@rohitmalhotra1420 rohitmalhotra1420 merged commit 4db1ba5 into main Jan 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix File Download Issue After Deleting Previously Downloaded File from File Manager
2 participants