Socket
Book a DemoInstallSign in
Socket

capacitor-intents-android

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-intents-android

Simple intent tools for Capacitor on Android

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

capacitor-intents-android

Simple intent tools for Capacitor on Android platform.

Install

npm i capacitor-intents-android
npx cap sync

Usage

Simple Example Zebra Device

Register Listener:

CapacitorIntents.registerBroadcastReceiver({
    filters: ['com.your.custom.action', 'com.symbol.datawedge.api.RESULT_ACTION'],
    categories: ['android.intent.category.DEFAULT']
    },
    // Callback function
    (intent) => {
        console.log('Received Intent: ', intent.extras);
    })

CapacitorIntents.sendBroadcastIntent({ 
    action: 'com.your.custom.action', 
    // You can add as many extra Key : Value Pairs as Needed
    extras: {
        "com.symbol.datawedge.api.SOFT_SCAN_TRIGGER":   "TOGGLE_SCANNING"
        }
    })
    .then(
        (result) => {
            console.log('sendCommand: ', result);
        }
    );

API

  • registerBroadcastReceiver(...)
  • unregisterBroadcastReceiver(...)
  • sendBroadcastIntent(...)

registerBroadcastReceiver(...)

registerBroadcastReceiver(options: { filters: string[]; categories?: string[]; }, callback: (data: { [key: string]: any; }) => void) => any
ParamType
options{ filters: {}; categories?: {}; }
callback(data: { [key: string]: any; }) => void

Returns: any

unregisterBroadcastReceiver(...)

unregisterBroadcastReceiver(options: { id: string; }) => any
ParamType
options{ id: string; }

Returns: any

sendBroadcastIntent(...)

sendBroadcastIntent(options: { action: string; extras: { [key: string]: any; }; }) => any
ParamType
options{ action: string; extras: { [key: string]: any; }; }

Returns: any

Keywords

capacitor

FAQs

Package last updated on 06 Sep 2023

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