Describe the bug
I'm working on an instant messaging app that supports file sharing. Like in many other apps, you can share an image from the image view screen again in the same app (i.e. to a different recipient or a group chat).
However, when I try to do that using expo-share-intent I found that the file size is 0 when receiving the file on Android. While on iOS the sharing works only for the first time. If I repeat the steps for sharing I get hasShareIntent: false.
To Reproduce
add an image to your app
share the image and choose your app as the destination
File is loaded from cache (i.e. file:///data/user/0/<package.name>/cache/file-1721116567725.png)
I'm using expo-file-system to retrieve the size info (FileSystem.getInfoAsync):
{
"exists": true,
"isDirectory": false,
"modificationTime": 1721116567.721,
"size": 279812, // <- this is before the share intent is trigger, when calling the same function from the share intent screen the size will be 0
"uri": "file:///data/user/0/<package.name>/cache/file-1721116567725.png" // <- path is the same
}
Sharing is done via Share API from react-native on iOS and expo-sharing for Android
When FileSystem.cacheDirectory is used this won't work. For whatever reason when FileSystem.documentDirectory is used the file is read properly and size is not 0
Describe the bug I'm working on an instant messaging app that supports file sharing. Like in many other apps, you can share an image from the image view screen again in the same app (i.e. to a different recipient or a group chat). However, when I try to do that using expo-share-intent I found that the file size is 0 when receiving the file on Android. While on iOS the sharing works only for the first time. If I repeat the steps for sharing I get
hasShareIntent: false
.To Reproduce
Environment
Additional context
File is loaded from cache (i.e.
file:///data/user/0/<package.name>/cache/file-1721116567725.png
)I'm using
expo-file-system
to retrieve the size info (FileSystem.getInfoAsync):Sharing is done via Share API from
react-native
on iOS andexpo-sharing
for Androidexpo version (ex: 49) : 51.0.20
using firebase : yes
using static build : yes
routing : react-navigation
package version (ex: 1.2.0) : 2.3.0
platform target : Android
device : simulator and real device
type: local build (using eas build --local)