其他分享
首页 > 其他分享> > plus,5+app根据包名查询是否安装过某个app

plus,5+app根据包名查询是否安装过某个app

作者:互联网

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title></title>
	<script type="text/javascript">
		try {
			var packageName = 'io.dcloud.H59EAC2CB'; //包名  
			var main = plus.android.runtimeMainActivity();
			var packageManager = main.getPackageManager();
			var PackageManager = plus.android.importClass(packageManager);
			var packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
			if (packageInfo) {
				//已安装  
				plus.runtime.launchApplication({
					pname: packageName
				}, function(e) {
					alert("Open system default browser failed: " + e.message);
				});
			} else {
				//未安装  
				alert('未安装')
			}
		} catch (e) {
			//未安装  
			alert('未安装')
		}
	</script>
</head>

<body>

</body>

标签:包名,app,alert,plus,var,packageManager,安装,packageName
来源: https://blog.csdn.net/a1076454380/article/details/101273768