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.
ex: package.json
"rnpm": {
"commands": {
"postlink": "node node_modules/${packageName}/script/postlink",
"postunlink": "node node_modules/${packageName}/script/postunlink"
}
}
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: () => {},
}],
}
});