Page 1 of 2

make phone beep, vibrate on success

Posted: Sat Mar 09, 2013 2:52 pm
by Michael4771079

Hi,
I am trying to make the phone beep on success, this is what I did

on component
sendgrid_mailsend, success, run js, navigator.notification.beep(2);

I get "undifined" in firebug,
can you help me fix this,

thanks in advance


make phone beep, vibrate on success

Posted: Sat Mar 09, 2013 3:16 pm
by maxkatz

Needs to run on the actual device (as hybrid app), won't work in the browser.


make phone beep, vibrate on success

Posted: Sun Mar 10, 2013 1:11 pm
by Michael4771079

Thanks for the info Max,
ran app on iphone 4s ios 6.01, didn't work, here is a screenshot,
I get the successor error message from

code var response = JSON.parse(jqXHR.responseText);

if (response.message == 'success') {
alert ('Thank You for Your Booking, a text message with your Taxis details will follow shortly..');
}
else if ( response.message == 'error') {
var error = response.errors[0];
alert ('Error sending email.\n'+error+'.');
}codeImage /code


make phone beep, vibrate on success

Posted: Sun Mar 10, 2013 6:57 pm
by maxkatz

Try the beep without any additional code, just run the beep on button click to make sure it works.


make phone beep, vibrate on success

Posted: Sun Mar 10, 2013 8:53 pm
by Michael4771079

Yep Max,
your right works on click,
so is there a way to run this script after or with the error and success js alert.

I wanted to run vibration on error and beep on success

thanks for the info


make phone beep, vibrate on success

Posted: Sun Mar 10, 2013 11:54 pm
by maxkatz

Test to make sure first which if-statement you run...


make phone beep, vibrate on success

Posted: Mon Mar 11, 2013 12:17 am
by Michael4771079

both if statments are in the plugin and action is on complete, I was hoping to set these two indicators, one on success and the other on error


make phone beep, vibrate on success

Posted: Mon Mar 11, 2013 1:57 am
by maxkatz

I meant, are you sure those callbacks are invoked, even without the beep?


make phone beep, vibrate on success

Posted: Mon Mar 11, 2013 2:31 am
by Michael4771079

yes Max,
I always get a success or error message when sending the message, all works perfectly,
I just wanted to add an audio or vibe notification depending on result


make phone beep, vibrate on success

Posted: Mon Mar 11, 2013 3:01 am
by maxkatz

So, just beep on click works but doesn't work in service callbacks?