Funzioni e impostazioni
Configurazione Plugin Updater
Section titled âConfigurazione Plugin UpdaterâConsulta il Readme su Github per ulteriori informazioni.
CapacitorUpdater può essere configurato con queste opzioni:
| Prop | Type | Description | Default | Since |
|---|---|---|---|---|
appReadyTimeout | number | Configura il numero di millisecondi che il plugin nativo dovrebbe aspettare prima di considerare un aggiornamento ânon riuscitoâ. Disponibile solo per Android e iOS. | 10000 // (10 secondi) | |
responseTimeout | number | Configura il numero di millisecondi che il plugin nativo dovrebbe aspettare prima di considerare un timeout API. Disponibile solo per Android e iOS. | 20 // (20 secondi) | |
autoDeleteFailed | boolean | Configura se il plugin dovrebbe eliminare automaticamente i bundle non riusciti. Disponibile solo per Android e iOS. | true | |
autoDeletePrevious | boolean | Configura se il plugin dovrebbe eliminare automaticamente i bundle precedenti dopo un aggiornamento riuscito. Disponibile solo per Android e iOS. | true | |
autoUpdate | boolean | Configura se il plugin dovrebbe utilizzare lâaggiornamento automatico tramite un server di aggiornamento. Disponibile solo per Android e iOS. | true | |
resetWhenUpdate | boolean | Elimina automaticamente i bundle scaricati precedentemente quando viene installato un nuovo bundle di app nativo sul dispositivo. Disponibile solo per Android e iOS. | true | |
updateUrl | string | Configura lâURL / endpoint a cui vengono inviati i controlli degli aggiornamenti. Disponibile solo per Android e iOS. | https://plugin.capgo.app/updates | |
channelUrl | string | Configura lâURL / endpoint per le operazioni del canale. Disponibile solo per Android e iOS. | https://plugin.capgo.app/channel_self | |
statsUrl | string | Configura lâURL / endpoint a cui vengono inviate le statistiche degli aggiornamenti. Disponibile solo per Android e iOS. Imposta su "" per disabilitare la segnalazione delle statistiche. | https://plugin.capgo.app/stats | |
publicKey | string | Configura la chiave pubblica per la crittografia end to end degli aggiornamenti in tempo reale. Versione 2 Disponibile solo per Android e iOS. | undefined | 6.2.0 |
version | string | Configura la versione corrente dellâapp. VerrĂ utilizzato per la prima richiesta di aggiornamento. Se non impostato, il plugin otterrĂ la versione dal codice nativo. Disponibile solo per Android e iOS. | undefined | 4.17.48 |
directUpdate | boolean | âalwaysâ | âatInstallâ | âonLaunchâ | Configura quando il plugin dovrebbe installare direttamente gli aggiornamenti. Solo per la modalitĂ autoUpdate. Funziona bene per app di dimensioni inferiori a 10MB e con caricamenti effettuati utilizzando il flag âpartial. Gli zip o le app di dimensioni superiori a 10MB saranno relativamente lenti per gli utenti da aggiornare. - false: Non eseguire mai aggiornamenti diretti (usa il comportamento predefinito: scarica allâinizio, imposta quando in background) - atInstall: Aggiornamento diretto solo quando lâapp viene installata, aggiornata dallo store, altrimenti agisci come directUpdate = false - onLaunch: Aggiornamento diretto solo allâinstallazione dellâapp, aggiornamento dallo store o dopo lâeliminazione dellâapp, altrimenti agisci come directUpdate = false - always: Aggiornamento diretto in tutti i casi precedenti (app installata, aggiornata dallo store, dopo lâeliminazione dellâapp o la ripresa dellâapp), non agire mai come directUpdate = false - true: (deprecato) Come âalwaysâ per la compatibilitĂ con le versioni precedenti Solo per Android e iOS. | false | 5.1.0 |
autoSplashscreen | boolean | Gestisce automaticamente lâoccultamento della splashscreen quando si utilizza directUpdate. Se abilitato, il plugin nasconderĂ automaticamente la splashscreen dopo lâapplicazione degli aggiornamenti o quando non è necessario nessun aggiornamento. Ciò elimina la necessitĂ di ascoltare manualmente gli eventi appReady e chiamare SplashScreen.hide(). Funziona solo quando directUpdate è impostato su âatInstallâ, âalwaysâ o true. Richiede che il plugin @capacitor/splash-screen sia installato e configurato con launchAutoHide: false. Richiede che autoUpdate e directUpdate siano abilitati. Solo per Android e iOS. | false | 7.6.0 |
periodCheckDelay | number | Configura il periodo di ritardo per il controllo periodico degli aggiornamenti. Lâunità è in secondi. Solo per Android e iOS. Non può essere inferiore a 600 secondi (10 minuti). | 600 // (10 minuti) | |
localS3 | boolean | Configura la CLI per utilizzare un server locale per i test o un server di aggiornamento self-hosted. | undefined | 4.17.48 |
localHost | string | Configura la CLI per utilizzare un server locale per i test o un server di aggiornamento self-hosted. | undefined | 4.17.48 |
localWebHost | string | Configura la CLI per utilizzare un server locale per i test o un server di aggiornamento self-hosted. | undefined | 4.17.48 |
localSupa | string | Configura la CLI per utilizzare un server locale per i test o un server di aggiornamento self-hosted. | undefined | 4.17.48 |
localSupaAnon | string | Configura la CLI per utilizzare un server locale per i test. | undefined | 4.17.48 |
localApi | string | Configura la CLI per utilizzare un api locale per i test. | undefined | 6.3.3 |
localApiFiles | string | Configura la CLI per utilizzare un api di file locale per i test. | undefined | 6.3.3 |
allowModifyUrl | boolean | Permette al plugin di modificare dinamicamente updateUrl, statsUrl e channelUrl dal lato JavaScript. | false | 5.4.0 |
defaultChannel | string | Imposta il canale predefinito per lâapp nella configurazione. Sensibile alle maiuscole. Questa impostazione sovrascriverĂ il canale predefinito impostato nel cloud, ma rispetterĂ comunque le sostituzioni effettuate nel cloud. | undefined | 5.5.0 |
appId | string | Configura lâid dellâapp per lâapp nella configurazione. | undefined | 6.0.0 |
keepUrlPathAfterReload | boolean | Configura il plugin per mantenere il percorso URL dopo un ricaricamento. AVVERTENZA: Quando viene attivato un ricaricamento, âwindow.historyâ verrĂ cancellato. | false | 6.8.0 |
disableJSLogging | boolean | Disabilita la registrazione JavaScript del plugin. se true, il plugin non registrerĂ la console JavaScript. solo il log nativo verrĂ eseguito | false | 7.3.0 |
shakeMenu | boolean | Abilita il gesto di scuotimento per mostrare il menu di aggiornamento per scopi di debug/test | false | 7.5.0 |
In capacitor.config.json:
{ "plugins": { "CapacitorUpdater": { "appReadyTimeout": 1000 // (1 secondo), "responseTimeout": 10 // (10 secondi), "autoDeleteFailed": false, "autoDeletePrevious": false, "autoUpdate": false, "resetWhenUpdate": false, "updateUrl": https://example.com/api/auto_update, "channelUrl": https://example.com/api/channel, "statsUrl": https://example.com/api/stats, "publicKey": undefined, "version": undefined, "directUpdate": undefined, "autoSplashscreen": undefined, "periodCheckDelay": undefined, "localS3": undefined, "localHost": undefined, "localWebHost": undefined, "localSupa": undefined, "localSupaAnon": undefined, "localApi": undefined, "localApiFiles": undefined, "allowModifyUrl": undefined, "defaultChannel": undefined, "appId": undefined, "keepUrlPathAfterReload": undefined, "disableJSLogging": undefined, "shakeMenu": undefined } }}In capacitor.config.ts:
/// <reference types="@capgo/capacitor-updater" />
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { plugins: { CapacitorUpdater: { appReadyTimeout: 1000 // (1 secondo), responseTimeout: 10 // (10 secondi), autoDeleteFailed: false, autoDeletePrevious: false, autoUpdate: false, resetWhenUpdate: false, updateUrl: https://example.com/api/auto_update, channelUrl: https://example.com/api/channel, statsUrl: https://example.com/api/stats, publicKey: undefined, version: undefined, directUpdate: undefined, autoSplashscreen: undefined, periodCheckDelay: undefined, localS3: undefined, localHost: undefined, localWebHost: undefined, localSupa: undefined, localSupaAnon: undefined, localApi: undefined, localApiFiles: undefined, allowModifyUrl: undefined, defaultChannel: undefined, appId: undefined, keepUrlPathAfterReload: undefined, disableJSLogging: undefined, shakeMenu: undefined, }, },};
export default config;notifyAppReady()setUpdateUrl(...)setStatsUrl(...)setChannelUrl(...)download(...)next(...)set(...)delete(...)list(...)reset(...)current()reload()setMultiDelay(...)cancelDelay()getLatest(...)setChannel(...)unsetChannel(...)getChannel()listChannels()setCustomId(...)getBuiltinVersion()getDeviceId()getPluginVersion()isAutoUpdateEnabled()removeAllListeners()addListener('download', ...)addListener('noNeedUpdate', ...)addListener('updateAvailable', ...)addListener('downloadComplete', ...)addListener('majorAvailable', ...)addListener('updateFailed', ...)addListener('downloadFailed', ...)addListener('appReloaded', ...)addListener('appReady', ...)isAutoUpdateAvailable()getNextBundle()setShakeMenu(...)isShakeMenuEnabled()- Interfacce
- Alias di Tipo
notifyAppReady()
Section titled ânotifyAppReady()ânotifyAppReady() => Promise<AppReadyResult>Notifica a Capacitor Updater che il bundle corrente funziona (un rollback si verificherĂ se questo metodo non viene chiamato ad ogni avvio dellâapp) Per impostazione predefinita, questo metodo dovrebbe essere chiamato nei primi 10 secondi dopo lâavvio dellâapp, altrimenti si verificherĂ un rollback. Modifica questo comportamento con {@link appReadyTimeout}
Restituisce: Promise<AppReadyResult>
setUpdateUrl(âŚ)
Section titled âsetUpdateUrl(âŚ)âsetUpdateUrl(options: UpdateUrl) => Promise<void>Imposta lâupdateUrl per lâapp, questo verrĂ utilizzato per verificare gli aggiornamenti.
| Param | Type | Description |
|---|---|---|
options | UpdateUrl | contiene lâURL da utilizzare per verificare gli aggiornamenti. |
Since: 5.4.0
setStatsUrl(âŚ)
Section titled âsetStatsUrl(âŚ)âsetStatsUrl(options: StatsUrl) => Promise<void>Imposta lâstatsUrl per lâapp, questo verrĂ utilizzato per inviare le statistiche. Il passaggio di una stringa vuota disabiliterĂ la raccolta di statistiche.
| Param | Type | Description |
|---|---|---|
options | StatsUrl | contiene lâURL da utilizzare per inviare le statistiche. |
Since: 5.4.0
setChannelUrl(âŚ)
Section titled âsetChannelUrl(âŚ)âsetChannelUrl(options: ChannelUrl) => Promise<void>Imposta lâchannelUrl per lâapp, questo verrĂ utilizzato per impostare il canale.
| Param | Type | Description |
|---|---|---|
options | ChannelUrl | contiene lâURL da utilizzare per impostare il canale. |
Since: 5.4.0
download(âŚ)
Section titled âdownload(âŚ)âdownload(options: DownloadOptions) => Promise<BundleInfo>Scarica un nuovo bundle dallâURL fornito, dovrebbe essere un file zip, con file dentro o con un id univoco dentro con tutti i tuoi file
| Param | Type | Description |
|---|---|---|
options | DownloadOptions | Le {@link DownloadOptions} per scaricare un nuovo bundle zip. |
Restituisce: Promise<BundleInfo>
next(âŚ)
Section titled ânext(âŚ)ânext(options: BundleId) => Promise<BundleInfo>Imposta il bundle successivo da utilizzare quando lâapp viene ricaricata.
| Param | Type | Description |
|---|---|---|
options | BundleId | Contiene lâID del bundle successivo da impostare al prossimo avvio dellâapp. {@link BundleInfo.id} |
Restituisce: Promise<BundleInfo>
set(âŚ)
Section titled âset(âŚ)âset(options: BundleId) => Promise<void>Imposta il bundle corrente e ricarica immediatamente lâapp.
| Param | Type | Description |
|---|---|---|
options | BundleId | Un oggetto {@link BundleId} contenente il nuovo id del bundle da impostare come corrente. |
delete(âŚ)
Section titled âdelete(âŚ)âdelete(options: BundleId) => Promise<void>Elimina il bundle specificato dallâarchiviazione nativa dellâapp. Usa con {@link list} per ottenere gli ID dei Bundle memorizzati.
| Param | Type | Description |
|---|---|---|
options | BundleId | Un oggetto {@link BundleId} contenente lâID di un bundle da eliminare (nota, questo è lâid del bundle, NON il nome della versione) |
list(âŚ)
Section titled âlist(âŚ)âlist(options?: ListOptions | undefined) => Promise<BundleListResult>Ottieni tutti i bundle scaricati localmente nella tua app
| Param | Type | Description |
|---|---|---|
options | ListOptions | Le {@link ListOptions} per elencare i bundle |
Restituisce: Promise<BundleListResult>
reset(âŚ)
Section titled âreset(âŚ)âreset(options?: ResetOptions | undefined) => Promise<void>Ripristina lâapp al bundle builtin (quello inviato a Apple App Store / Google Play Store) o allâultimo bundle caricato con successo.
| Param | Type | Description |
|---|---|---|
options | ResetOptions | Contenente {@link ResetOptions.toLastSuccessful}, true ripristina il bundle builtin e false ripristinerĂ lâultimo bundle caricato con successo. |
current()
Section titled âcurrent()âcurrent() => Promise<CurrentBundleResult>Ottieni il bundle corrente, se nessuno è impostato restituisce builtin. currentNative è il bundle originale installato sul dispositivo
Restituisce: Promise<CurrentBundleResult>
reload()
Section titled âreload()âreload() => Promise<void>Ricarica la vista
setMultiDelay(âŚ)
Section titled âsetMultiDelay(âŚ)âsetMultiDelay(options: MultiDelayConditions) => Promise<void>Imposta un array {@link DelayCondition} contenente le condizioni che il Plugin utilizzerĂ per ritardare lâaggiornamento.
Dopo che tutte le condizioni sono soddisfatte, il processo di aggiornamento verrĂ eseguito di nuovo come al solito, quindi lâaggiornamento verrĂ installato dopo lâinserimento in background o lâinterruzione dellâapp.
Per il tipo date, il valore dovrebbe essere una stringa di data iso8601.
Per il tipo background, il valore dovrebbe essere un numero in millisecondi.
Per il tipo nativeVersion, il valore dovrebbe essere il numero di versione.
Per il tipo kill, il valore non viene utilizzato.
La funzione ha un comportamento incoerente, lâopzione kill attiva lâaggiornamento dopo il primo kill e non dopo il successivo background come altre opzioni. Questo verrĂ corretto in una versione principale futura.
| Param | Type | Description |
|---|---|---|
options | MultiDelayConditions | Contenente lâarray {@link MultiDelayConditions} di condizioni da impostare |
Since: 4.3.0
cancelDelay()
Section titled âcancelDelay()âcancelDelay() => Promise<void>Annulla un {@link DelayCondition} per elaborare un aggiornamento immediatamente.
Since: 4.0.0
getLatest(âŚ)
Section titled âgetLatest(âŚ)âgetLatest(options?: GetLatestOptions | undefined) => Promise<LatestVersion>Ottieni il bundle piĂš recente disponibile da update Url
| Param | Type |
|---|---|
options | GetLatestOptions |
Restituisce: Promise<LatestVersion>
Since: 4.0.0
setChannel(âŚ)
Section titled âsetChannel(âŚ)âsetChannel(options: SetChannelOptions) => Promise<ChannelRes>Imposta il canale per questo dispositivo. Il canale deve consentire lâautoassegnazione perchĂŠ questo funzioni. Non utilizzare questo metodo per impostare il canale allâavvio. Questo metodo serve a impostare il canale dopo che lâapp è pronta e lâutente ha interagito. Se desideri impostare il canale allâavvio, utilizza {@link PluginsConfig} per impostare il canale predefinito. Questo metodo invia al backend Capgo una richiesta per collegare lâID del dispositivo al canale. Capgo può accettare o rifiutare in base alle impostazioni del tuo canale.
| Param | Type | Description |
|---|---|---|
options | SetChannelOptions | Ă la {@link SetChannelOptions} canale da impostare |
Restituisce: Promise<ChannelRes>
Since: 4.7.0
unsetChannel(âŚ)
Section titled âunsetChannel(âŚ)âunsetChannel(options: UnsetChannelOptions) => Promise<void>Annulla lâimpostazione del canale per questo dispositivo. Il dispositivo tornerĂ quindi al canale predefinito
| Param | Type |
|---|---|
options | UnsetChannelOptions |
Since: 4.7.0
getChannel()
Section titled âgetChannel()âgetChannel() => Promise<GetChannelRes>Ottieni il canale per questo dispositivo
Restituisce: Promise<GetChannelRes>
Since: 4.8.0
listChannels()
Section titled âlistChannels()âlistChannels() => Promise<ListChannelsResult>Elenca tutti i canali disponibili per questo dispositivo che consentono lâautoassegnazione
Restituisce: Promise<ListChannelsResult>
Since: 7.5.0
setCustomId(âŚ)
Section titled âsetCustomId(âŚ)âsetCustomId(options: SetCustomIdOptions) => Promise<void>Imposta un ID personalizzato per questo dispositivo
| Param | Type | Description |
|---|---|---|
options | SetCustomIdOptions | è lâopzione {@link SetCustomIdOptions} customId da impostare |
Since: 4.9.0
getBuiltinVersion()
Section titled âgetBuiltinVersion()âgetBuiltinVersion() => Promise<BuiltinVersion>Ottieni la versione dellâapp nativa o la versione builtin se impostato nella configurazione
Restituisce: Promise<BuiltinVersion>
Since: 5.2.0
getDeviceId()
Section titled âgetDeviceId()âgetDeviceId() => Promise<DeviceId>Ottieni lâID univoco utilizzato per identificare il dispositivo (inviato al server di aggiornamento automatico)
Restituisce: Promise<DeviceId>
getPluginVersion()
Section titled âgetPluginVersion()âgetPluginVersion() => Promise<PluginVersion>Ottieni la versione del plugin Capacitor Updater nativo (inviato al server di aggiornamento automatico)
Restituisce: Promise<PluginVersion>
isAutoUpdateEnabled()
Section titled âisAutoUpdateEnabled()âisAutoUpdateEnabled() => Promise<AutoUpdateEnabled>Ottieni lo stato della configurazione dellâaggiornamento automatico.
Restituisce: Promise<AutoUpdateEnabled>
removeAllListeners()
Section titled âremoveAllListeners()âremoveAllListeners() => Promise<void>Rimuovi tutti i listener per questo plugin.
Since: 1.0.0
addListener(âdownloadâ, âŚ)
Section titled âaddListener(âdownloadâ, âŚ)âaddListener(eventName: 'download', listenerFunc: (state: DownloadEvent) => void) => Promise<PluginListenerHandle>Ascolta lâevento di download del bundle nellâApp. Si attiva una volta che è iniziato il download, durante il download e al termine. Questo ti restituirĂ la percentuale di download durante il download
| Param | Type |
|---|---|
eventName | âdownloadâ |
listenerFunc | (state: DownloadEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 2.0.11
addListener(ânoNeedUpdateâ, âŚ)
Section titled âaddListener(ânoNeedUpdateâ, âŚ)âaddListener(eventName: 'noNeedUpdate', listenerFunc: (state: NoNeedEvent) => void) => Promise<PluginListenerHandle>Ascolta lâevento nessun aggiornamento necessario, utile quando vuoi forzare il controllo ogni volta che lâapp viene avviata
| Param | Type |
|---|---|
eventName | ânoNeedUpdateâ |
listenerFunc | (state: NoNeedEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 4.0.0
addListener(âupdateAvailableâ, âŚ)
Section titled âaddListener(âupdateAvailableâ, âŚ)âaddListener(eventName: 'updateAvailable', listenerFunc: (state: UpdateAvailableEvent) => void) => Promise<PluginListenerHandle>Ascolta lâevento di aggiornamento disponibile, utile quando desideri forzare il controllo ogni volta che lâapp viene avviata
| Param | Type |
|---|---|
eventName | âupdateAvailableâ |
listenerFunc | (state: UpdateAvailableEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 4.0.0
addListener(âdownloadCompleteâ, âŚ)
Section titled âaddListener(âdownloadCompleteâ, âŚ)âaddListener(eventName: 'downloadComplete', listenerFunc: (state: DownloadCompleteEvent) => void) => Promise<PluginListenerHandle>Ascolta gli eventi downloadComplete.
| Param | Type |
|---|---|
eventName | âdownloadCompleteâ |
listenerFunc | (state: DownloadCompleteEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 4.0.0
addListener(âmajorAvailableâ, âŚ)
Section titled âaddListener(âmajorAvailableâ, âŚ)âaddListener(eventName: 'majorAvailable', listenerFunc: (state: MajorAvailableEvent) => void) => Promise<PluginListenerHandle>Ascolta lâevento di aggiornamento importante nellâApp, ti fa sapere quando lâaggiornamento importante è bloccato dallâimpostazione disableAutoUpdateBreaking
| Param | Type |
|---|---|
eventName | âmajorAvailableâ |
listenerFunc | (state: MajorAvailableEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 2.3.0
addListener(âupdateFailedâ, âŚ)
Section titled âaddListener(âupdateFailedâ, âŚ)âaddListener(eventName: 'updateFailed', listenerFunc: (state: UpdateFailedEvent) => void) => Promise<PluginListenerHandle>Ascolta lâevento di aggiornamento non riuscito nellâApp, ti fa sapere quando lâaggiornamento non è riuscito a installarsi al prossimo avvio dellâapp
| Param | Type |
|---|---|
eventName | âupdateFailedâ |
listenerFunc | (state: UpdateFailedEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 2.3.0
addListener(âdownloadFailedâ, âŚ)
Section titled âaddListener(âdownloadFailedâ, âŚ)âaddListener(eventName: 'downloadFailed', listenerFunc: (state: DownloadFailedEvent) => void) => Promise<PluginListenerHandle>Ascolta lâevento di download non riuscito nellâApp, ti fa sapere quando il download di un bundle non è riuscito
| Param | Type |
|---|---|
eventName | âdownloadFailedâ |
listenerFunc | (state: DownloadFailedEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 4.0.0
addListener(âappReloadedâ, âŚ)
Section titled âaddListener(âappReloadedâ, âŚ)âaddListener(eventName: 'appReloaded', listenerFunc: () => void) => Promise<PluginListenerHandle>Ascolta lâevento di ricaricamento nellâApp, ti fa sapere quando si è verificato il ricaricamento
| Param | Type |
|---|---|
eventName | âappReloadedâ |
listenerFunc | () => void |
Restituisce: Promise<PluginListenerHandle>
Since: 4.3.0
addListener(âappReadyâ, âŚ)
Section titled âaddListener(âappReadyâ, âŚ)âaddListener(eventName: 'appReady', listenerFunc: (state: AppReadyEvent) => void) => Promise<PluginListenerHandle>Ascolta lâevento app pronto nellâApp, ti fa sapere quando lâapp è pronta per lâuso
| Param | Type |
|---|---|
eventName | âappReadyâ |
listenerFunc | (state: AppReadyEvent) => void |
Restituisce: Promise<PluginListenerHandle>
Since: 5.1.0
isAutoUpdateAvailable()
Section titled âisAutoUpdateAvailable()âisAutoUpdateAvailable() => Promise<AutoUpdateAvailable>Scopri se lâaggiornamento automatico è disponibile (non disabilitato da serverUrl).
Restituisce: Promise<AutoUpdateAvailable>
getNextBundle()
Section titled âgetNextBundle()âgetNextBundle() => Promise<BundleInfo | null>Ottieni il bundle successivo che verrĂ utilizzato quando lâapp viene ricaricata. Restituisce null se nessun bundle successivo è impostato.
Restituisce: Promise<BundleInfo | null>
Since: 6.8.0
setShakeMenu(âŚ)
Section titled âsetShakeMenu(âŚ)âsetShakeMenu(options: SetShakeMenuOptions) => Promise<void>Abilita o disabilita il menu di scuotimento per scopi di debug/test
| Param | Type | Description |
|---|---|---|
options | SetShakeMenuOptions | Contiene il booleano abilitato per abilitare o disabilitare il menu di scuotimento |
Since: 7.5.0
isShakeMenuEnabled()
Section titled âisShakeMenuEnabled()âisShakeMenuEnabled() => Promise<ShakeMenuEnabled>Ottieni lo stato corrente del menu di scuotimento
Restituisce: Promise<ShakeMenuEnabled>
Since: 7.5.0
Interfacce
Section titled âInterfacceâAppReadyResult
Section titled âAppReadyResultâ| Prop | Type |
|---|---|
bundle | BundleInfo |
BundleInfo
Section titled âBundleInfoâ| Prop | Type |
|---|---|
id | string |
version | string |
downloaded | string |
checksum | string |
status | BundleStatus |
UpdateUrl
Section titled âUpdateUrlâ| Prop | Type |
|---|---|
url | string |
StatsUrl
Section titled âStatsUrlâ| Prop | Type |
|---|---|
url | string |
ChannelUrl
Section titled âChannelUrlâ| Prop | Type |
|---|---|
url | string |
DownloadOptions
Section titled âDownloadOptionsâQuesto URL e le versioni vengono utilizzati per scaricare il bundle dal server. Se utilizzi il backend, tutte le informazioni verranno fornite dal metodo getLatest. Se non utilizzi il backend, devi fornire lâURL e la versione del bundle. Checksum e sessionKey sono obbligatori se hai crittografato il bundle con il comando CLI encrypt, dovresti riceverli come risultato del comando.
| Prop | Type | Description | Default | Since |
|---|---|---|---|---|
url | string | LâURL del file zip bundle (ad esempio: dist.zip) da scaricare. (Questo può essere qualsiasi URL. Ad esempio: Amazon S3, un tag GitHub, qualsiasi altro luogo in cui hai ospitato il tuo bundle.) | ||
version | string | Il codice di versione/nome di questo bundle/versione | ||
sessionKey | string | La chiave di sessione per lâaggiornamento, quando il bundle è crittografato con una chiave di sessione | undefined | 4.0.0 |
checksum | string | Il checksum per lâaggiornamento, dovrebbe essere in sha256 e crittografato con chiave privata se il bundle è crittografato | undefined | 4.0.0 |
manifest | ManifestEntry[] | Il manifesto per i download di piĂš file | undefined | 6.1.0 |
ManifestEntry
Section titled âManifestEntryâ| Prop | Type |
|---|---|
file_name | string | null |
file_hash | string | null |
download_url | string | null |
BundleId
Section titled âBundleIdâ| Prop | Type |
|---|---|
id | string |
BundleListResult
Section titled âBundleListResultâ| Prop | Type |
|---|---|
bundles | BundleInfo[] |
ListOptions
Section titled âListOptionsâ| Prop | Type | Description | Default | Since |
|---|---|---|---|---|
raw | boolean | Se restituire lâelenco dei bundle non elaborato o il manifesto. Se true, lâelenco tenterĂ di leggere il database interno anzichĂŠ i file su disco. | false | 6.14.0 |
ResetOptions
Section titled âResetOptionsâ| Prop | Type |
|---|---|
toLastSuccessful | boolean |
CurrentBundleResult
Section titled âCurrentBundleResultâ| Prop | Type |
|---|---|
bundle | BundleInfo |
native | string |
MultiDelayConditions
Section titled âMultiDelayConditionsâ| Prop | Type |
|---|---|
delayConditions | DelayCondition[] |
DelayCondition
Section titled âDelayConditionâ| Prop | Type | Description |
|---|---|---|
kind | DelayUntilNext | Imposta le condizioni di ritardo in setMultiDelay |
value | string |
LatestVersion
Section titled âLatestVersionâ| Prop | Type | Description | Since |
|---|---|---|---|
version | string | Risultato del metodo getLatest | 4.0.0 |
checksum | string | 6 | |
major | boolean | ||
message | string | ||
sessionKey | string | ||
error | string | ||
old | string | ||
url | string | ||
manifest | ManifestEntry[] | 6.1 |
GetLatestOptions
Section titled âGetLatestOptionsâ| Prop | Type | Description | Default | Since |
|---|---|---|---|---|
channel | string | Il canale per il quale ottenere la versione piĂš recente Il canale deve consentire âself_assignâ per questo | undefined | 6.8.0 |
ChannelRes
Section titled âChannelResâ| Prop | Type | Description | Since |
|---|---|---|---|
status | string | Stato attuale del canale impostato | 4.7.0 |
error | string | ||
message | string |
SetChannelOptions
Section titled âSetChannelOptionsâ| Prop | Type |
|---|---|
channel | string |
triggerAutoUpdate | boolean |
UnsetChannelOptions
Section titled âUnsetChannelOptionsâ| Prop | Type |
|---|---|
triggerAutoUpdate | boolean |
GetChannelRes
Section titled âGetChannelResâ| Prop | Type | Description | Since |
|---|---|---|---|
channel | string | Stato attuale del canale ottenuto | 4.8.0 |
error | string | ||
message | string | ||
status | string | ||
allowSet | boolean |
ListChannelsResult
Section titled âListChannelsResultâ| Prop | Type | Description | Since |
|---|---|---|---|
channels | ChannelInfo[] | Elenco dei canali disponibili | 7.5.0 |
ChannelInfo
Section titled âChannelInfoâ| Prop | Type | Description | Since |
|---|---|---|---|
id | string | LâID del canale | 7.5.0 |
name | string | Il nome del canale | 7.5.0 |
public | boolean | Se questo è un canale pubblico | 7.5.0 |
allow_self_set | boolean | Se i dispositivi possono autoassegnarsi a questo canale | 7.5.0 |
SetCustomIdOptions
Section titled âSetCustomIdOptionsâ| Prop | Type |
|---|---|
customId | string |
BuiltinVersion
Section titled âBuiltinVersionâ| Prop | Type |
|---|---|
version | string |
DeviceId
Section titled âDeviceIdâ| Prop | Type |
|---|---|
deviceId | string |
PluginVersion
Section titled âPluginVersionâ| Prop | Type |
|---|---|
version | string |
AutoUpdateEnabled
Section titled âAutoUpdateEnabledâ| Prop | Type |
|---|---|
enabled | boolean |
PluginListenerHandle
Section titled âPluginListenerHandleâ| Prop | Type |
|---|---|
remove | () => Promise<void> |
DownloadEvent
Section titled âDownloadEventâ| Prop | Type | Description | Since |
|---|---|---|---|
percent | number | Stato attuale del download, tra 0 e 100. | 4.0.0 |
bundle | BundleInfo |
NoNeedEvent
Section titled âNoNeedEventâ| Prop | Type | Description | Since |
|---|---|---|---|
bundle | BundleInfo | Stato attuale del download, tra 0 e 100. | 4.0.0 |
UpdateAvailableEvent
Section titled âUpdateAvailableEventâ| Prop | Type | Description | Since |
|---|---|---|---|
bundle | BundleInfo | Stato attuale del download, tra 0 e 100. | 4.0.0 |
DownloadCompleteEvent
Section titled âDownloadCompleteEventâ| Prop | Type | Description | Since |
|---|---|---|---|
bundle | BundleInfo | Emesso quando è disponibile un nuovo aggiornamento. | 4.0.0 |
MajorAvailableEvent
Section titled âMajorAvailableEventâ| Prop | Type | Description | Since |
|---|---|---|---|
version | string | Emesso quando è disponibile un nuovo bundle importante. | 4.0.0 |
UpdateFailedEvent
Section titled âUpdateFailedEventâ| Prop | Type | Description | Since |
|---|---|---|---|
bundle | BundleInfo | Emesso quando un aggiornamento non è riuscito a installarsi. | 4.0.0 |
DownloadFailedEvent
Section titled âDownloadFailedEventâ| Prop | Type | Description | Since |
|---|---|---|---|
version | string | Emesso quando il download non riesce. | 4.0.0 |
AppReadyEvent
Section titled âAppReadyEventâ| Prop | Type | Description | Since |
|---|---|---|---|
bundle | BundleInfo | Emesso quando lâapp è pronta per lâuso. | 5.2.0 |
status | string |
AutoUpdateAvailable
Section titled âAutoUpdateAvailableâ| Prop | Type |
|---|---|
available | boolean |
SetShakeMenuOptions
Section titled âSetShakeMenuOptionsâ| Prop | Type |
|---|---|
enabled | boolean |
ShakeMenuEnabled
Section titled âShakeMenuEnabledâ| Prop | Type |
|---|---|
enabled | boolean |
Alias di Tipo
Section titled âAlias di TipoâBundleStatus
Section titled âBundleStatusâpending: Il bundle è in attesa di essere IMPOSTATO come bundle successivo. downloading: Il bundle è in corso di download. success: Il bundle è stato scaricato ed è pronto per essere IMPOSTATO come bundle successivo. error: Il bundle non ha scaricato.
âsuccessâ | âerrorâ | âpendingâ | âdownloadingâ
DelayUntilNext
Section titled âDelayUntilNextââbackgroundâ | âkillâ | ânativeVersionâ | âdateâ