Socket
Socket
Sign inDemoInstall

@robingenz/capacitor-managed-configurations

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @robingenz/capacitor-managed-configurations

Capacitor plugin to access managed configuration settings.


Version published
Weekly downloads
856
increased by197.22%
Maintainers
1
Install size
32.3 kB
Created
Weekly downloads
 

Changelog

Source

0.1.4 (2022-01-26)

Bug Fixes

  • inline source code in esm map files (0804609)

Readme

Source


Managed Configuration

@robingenz/capacitor-managed-configurations

Capacitor plugin to access managed configuration settings.


Maintainers

MaintainerGitHubSocial
Robin Genzrobingenz@robin_genz

Installation

npm install @robingenz/capacitor-managed-configurations
npx cap sync

On Android, see Define managed configurations and follow the instructions to declare the app's managed configurations correctly.

⚠️ The iOS implementation could not be tested yet. I appreciate any feedback.

Configuration

No configuration required for this plugin.

Demo

A working example can be found here: robingenz/capacitor-plugin-demo

Usage

import { ManagedConfigurations } from '@robingenz/capacitor-managed-configurations';

const getString = async () => {
  const result = await ManagedConfigurations.getString({ key: 'server_url' });
  return result.value;
};

const getNumber = async () => {
  const result = await ManagedConfigurations.getNumber({ key: 'server_port' });
  return result.value;
};

const getBoolean = async () => {
  const result = await ManagedConfigurations.getBoolean({ key: 'download_on_cellular' });
  return result.value;
};

API

getString(...)

getString(options: GetOptions) => Promise<GetResult<string>>

Fetches the value associated with the given key, or null if no mapping exists for the given key.

Only available for Android and iOS.

ParamType
optionsGetOptions

Returns: Promise<GetResult<string>>


getNumber(...)

getNumber(options: GetOptions) => Promise<GetResult<number>>

Fetches the value associated with the given key, or null if no mapping exists for the given key.

Only available for Android and iOS.

ParamType
optionsGetOptions

Returns: Promise<GetResult<number>>


getBoolean(...)

getBoolean(options: GetOptions) => Promise<GetResult<boolean>>

Fetches the value associated with the given key, or null if no mapping exists for the given key.

Only available for Android and iOS.

ParamType
optionsGetOptions

Returns: Promise<GetResult<boolean>>


Interfaces

GetResult
PropTypeDescription
valueT | nullThe value of the configuration entry, or null if no mapping exists for the given key.
GetOptions
PropTypeDescription
keystringUnique key for the configuration entry.

Test your implementation

On Android, see Set up device owner for testing and follow the instructions to set up a device owner testing environment.

On iOS, you need to install the app as a managed app with a MDM solution.

Changelog

See CHANGELOG.md.

License

See LICENSE.

Keywords

FAQs

Last updated on 26 Jan 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc