我有一个用phonegap构建的应用程序,我需要在用户触摸警报dialog...can中的按钮后打开市场,我该怎么办?多么?
我在谷歌上看到,这是可能与页面中的链接,但我需要在对话框中…
这是我的对话框:
function onConfirm(button) {
if(button == 1)
alert('market');
}
function showPrimoAvvio() {
navigator.notification.confirm(
'Se ti piace questa app ti chiediamo di lasciare un voto e un commento positivo nel market per aiutarci a sviluppare applicazioni sempre migliori!!', // message
onConfirm, // callback to invoke with index of button pressed
'Votami!', // title
'Vota,Prosegui' // buttonLabels
);
}谢谢
发布于 2012-01-17 03:02:54
在你的onConfirm方法中,一旦你检查了按钮== 1,你就可以设置:
document.location.href="market://search?q=google"例如,在Android市场上搜索谷歌的应用程序。要链接到特定的应用程序,您可以执行以下操作:
document.location.href="market://details?id=com.example.admob.lunarlander"其中com.example.admob.lunarlander是应用程序的包名。
发布于 2012-01-17 02:53:11
老实说,你只需要打开market.android.com的url,用户就可以选择“用市场打开”。
转到浏览器并输入URL即可试用!这可能是一个变通的工作,直到你能找到如何绕过它,直接进入应用程序本身。
发布于 2012-01-17 06:09:55
你可以尝试使用"shouldOverrideUrlLoading“原生函数,这里有一个关于它的很好的帖子:
Open the android market from an app
https://stackoverflow.com/questions/8884834
复制相似问题