Skip to content

Latest commit

 

History

History
84 lines (64 loc) · 1.77 KB

File metadata and controls

84 lines (64 loc) · 1.77 KB

npm version

React Native Crypto

Common encryption/decryption for react-native

Features

  • RSA
  • AES
  • Hmac
  • Pbkdf2
  • Sha

Installation

npm install @trackforce/react-native-crypto

or

yarn add @trackforce/react-native-crypto

Linking Automatically

react-native link

Linking Manually

iOS

  • See Linking Libraries OR
  • Drag RCTCrypto.xcodeproj to your project on Xcode.
  • Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag libRCTCrypto.a from the Products folder inside the RCTCrypto.xcodeproj.

(Android)

...
include ':@trackforce/react-native-crypto'
project(':@trackforce/react-native-crypto').projectDir = new File(rootProject.projectDir, '../node_modules/@trackforce/react-native-crypto/android')
  • In android/app/build.gradle
...
dependencies {
    ...
    compile project(':@trackforce/react-native-crypto')
}
  • register module (in MainApplication.java)
......
import com.trackforce.aes.RCTCryptoPackage;

......

@Override
protected List<ReactPackage> getPackages() {
   ......
   new RCTCryptoPackage(),
   ......
}

Local development

  1. yarn install
  2. cd demo
  3. yarn install
  4. react-native run-ios

Note: React native doesn't support Symlinks. See Stackoverflow.

Usage

Example

See example App.tsx for usage

methods

See Typescript typings