@jwot/capacitor-apkupdater
v0.0.2
Published
justwei
Readme
@jwot/capacitor-apkupdater
justwei
Install
npm install @jwot/capacitor-apkupdater
npx cap syncAPI
checkPermissions()requestPermissions()openInstallSetting()install(...)addInstallListener(...)removeAllListeners()openSetting(...)openMarket(...)- Interfaces
- Type Aliases
checkPermissions()
checkPermissions() => Promise<PermissionStatus>Returns: Promise<PermissionStatus>
requestPermissions()
requestPermissions() => Promise<PermissionStatus>Returns: Promise<PermissionStatus>
openInstallSetting()
openInstallSetting() => Promise<void>install(...)
install(options: { apkPath: string; }) => Promise<InstallStatus>| Param | Type |
| ------------- | --------------------------------- |
| options | { apkPath: string; } |
Returns: Promise<InstallStatus>
addInstallListener(...)
addInstallListener(listenerFunc: (status: InstallStatus) => void) => Promise<PluginListenerHandle> & PluginListenerHandle| Param | Type |
| ------------------ | ---------------------------------------------------------------------------- |
| listenerFunc | (status: InstallStatus) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners()
removeAllListeners() => Promise<void>openSetting(...)
openSetting(options: { action: string; }) => Promise<void>| Param | Type |
| ------------- | -------------------------------- |
| options | { action: string; } |
openMarket(...)
openMarket(options?: { packageName: string; } | undefined) => Promise<void>| Param | Type |
| ------------- | ------------------------------------- |
| options | { packageName: string; } |
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
Type Aliases
PermissionStatus
{ canRequestPackageInstalls: PermissionState; // 是否有安装权限 }
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
InstallStatus
{ success: boolean; // 安装是否成功 error?: string; // 错误信息(如果有) }
