react-native-secure-clipboard

0.1.2 • Public • Published

react-native-secure-clipboard

GitHub version Maintainability Codacy Badge

About

In iOS 10 and macOS Sierra, Apple introduced Universal Clipboard as part of their Continuity feature set (also known as Handoff). While Universal Clipboard is normally a useful feature, sometimes this can pose a risk to sensitive data. Any sensitive data that is copied on an iOS device is now available on the Mac clipboard as well, allowing the data to be read by various apps and websites on the Mac. This module allows your React Native app to copy data to the iOS clipboard without making it available to the user's Mac by flagging it with the localOnly option.

Getting started

$ npm install react-native-secure-clipboard --save

or

$ yarn add react-native-secure-clipboard

Mostly automatic installation

$ react-native link react-native-secure-clipboard

iOS

CocoaPods

  1. Add the following line to your Podfile:
pod 'RNSecureClipboard', :path => '../node_modules/react-native-secure-clipboard'
  1. Run pod install

Manual Installation

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-secure-clipboard and add RNSecureClipboard.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNSecureClipboard.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

Usage

import RNSecureClipboard from 'react-native-secure-clipboard';
 
const str = "Copy this string to the clipboard";
RNSecureClipboard.setString(str);
 

Package Sidebar

Install

npm i react-native-secure-clipboard

Weekly Downloads

9

Version

0.1.2

License

MIT

Unpacked Size

22.9 kB

Total Files

23

Last publish

Collaborators

  • rajivshah3