1.0.92 • Published 1 year ago
cap-android-intents v1.0.92
cap-android-intents
Capacitor plugin. Enables sending of direct and broadcast intents
Install
npm install cap-android-intents
npx cap sync
API
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() => void
getElapsedRealTime()
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 |