2011-10-16 58 views
0

我正在將Phonegap App升級到Phonegap 1.1.0(從9.4開始),並使用新的iOS5 SDK和Xcode 4.2進行構建。如何使用Phonegap 1.1.0和iOS5獲取警報通知

嘗試使用PhoneGap 1.0.0時也是如此。

該應用程序有一個關於啓動通知對話框的按鈕,但升級後它不會觸發。

下面是從PhoneGap的應用

<!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> 

的HTML任何援助將不勝感激。

感謝

回答

0

好,相當的試錯後,修復已發現!

修改源是...

<!DOCTYPE html> 
<html> 

<head> 

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /> 

    <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 

     <link href="css/style.css" rel="stylesheet" media="screen" type="text/css"> 
      <script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.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>