react-native-get-metadata
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

react-native-get-metadata

React Native Android iOS Kotlin Swift

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

Package Sidebar

Install

npm i react-native-get-metadata

Weekly Downloads

5

Version

0.1.1

License

MIT

Unpacked Size

19 kB

Total Files

20

Last publish

Collaborators

  • eduhds