목차

Notification

설명

제약사항

Android

notification.beep

iOS

notification.beep

# 따라서 PhoneGap에서는 media API를 통한 오디오 파일 재생으로 비프(beep)를 지원한다. # 사용자는 비프(beep)음의 파일을 저장해야 한다.. # 파일은 30초를 넘지 않아야 하며, www/root 밑에 ‘beep.wav’ 이름으로 저장해야 한다.

notification.vibrate

환경 설정

Android

<plugin name="Notification" value="org.apache.cordova.Notification"/>
<uses-permission android:name="android.permission.VIBRATE" />

iOS

    <feature name="Notification">
        <param name="ios-package" value="CDVNotification"/>
    </feature>

관련 함수

notification.alert

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
);

notification.confirm

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
    );
}

notification.beep

navigator.notification.beep(times);
// Beep twice!
navigator.notification.beep(2);

notification.vibrate

navigator.notification.vibrate(milliseconds)
// Vibrate for 2.5 seconds
//
navigator.notification.vibrate(2500);

참고 자료