downloadUpdate

fun downloadUpdate(context: Context, appId: String, snapshotId: String): DownloadResponse?

Deprecated

No longer supported

Replace with

sync

Synchronous function to download an update for an app.

Example usage (kotlin):

val checkScope = CoroutineScope(Dispatchers.IO)
checkScope.launch {
val response = LiveUpdateManager.downloadUpdate(context, "appId", "snapshotId")
// Do something with result
println(response.body.toString())
}

Example usage (Java):

Executor executor = Executors.newSingleThreadExecutor();
executor.execute(() -> {
DownloadResponse response = LiveUpdateManager.downloadUpdate(getContext(), "appId", "snapshotId");
// Do something with result
});

Return

the DownloadResponse result

Parameters

context

an Android Context used during the download process

appId

the ID of the registered app

snapshotId

the ID of the snapshot to download


fun downloadUpdate(context: Context, appId: String, snapshotId: String, callback: DownloadCallback)

Deprecated

No longer supported

Replace with

sync

Asynchronous function to download an update for an app.

Example usage (kotlin):

LiveUpdateManager.downloadUpdate(applicationContext, "appId", "snapshotId", object : DownloadCallback {
override fun onComplete(result: DownloadResponse?) {
// Do something with result
}
})

Example usage (Java):

LiveUpdateManager.downloadUpdate(getContext(), "appId", "snapshotId", downloadResponse -> {
// Do something with response
});

Parameters

context

an Android Context used during the download process

appId

the ID of the registered app

snapshotId

the ID of the snapshot to download

callback

a DownloadCallback to handle the response from the download request