You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a capture, trying to share using the resultant URI results in an empty message which is rejected by the elected app to share to.
constcaptureReceipt=async()=>{if(!viewShotRef.current?.capture){console.error('Failed to capture receipt: viewShotRef is not defined');return;}try{consturi=awaitcaptureRef(viewShotRef,{fileName: `payment-receipt-${newDate().toISOString()}`,format: 'png',quality: 0.9,});console.log(uri);Share.share({url: `file://${uri}`});}catch(error){console.error('Failed to capture receipt',error);}};
The image URI doesn't produce an empty message when shared.
Actual behavior
Share bottom sheet has no content, only contacts/apps:
If an app is selected:
Steps to reproduce the behavior
See code above
The text was updated successfully, but these errors were encountered:
jordanwegener
changed the title
On Android, captured image cannot be shared
On Android, captured image cannot be shared (empty share dialog)
Aug 1, 2024
Looked further into this and it seems that react native's Share and the Share provided by react-native-share are both unable to access the file created by ViewShot. After copying it out of the app's cache and into external storage using react-native-fs it can be shared from there.
Not sure if this is specific to the app I'm working on or a broader issue with ongoing android compat. As it's not mentioned anywhere in docs (where sharing the resultant file is mentioned) I assume it's not the expected outcome so I'm inclined to leave this open until a maintainer can comment
Captured image cannot be shared on Android
After a capture, trying to share using the resultant URI results in an empty message which is rejected by the elected app to share to.
Version & Platform
"react-native-view-shot": "^3.8.0"
"react-native": "0.74.1"
Platform: Android
Expected behavior
The image URI doesn't produce an empty message when shared.
Actual behavior
Share bottom sheet has no content, only contacts/apps:
If an app is selected:
Steps to reproduce the behavior
See code above
The text was updated successfully, but these errors were encountered: