angularjs - Cordova webintent 限制
问题描述
我在我的项目中使用 cordova webintent 进行内部更新。这适用于android 6。
我有这个在 android 9 中的新设备,当我尝试更新我的应用程序时,它显示 Failed to open android intent。
如果关于 android 版本有限制,我一直在网上搜索,cordova plugin webintent
但我没有任何问题。
下面是我的代码下载并调用我的 apk 文件开始安装。这同样适用于 android 版本 6。
var fileURL = cordova.file.externalDataDirectory + 'lg.apk';
var fileTransfer = new FileTransfer();
var uri = encodeURI(API_URL+"debug.apk?v="+AppVersion.version);
var errorCodes = {
'1' : 'FileTransferError.FILE_NOT_FOUND_ERR',
'2' : 'FileTransferError.INVALID_URL_ERR',
'3' : 'FileTransferError.CONNECTION_ERR',
'4' : 'FileTransferError.ABORT_ERR',
'5' : 'FileTransferError.NOT_MODIFIED_ERR'
}
fileTransfer.download(
uri,
fileURL,
function (entry) {
//promptForUpdateAndroid(entry);
/** **/
$rootScope.updatingApp = false;
$rootScope.loading = false;
func.logout();
$rootScope.$apply();
window.plugins.webintent.startActivity({
action: window.plugins.webintent.ACTION_VIEW,
url: entry.toURL(),
type: 'application/vnd.android.package-archive'
},
function () {
$rootScope.updatingApp = false;
$rootScope.$apply();
},
function () {
$rootScope.updatingApp = false;
$rootScope.$apply();
alert('Failed to open URL via Android Intent.');
console.log(entry,entry.toURL());
console.log("Failed to open URL via Android Intent. URL: " + entry.fullPath);
});
},
插件目前尚不支持任何限制吗?
解决方案
推荐阅读
- java - http://10.0.2.2:8000/req 的意外响应代码 500
- elasticsearch - 如何自动将 Cloud Datastore 实体发送到 Google Cloud 上的 Elasticsearch VM?
- c++ - 如何填充现有对象的界面?
- typescript - 如何根据输入动态指定输出对象的键
- javascript - 如果在 Angular 中使用我的模板无法正常工作
- spring-boot - 具有公开存储库的实体继承:如何合并抽象集合资源上的键
- excel - Excel 公式 IF、AND、OR - 问题
- amazon-s3 - S3:可以在我们创建存储桶,而不是在欧盟
- python - 张量流的问题,TF_SessionRun_wrapper:预期输入字典中的所有值都是 ndarray
- elasticsearch - (如何使用 rest 高级客户端和 spring 实现分页?)或 elasticsearchTemplate.queryForPage() 的替代方案