# 따라서 PhoneGap에서는 media API를 통한 오디오 파일 재생으로 비프(beep)를 지원한다. # 사용자는 비프(beep)음의 파일을 저장해야 한다.. # 파일은 30초를 넘지 않아야 하며, www/root 밑에 ‘beep.wav’ 이름으로 저장해야 한다.
<plugin name="Notification" value="org.apache.cordova.Notification"/><uses-permission android:name="android.permission.VIBRATE" />
<feature name="Notification"> <param name="ios-package" value="CDVNotification"/> </feature>
navigator.notification.alert(message, alertCallback, [title], [buttonName])
// Android / BlackBerry WebWorks (OS 5.0 and higher) / iPhone
//
function alertDismissed() {
// do something
}
navigator.notification.alert(
'You are the winner!', // message
alertDismissed, // callback
'Game Over', // title
'Done' // buttonName
);
navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
// process the confirmation dialog result
function onConfirm(buttonIndex) {
alert('You selected button ' + buttonIndex);
}
// Show a custom confirmation dialog
//
function showConfirm() {
navigator.notification.confirm(
'You are the winner!', // message
onConfirm, // callback to invoke with index of button pressed
'Game Over', // title
'Restart,Exit' // buttonLabels
);
}
navigator.notification.beep(times);
// Beep twice! navigator.notification.beep(2);
navigator.notification.vibrate(milliseconds)
// Vibrate for 2.5 seconds // navigator.notification.vibrate(2500);