//check if phonegap is supported
plugins.svyphonegapPhonegap.executeScript('', [], support);
//add check for back button press
plugins.svyphonegapPhonegap.setOnBackMethod(goBack);
function support() {
application.output('supported');
phonegapEnabled = true;
}
function goBack() {
var ans = plugins.dialogs.showQuestionDialog('INFO', 'Exit App?', 'Yes', 'No');
if (ans == 'Yes') {
//exit app
plugins.svyphonegapPhonegap.exit();}
}
//Play a beep sound/ringtone on the phone
function onAction$beep(event) {
plugins.svyphonegapPhonegap.executeBeep(1);
}
//Vibrate phone for 1000 ms
function onAction$vibrate(event) {
plugins.svyphonegapPhonegap.executeVibration(1000);
}
/**
* Open the device's phone app natively and send it a number to dial
* @param {JSEvent} event the event that triggered the action
* @properties={typeid:24,uuid:"90C02F23-BB8E-42E4-8E65-1DE00DD4950E"}
*/
function onAction$openPhone(event) {
plugins.svyphonegapBrowser.openHrefTag('tel:12345678');
}
/**
* Open the device's email application natively and try to send an email
* @param {JSEvent} event the event that triggered the action
* @properties={typeid:24,uuid:"F22F6985-EE0C-4961-9406-CBDFD840B74E"}
*/
function onAction$sendEmail(event) {
plugins.svyphonegapBrowser.openHrefTag('mailto:[email protected]');
}