如何获取警报通知以与 Phonegap 1.1.0 和 iOS5 配合使用
我正在将 Phonegap 应用程序升级到 Phonegap 1.1.0(从 9.4 开始),并使用新的 iOS5 SDK 和 Xcode 4.2 进行构建。
尝试 PhoneGap 1.0.0 时也会发生同样的情况。
该应用程序有一个“关于”按钮,可启动通知对话框,但升级后不会触发。
这是来自 Phonegap 应用程序的 HTML
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="utf-8" src="phonegap.1.1.0.min.js"></script>
<script type="text/javascript" charset="utf-8">
function onDeviceReady(){
//do something
}
function OnPageLoad(){
document.addEventListener("deviceready",onDeviceReady,false);
}
function alertDismissed() {
// do something
}
function onAlertBtn()
{
navigator.notification.alert("Test Alert Message", alertDismissed, "Test Alert", "Done");
}
</script>
</head>
<body onload="OnPageLoad()">
<div align="center">
<FORM>
<INPUT type="button" style="font-size: 18px;" value="About" onClick="onAlertBtn();" >
</FORM> </div>
</body>
</html>
如有任何帮助,我们将不胜感激。
谢谢
I am upgrading a Phonegap App to Phonegap 1.1.0 (from 9.4) and building with the new iOS5 SDK and Xcode 4.2.
The same happens when trying PhoneGap 1.0.0 as well.
The app has an about button that launches a notification dialog, but it is not firing after upgrading.
Here is the HTML from the Phonegap App
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="utf-8" src="phonegap.1.1.0.min.js"></script>
<script type="text/javascript" charset="utf-8">
function onDeviceReady(){
//do something
}
function OnPageLoad(){
document.addEventListener("deviceready",onDeviceReady,false);
}
function alertDismissed() {
// do something
}
function onAlertBtn()
{
navigator.notification.alert("Test Alert Message", alertDismissed, "Test Alert", "Done");
}
</script>
</head>
<body onload="OnPageLoad()">
<div align="center">
<FORM>
<INPUT type="button" style="font-size: 18px;" value="About" onClick="onAlertBtn();" >
</FORM> </div>
</body>
</html>
Any assistance would be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,经过大量的尝试和错误,已经找到了解决办法!
将源修改为...
Ok, after considerable trial and error, a fix has been found!
Modify the source to be...