react-native-get-metadata
v0.1.1
Published
Get metadata from Info.plist (iOS) or AndroidManifest.xml (Android)
Downloads
32
Readme
react-native-get-metadata
Get metadata from Info.plist (iOS) or AndroidManifest.xml (Android).
Why?
There is a old and inactive lib for that, so I decided to create a new to add support for latest React Native versions and use Swift and Kotlin as native languages.
Installation
npm install react-native-get-metadata
# OR
yarn add react-native-get-metadata
Usage
- AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
...
<application>
...
<meta-data android:name="API_KEY" android:value="example_api_key" />
</application>
</manifest>
- Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
...
<key>API_KEY</key>
<string>example_api_key</string>
</dict>
</plist>
- React Native
import GetMetadata from 'react-native-get-metadata';
const data = await GetMetadata.forKey('API_KEY');
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library