ecency-mobile/src/utils/clipboard.js
2020-03-24 12:52:23 +02:00

19 lines
354 B
JavaScript

import { Clipboard } from 'react-native';
const readFromClipboard = async () => {
const clipboardContent = await Clipboard.getString();
return clipboardContent;
};
const writeToClipboard = async (text) => {
if (!text) {
return false;
}
await Clipboard.setString(text);
return true;
};
export { writeToClipboard, readFromClipboard };