capacitor-read-native-setting
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

Capacitor Read Native Setting

A simple plugin to read a string from Info.plist on iOS and strings.xml on Android

Supported platforms

  • Android
  • iOS

Installation

Current release

npm install capacitor-read-native-setting

iOS

Run:

npx cap sync ios

Android

After you install the plugin, locate your MainActivity.java (can be found in /android/app/src/main/java/path/to/my/app/MainActivity.java)

Import the class and add

// import thhe class
import com.ingageco.readnativesetting.CapacitorReadNativeSetting;

// add class inside bridge activity:
add(CapacitorReadNativeSetting.class);

Finally, run:

npx cap sync android

Importing the Plugin

At the top of your file import Capacitor Plugins and this extract this plugin

import { Plugins } from '@capacitor/core';
const { CapacitorReadNativeSetting } = Plugins;

Methods

  • Retrieve a string by key
CapacitorReadNativeSetting.read({ key: 'STRING_KEY_NAME'})
.then((res) => {
    // print the value of the setting
    // res.value
});

Readme

Keywords

Package Sidebar

Install

npm i capacitor-read-native-setting

Weekly Downloads

250

Version

5.0.0

License

MIT

Unpacked Size

387 kB

Total Files

107

Last publish

Collaborators

  • ingage