[Fix] Issues with localFileURI on iOS Simulator #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Change
AbstractAttachmentQueue
implementation to not save the full URI in theattachments
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 afilename
to the attachment directory namegetLocalUri
to take afilePath
instead of afilename
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 toqueue.getLocalUri( queue.getLocalFilePathSuffix(filename) )