updateApp static method
Download the app and update
appleId: This is the app id of the app store, used to jump to the app store
url: This is the URL to download the apk file
title: Android download the title displayed in the notification bar, generally use the file name, or like this update version 1.6
description: Android download the description displayed in the notification bar, similar to the subtitle
@return -1
-> download failed
, 0
-> There is a current apk locally, and the download is successful
, other (int) -> downloadId
Implementation
static Future<int> updateApp({
required String url,
required String appleId,
String? title,
String description = "应用更新",
}) async {
var result = await _channel.invokeMethod('updateApp', {
ArgumentName.url: url,
ArgumentName.title: title ?? appName(url),
ArgumentName.description: description,
ArgumentName.appleId: appleId
});
return result;
}