|
|
SendingMessages
Sending messages
0.8 - Handling responses
Handle responses by supplying a callback function to the sendMessage call:
function sendEmail() {
var params = [];
params[opensocial.Message.Field.TITLE]="Hola!";
var body="Como estas?";
var message = opensocial.newMessage(body, params);
var recipient = opensocial.DataRequest.PersonId.OWNER;
opensocial.requestSendMessage(recipient, message, callback);
}
function callback(data) {
if (data.hadError()) {
alert(data.getErrorCode());
} else {
alert("Ok");
}
};
sendEmail();
Sign in to add a comment

this code is working fine but when i pass the "recipient" as an array of ids it is throwing javascript error."d has no properties"
can any one help me here
Please star this issue in the tracker:
http://code.google.com/p/opensocial-resources/issues/detail?id=179