updateApp static method
Download the app and update
appleUrl: This is the app store url of the app store, used to jump to the app store
appleId: This is the app id of the app store, used to jump to the app store
locale: This is the app store locale of the app store, used to jump to the app store with appleId. delfult is 'cn'.
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 appleStoreUrl,
String? title,
String description = "应用更新",
}) async {
var result = await _channel.invokeMethod('updateApp', {
ArgumentName.url: url,
ArgumentName.title: title ?? appName(url),
ArgumentName.description: description,
ArgumentName.appleStoreUrl: appleStoreUrl,
});
if(result is! int){
throw result;
}
return result;
}