Automagically generate license acknowledgements for your React Native app 🚀
Android | iOS | AndroidTV | tvOS |
---|---|---|---|
yarn add with-react-native-oss-notice
or
npm i --save with-react-native-oss-notice
This tool is split into 2 parts:
- a library that lets you display native screen with a list of all dependencies and their licenses
- a config plugin (for Expo projects) and a custom cli plugin (for bare RN projects)
- Add the config plugin to the
app.json
/app.config.js
{
"expo": {
"plugins": [
+ "with-react-native-oss-notice"
]
}
}
- Set the Kotlin version for the project (might be needed for EAS)
{
"expo": {
"plugins": [
"with-react-native-oss-notice"
+ [
+ "expo-build-properties",
+ {
+ "android": {
+ "kotlinVersion": "1.7.22" // <-- add a version here for resolution, version can be newer depending on the Expo SDK version used in the project
+ }
+ }
+ ],
]
}
}
- Use the library in the codebase
import * as React from 'react';
import { Button, View } from 'react-native';
import { WithReactNativeOSSNotice } from 'with-react-native-oss-notice';
function launchNotice() {
WithReactNativeOSSNotice.launchLicenseListScreen('OSS Notice');
}
function MyComponent() {
return (
<View>
<Button onPress={launchNotice} text="Open source licenses" />
</View>
);
}
- Invoke the CLI plugin from the root of your RN app
npx react-native with-oss-notice
or
yarn react-native with-oss-notice
- Use the library in the codebase
import * as React from 'react';
import { Button, View } from 'react-native';
import { WithReactNativeOSSNotice } from 'with-react-native-oss-notice';
function launchNotice() {
WithReactNativeOSSNotice.launchLicenseListScreen('OSS Notice');
}
function MyComponent() {
return (
<View>
<Button onPress={launchNotice} text="Open source licenses" />
</View>
);
}
- ✅ You can use this library with Development Builds by adding
with-react-native-oss-notice
to yourapp.json
/app.config.js
plugins array. - ❌ This library can't be used in the "Expo Go" app because it requires custom native code.
See the contributing guide to learn how to contribute to the repository and the development workflow.
- AboutLibraries - collects and displays the license metadata for the Android app <3
- LicensePlist - generates license metadata for the iOS app <3
MIT