alinz / react-native-share-extension

react-native as an engine to drive share extension
MIT License
767 stars 401 forks source link

🔥How to clear image from bundle when app goes in background after receiving image prop #208

Open hackrx opened 4 years ago

hackrx commented 4 years ago

I have two screens in my app first is Test screen and another one is Image upload screen, When I share an image from the gallery, I then navigate to Image upload screen (my app contains logic for this which checks if image data is received with the help of ShareExtension.data() then it will navigate the user to Image upload screen ), when I have done with upload part then I managed to navigate to Test screen, but now if I press the home button (which makes the app in background state) then again If I open the app from the recent apps, I am again receiving the same image path. Which I don't want to receive because I am done with the upload part, which in result navigating user to the Image Upload screen. I want to clear the image path stored in the native part, any workAround for this?. I have tried ShareExtension.close() but it simply closes my application.

mayureshpr commented 3 years ago

Any solution to this? I am also facing the same issue and couldn't figure out how can I clear shared extension data without closing the app. For image each time, path in value is different so it's not possible to compare if it's the same old data and ignore.