Socket
Socket
Sign inDemoInstall

@nativescript-community/capacitor-plugins

Package Overview
Dependencies
Maintainers
11
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nativescript-community/capacitor-plugins

A native plugin for Capacitor created by NativeScript


Version published
Maintainers
11
Created
Source

@nativescript-community/capacitor-plugins

✅ This repository is test repository, and not release @nativescript-community/capacitor-plugins now.

👊 Try this project

Please clone, and npm link in your local.

% git clone git@github.com:nativescript-community/capacitor-plugins.git
% cd capacitor-plugins && npm install
% npm link

📱 Install in your Capacitor Project

PreInstall in your project

% npm install @capacitor/cli@next --save-dev
% npm install @capacitor/core@next --save
% npm install @nativescript/capacitor

Install

% npm install --save @nativescript-community/capacitor-plugins

Change your project

1. Add src/nativescript/index.ts

Add the following code:

  import '@nativescript/capacitor/bridge';
+ import * as Plugins from '@nativescript-community/capacitor-plugins';

+ native = Object.assign(native, Plugins);
...

Example demo is here.

2. Change src/native-custom.d.ts

Replace the following code:

+ import type { NSPlugins } from '@nativescript-community/capacitor-plugins/src/interfaces';

  declare module '@nativescript/capacitor' {
    export interface customNativeAPI extends nativeCustom {}
  }

  /**
   * Define your own custom strongly typed native helpers here.
   */
- export interface nativeCustom {
+ export interface nativeCustom extends NSPlugins {

Example demo is here.

Usage

Usage Example demo is here..

1. brightness(value: number)

You can change device brightness (1〜10). This is official example code.

import { native } from '@nativescript/capacitor';

native.brightness(1);

Demo Code

You can check Native Console Log. This is official example code.

import { native } from '@nativescript/capacitor';

native.dreamBig();

And Launch Native Modal View. This is official example code.

import { native } from '@nativescript/capacitor';

native.openNativeModalView();

Option

If you want use some plugin only:

You should select plugin and import.

src/nativescript/index.ts:

import { brightness } from '@nativescript-community/capacitor-plugins';
native = Object.assign(native, {
  brightness,
});

src/native-custom.d.ts:

import type { IBrightness } from '@nativescript-community/capacitor-plugins/src/interfaces';
export interface nativeCustom extends IBrightness {
  dreamBig: () => NativeProperty<string>;
  openNativeModalView: () => void;
}

FAQs

Package last updated on 21 Feb 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc