react-native-clipboard / clipboard

React Native Clipboard API for both iOS and Android.
MIT License
690 stars 142 forks source link

Provide toast options to be visible / hidden on setting Clipboard.setString('') at each event #179

Open Shubhamrathore3196 opened 1 year ago

Shubhamrathore3196 commented 1 year ago

Description of Feature

Please provide additional props of Clipboard to show / hide toast when : Clipboard.setString() is triggered .

There are third party tools available that steals data saved on clipboard and to prevent this : our team has decided to use Clipboard.setString('') to empty string thus clearing all the data ;

but this has triggered another issue : A toast is kept visible after setting Clipboard text to empty : with name : Copied to Clipboard .

The enhancement of this issue : https://github.com/react-native-clipboard/clipboard/issues/85

has caused a new issue to reopen for our team .

Please help on this as soon as possible .

Team Airtel Bharti (India)
shubham6.singh@airtel.com

ravirajn22 commented 1 year ago

Hiding the default toast is impossible from Android 13. Since the toast is shown by Android when setting Clipboard data. https://developer.android.com/develop/ui/views/touch-and-input/copy-paste#Feedback You have to probably check if there is any possibility of clearing data instead of setting empty string. I don't know if there exist any API.

Shubhamrathore3196 commented 1 year ago

Hiding the default toast is impossible from Android 13. Since the toast is shown by Android when setting Clipboard data. https://developer.android.com/develop/ui/views/touch-and-input/copy-paste#Feedback You have to probably check if there is any possibility of clearing data instead of setting empty string. I don't know if there exist any API.

Yes you are right .. we have to use native textInput as last resort both for android and IOS .