Skip to content

Latest commit

 

History

History
64 lines (52 loc) · 1.9 KB

README.md

File metadata and controls

64 lines (52 loc) · 1.9 KB

react-native-link-package

When you are building custom npm module for react-native and you have to add advanced settings on the native side, such as adding frameworks for iOS, you will like it.

Commitizen friendly NPM version

build status

Build Status codecov

user guide

step 1: add commands in package.json

ex: package.json

  "rnpm": {
    "commands": {
      "postlink": "node node_modules/${packageName}/script/postlink",
      "postunlink": "node node_modules/${packageName}/script/postunlink"
    }
  }

stup 2: invoke react-native-link-package and setup configs

postlink.js or postunlink.js

const rnlp = require('react-native-link-package');

rnlp.link({
  packageName: '',
  framework: {
    path: '',
    files: [],
  },
  compiles: ['com.facebook.android:account-kit-sdk:4.+'],
  permissions: ['RECEIVE_SMS'],
  android: {
    params: [{
      name: 'APP_KEY',
      message: 'What\'s your app key for android ?',
    }],
    activities: {
      'com.facebook.accountkit.ui.AccountKitEmailRedirectActivity': {
        action: ['VIEW'],
        category: ['DEFAULT', 'BROWSABLE'],
      },
    },
  }
  ios: {
    params: [{
      name: 'APP_KEY',
      message: 'What\'s your app key for ios ?',
      link: () => {},
      unlink: () => {},
    }],
  }
});