Skip to content

eduhds/react-native-get-metadata

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
# With yarn
yarn add react-native-get-metadata

cd ios && pod install

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

About

Get metadata from Info.plist (iOS) or AndroidManifest.xml (Android)

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •