Skip to content

When you need to do a custom package for react-native, and you have some advanced settings on native as add framework into ios, you will like it.

Notifications You must be signed in to change notification settings

yutin1987/react-native-link-package

Repository files navigation

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: () => {},
    }],
  }
});

About

When you need to do a custom package for react-native, and you have some advanced settings on native as add framework into ios, you will like it.

Resources

Stars

Watchers

Forks

Packages

No packages published