app-intent-launcher
v1.0.0
Published
allows opening other apps with app intent on tv os (android focus)
Maintainers
Readme
app-intent-launcher
allows opening other apps with app intent on tv os (android focus)
Install
npm install app-intent-launcher
npx cap syncAPI
echo(...)launchApp(...)getInstalledPackages()searchPackages(...)launchSelf()displayToast(...)- Interfaces
- Type Aliases
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: Promise<{ value: string; }>
launchApp(...)
launchApp(options: LaunchAppOptions) => Promise<LaunchAppResult>Launches an app by package name (Android).
- packageName: required package id (eg. "com.netflix.ninja")
- component: optional component (package/class) to launch
- extras: optional intent extras sent as key/value strings
- flags: optional integer bitflags for the intent
Returns { success: true } on a fired intent, or { success: false, message } on error.
| Param | Type |
| ------------- | ------------------------------------------------------------- |
| options | LaunchAppOptions |
Returns: Promise<LaunchAppResult>
getInstalledPackages()
getInstalledPackages() => Promise<GetPackagesResult>Returns: Promise<GetPackagesResult>
searchPackages(...)
searchPackages(options: SearchPackagesOptions) => Promise<GetPackagesResult>| Param | Type |
| ------------- | ----------------------------------------------------------------------- |
| options | SearchPackagesOptions |
Returns: Promise<GetPackagesResult>
launchSelf()
launchSelf() => Promise<LaunchAppResult>Returns: Promise<LaunchAppResult>
displayToast(...)
displayToast(options: DisplayToastOptions) => Promise<void>Displays an Android Toast message.
| Param | Type |
| ------------- | ------------------------------------------------------------------- |
| options | DisplayToastOptions |
Interfaces
LaunchAppResult
| Prop | Type |
| -------------- | -------------------- |
| success | boolean |
| returned | boolean |
LaunchAppOptions
| Prop | Type |
| ----------------- | ------------------------------------------------------------------------------------ |
| packageName | string |
| action | string |
| data | string |
| extras | Record<string, string | number | boolean> |
GetPackagesResult
| Prop | Type |
| -------------- | --------------------- |
| packages | string[] |
SearchPackagesOptions
| Prop | Type |
| ----------- | ------------------- |
| query | string |
DisplayToastOptions
| Prop | Type |
| -------------- | ------------------------------ |
| msg | string |
| duration | 'short' | 'long' |
Type Aliases
Record
Construct a type with a set of properties K of type T
{ [P in K]: T; }
