// Create the activity item with a title - the title is a required field and the main text of the item
var activity = opensocial.newActivity("Something awesome just happened.");
// You can set the icon url, this field is optional
activity.setField(opensocial.Activity.Field.STREAM_FAVICON_URL, 'http://images.hi5.com/images/icons/_/update_widget.png');
// This actually creates the activity item. Currently priorities are treated the same, and all requests should be allowed
opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority['HIGH']);
Supported Fields:
- STREAM_FAVICON_URL
- TITLE
- APP_ID - setting this does nothing, but the appId is pulled from the Hi5AuthToken
- USER_ID - this also is pulled from the Hi5AuthToken currently, so it is always the logged in user, or viewer
- POSTED_TIME - this is assumed to be the time the request is received
Next Steps:
- Complete support for 0.6 fields
- BODY - additional text
- MEDIA_ITEMS - images
- STREAM_SOURCE_URL, STREAM_URL, URL
- Move on to OpenSocial 0.7
- TITLE_ID, BODY_ID, TEMPLATE_PARAMS - support for activity stream templates
Leave a comment