Hi everyone
I need some serious help. I am working on a sms widget where I have to locate the user and send the location out to another party.
var messageText = "xxx is traveling from YYY";
1) xxx I need to obtain their phone name
2) The location they are at YYY
Below is my sms coding that only able to send out but cannot get the phone name and location they are at. To determine their location is it something to do with reverse geocoding ?
function smsSending(){
var criteria = new Object();
//Setting the type of the message
criteria.MessageType = "SMS";
var phoneNumber = document.getElementById("recTxt").value;
if (phoneNumber != null) {
//Setting the "To" field of the message, can't be empty
criteria.To = phoneNumber;
}
//else {alert("Phone number is empty"); return;}
var messageText = "??? is traveling from ???";
//document.getElementById("message").value;
if (messageText != null) {
//Setting the body text field of the message, can't be empty
criteria.BodyText = messageText;
}
//else {alert("Text is empty");return;}
try {
//Send the message asynchronously
serviceObj.IMessaging.Send(criteria, onSendDone);
}
catch(exception) {
alert("SendSMS error: " + exception);
}
// Called when asynchronous message sending has completed
function onSendDone(transId, eventCode, result) {
checkError(result);
}
function checkError(error) {
if (error.ErrorCode != 0) {
alert("Error in sending message");
}
else {
alert("Message was sent succesfully");
}
}
}

Reply With Quote


