Sending Activities

Creating an activity

Activities are users’ action history, such as “(Name) recorded a new high score” and “(Name) has moved to the next level”. Sent activities are displayed in chronological order on the “My Page” of the user’s friends.

The following is sample code for sending an activity:

  • Use opensocial.Activity.Field to set the activity information you would like to send.
  • Create an activity using the opensocial.newActivity() method.
  • Make the generated Activity object an argument and call the opensocial.requestCreateActivity() method to generate an activity.
  • Make the generated Activity object an argument and call the opensocial.requestCreateActivity() method to generate an activity.
  • Once the server request process is complete, the callback function specified with send() is executed using the DataResponse that contains the request results as an argument.
  • Process the data that is stored in DataResponse.

Restrictions on sending activities

There are currently several restrictions on sending activities:

  • Only one activity can be sent to a specific user per minute.
  • Do not set the free text from the user as opensocial.Activity.Field.TITLE.
  • Do not set the free text from the user as opensocial.Activity.Field.BODY.
  • The maximum number of characters allowed in opensocial.Activity.Field.TITLE is 21 double-byte characters.
  • The maximum number of characters allowed in opensocial.Activity.Field.BODY is 140 double-byte characters.
  • Pictographs cannot be used in opensocial.Activity.Field.TITLE.
  • Pictographs cannot be used in opensocial.Activity.Field.BODY.

Revision History

  • 12/2010
    • Initial Release.

PREVIOUS

Acquiring user profile information and Mobatomo (Friend) information

NEXT

Saving, acquiring, and deleting application data