capacitor-intents-android
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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(...)

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

Returns: any


unregisterBroadcastReceiver(...)

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

Returns: any


sendBroadcastIntent(...)

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

Returns: any


Readme

Keywords

Package Sidebar

Install

npm i capacitor-intents-android

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

27.2 kB

Total Files

20

Last publish

Collaborators

  • snaptrap