cap-android-intents
v1.0.92
Published
Capacitor plugin. Enables sending of direct and broadcast intents. Android only
Downloads
13
Maintainers
Readme
cap-android-intents
Capacitor plugin. Enables sending of direct and broadcast intents
Install
npm install cap-android-intents
npx cap syncAPI
Example
import { Intents } from 'cap-android-intents'Broadcast
await Intents.sendIntent({action: "com.app.exampleaction", isDirect: false})Direct
await Intents.sendIntent({action: "intent.action.example",
isDirect: true,
extras: {
foo1: "fa",
foo2: "faa"
},
data: {
foo3: "faaa",
foo4: "faaaa
},
component: {
"pkg": "com.example.app",
"cls": "app.example.ExampleActivity"
}
})sendIntent(...)
sendIntent(options: IntentCall) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------- |
| options | IntentCall |
checkIntentReceived()
checkIntentReceived() => Promise<IntentCall>Returns: Promise<IntentCall>
finish()
finish() => voidgetElapsedRealTime()
getElapsedRealTime() => Promise<ElapsedTime>Returns: Promise<ElapsedTime>
Interfaces
IntentCall
| Prop | Type |
| --------------- | ------------------------------------ |
| action | string |
| extra | { [key: string]: any; } |
| data | { [key: string]: any; } |
| isDirect | boolean |
| component | { [key: string]: any; } |
ElapsedTime
| Prop | Type |
| ---------- | ------------------- |
| time | string |
