install static method
for Android : install apk by its file absolute path | for iOS: go to app store by the url;
if the target platform is higher than android 24:
a appId is not required
(the caller's applicationId which is defined in build.gradle)
Implementation
static Future<dynamic> install(String filePathOrUrlString, String ButtonName,
{String ohosAppId = ''}) async {
if (Platform.operatingSystem == 'ohos') {
if (ButtonName == 'installApk') {
return installApk(filePathOrUrlString, ohosAppId: ohosAppId);
} else {
return goStore(filePathOrUrlString);
}
}
return {'isSuccess': false, 'errorMessage': 'unsupported device'};
}