[OpenSocial] Having problem using function postActivity

2010-10-23 Thread Rishi

function postActivity(){ var params = {};
params[opensocial.Activity.Field.TITLE] = 
  xyz ! ; params[opensocial.Activity.Field.BODY] =; var activity =
opensocial.newActivity(params);
opensocial.requestCreateActivity(activity,
opensocial.CreateActivityPririty.HIGH, ActivityCallback);

I have an application... and i want if someone opens my application
the update should go to his/ her friends. For that i have to use above
function.

How to use this function.. I have tried putting this code in
application html file but the text is showing up on file rather than
script

-- 
You received this message because you are subscribed to the Google Groups 
OpenSocial Application Development group.
To post to this group, send email to opensocial-...@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en.



Re: [OpenSocial] Having problem using function postActivity

2010-10-23 Thread Robson Dantas
A working code to post activities:

  function createActivity(title, msg)
{
var params = {};
params[opensocial.Activity.Field.TITLE] = title;
params[opensocial.Activity.Field.BODY] = msg;
var activity = opensocial.newActivity(params);
opensocial.requestCreateActivity(activity,
opensocial.CreateActivityPriority.HIGH, activityCallback);
}

function activityCallback(status)
{
if (status.hadError())
{
  alert(DATA: + status.getData()+  MSG:  +
status.getErrorMessage()+  CODE:  + status.getErrorCode());
}
else
{
  alert(Activity created);
}
}

Regards,

Robson Dantas
2010/10/23 Rishi riskyplay...@gmail.com


 function postActivity(){ var params = {};
 params[opensocial.Activity.Field.TITLE] = 
  xyz ! ; params[opensocial.Activity.Field.BODY] =; var activity =
 opensocial.newActivity(params);
 opensocial.requestCreateActivity(activity,
 opensocial.CreateActivityPririty.HIGH, ActivityCallback);

 I have an application... and i want if someone opens my application
 the update should go to his/ her friends. For that i have to use above
 function.

 How to use this function.. I have tried putting this code in
 application html file but the text is showing up on file rather than
 script

 --
 You received this message because you are subscribed to the Google Groups
 OpenSocial Application Development group.
 To post to this group, send email to opensocial-...@googlegroups.com.
 To unsubscribe from this group, send email to
 opensocial-api+unsubscr...@googlegroups.comopensocial-api%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/opensocial-api?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
OpenSocial Application Development group.
To post to this group, send email to opensocial-...@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en.