用PhoneGap打开Play商店
问题描述:
我正在用Phonegapp开发一个非常简单的webapp,当用户单击某个特定按钮时,我想打开Play商店APP(Android)。我看了一些答疑一个,但我不知道我该怎么办呢 我有这样一个index.html的:用PhoneGap打开Play商店
<!DOCTYPE html>
<html>
<head>
<title>Just a development test ->dany_danay</title>
<link href="jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquery.mobile-1.0a3.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
var watchID = null;
var pictureSource; // Origen de la imagen
var destinationType; // Formato del valor retornado
// Espera a que PhoneGap conecte con el dispositivo.
//
document.addEventListener("deviceready",onDeviceReady,false);
function alertDismissed() {
// do something
}
</script>
</head>
<body>
<div data-role="page" id="page">
<div data-role="header">
<h1>Your SmartPhone info</h1>
</div>
<center><a href="https://play.google.com/store/apps/details?id=com.tusmartphone.dany&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS50dXNtYXJ0cGhvbmUuZGFueSJd" rel="external" /><img src="http://media.go2speed.org/brand/files/offermobi/1981/20130605194659-WARFAL_b01_320X50_04.png"/></a>
</center>
</body>
</html>
我试图在添加rel =“外部”或相对=“系统” 和这个js功能:
<script type="text/javascript">
$(function() {
updateAndroidMarketLinks();
// some more core here ...
function updateAndroidMarketLinks()
{
var ua = navigator.userAgent.toLowerCase();
if (0 <= ua.indexOf("android")) {
// we have android
$("a[href^='http://play.google.com/']").each(function() {
this.href = this.href.replace(/^http:\/\/play\.google\.com\//,
"market://");
});
}
}
});
</script>
我得叫意图,但不知道我怎么可以用HTML或JS ... 不知道如何证明这样做的:https://stackoverflow.com/questions/15325864/phonegap-android-open-play-store或本:How to Open Google Play store from Phonegaphttp://tannerburson.com/blog/2012/05/28/IntentChooser-my-first-PhoneGap-Cordova-plugin/
答
你想要使用市场链接。
market://details?id=<package_name>
http://developer.android.com/distribute/googleplay/promote/linking.html
链接已损坏 –