PhoneGap - 安卓市场
我有一个使用phonegap构建的应用程序,我需要在用户触摸警报对话框中的按钮后打开市场...我可以这样做吗?如何?
我在谷歌上看到页面中可能有一个链接,但我需要在对话框中使用这个...
这是我的对话框:
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
);
}
谢谢
i have an application build with phonegap and i need to open the market after the user touch a button in an alert dialog...can i do this? how?
I see on google that is possibile with a link in the page but i need this in the dialog...
this is my dialog:
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
);
}
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在你的 onConfirm 方法中,一旦你检查了按钮 == 1,你就可以设置:
例如在 Android 市场上搜索 Google 的应用程序。要链接到特定应用程序,您可以执行以下操作:
其中 com.example.admob.lunarlander 是应用程序的包名称。
In your onConfirm method once you've checked that the button == 1 you can just set:
for instance to do a search on the Android market for apps by Google. To link to a specific app you would do:
where com.example.admob.lunarlander is the package name of your application.
老实说,您只需打开 market.android.com 网址,用户就可以选择“通过市场打开”。
请打开浏览器并输入 URL 来尝试一下!这可能是一个变通办法,直到你能弄清楚如何绕过它并直接进入应用程序本身。
You can honestly just open the market.android.com url, and the user will be able to select "open with market".
Try it by going to the browser and entering the URL! It may be a work around until you can figure out how to bypass that and go straight to the app itself.
您可以尝试使用“shouldOverrideUrlLoading”本机函数,这里有一篇关于它的好文章:
从应用程序打开 Android 市场
You can try using "shouldOverrideUrlLoading" native function, here's a good post about it:
Open the android market from an app