5.0.0 • Published 1 month ago

capacitor-read-native-setting v5.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
1 month ago

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
});
5.0.0

1 month ago

3.1.0

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago