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

[Fix] Issues with localFileURI on iOS Simulator #38

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

Manrich121
Copy link
Contributor

@Manrich121 Manrich121 commented Dec 7, 2023

Description

Change AbstractAttachmentQueue implementation to not save the full URI in the attachments table, instead create it when needed.

Issue with iOS Simulator

When running the app in iOS Simulator, the reference to local storage is a directory generated for each debug device and would cause an error to be thrown, when the app tries to read the file.

Example:
Error: File 'file:///Users/myuser/Library/Developer/CoreSimulator/Devices/060C2A66-D025-4C79-A77A-BE20DB439D0F/data/Containers/Data/Application/BEDD6677-78EF-4198-8655-9CDA98B71BB1/Documents/attachments/7b0630be-963d-49c4-af8e-52dc817b5c95.jpg' isn't readable.

Adds

  • getLocalFilePathSuffix() to only append a filename to the attachment directory name
  • Change getLocalUri to take a filePath instead of a filename

Tested

Tested on iOS simulator <-> Android physical device

Note

Possibly breaking change if your app relies on queue.getLocalUri(filename), this will now need to change to queue.getLocalUri( queue.getLocalFilePathSuffix(filename) )

@Manrich121 Manrich121 marked this pull request as ready for review December 7, 2023 09:04
@Manrich121 Manrich121 merged commit cba8e09 into main Dec 7, 2023
1 check passed
@Manrich121 Manrich121 deleted the fix/attachments-local-uri branch December 7, 2023 09:13
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.

2 participants