Activity Update

It was brought to our attention that the BODY field of activity items was not supporting embedded links. Upon investigation, we realized that our friend update bodies for all updates, even hi5 generated ones, do not allow HTML of any kind because truncation can result in malformed HTML issues. So, tonight, we came up with an interim solution you can take advantage of.

We will not be able to allow embedded links in the BODY of activites for launch, but we will allow you to customize the more >> link that follows each activity BODY. To do this we added support for the OpenSocial activity URL field. This field also supports view-params to direct users to particular pages within your app. Here's an example that will link to the viewer's canvas page for your app with an additional parameter:


function createActivity(title) {
    var opts = {};

    opts[opensocial.Activity.Field.TITLE] = title;
    opts[opensocial.Activity.Field.BODY] = "Start sending gifts too!";
    var viewParams = gadgets.json.stringify({"test":"w00t!"});
    opts[opensocial.Activity.Field.URL] = "/apps/displayAppCanvas.do?appId=[APP_ID]&userId=" + viewer.getField(opensocial.Person.Field.ID) + "&view-params=" + encodeURIComponent(viewParams);

     var activity = opensocial.newActivity(opts);

    // Request the activity creation
    opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH);
}


If no URL is set, the more >> link will continue to default to the VIEWER's (the user generating the update) canvas page.

This feature will be available on sandbox tomorrow.

Leave a comment

Recent Entries

  • OpenSocial 0.8 Moved To Live Environment

    We have now finished the migration of the Platform in production to OpenSocial v0.8. We'd like to thank the developers who helped test 0.8 while...

  • Translation Service for OpenSocial Applications on hi5

    Reaching a Wider Audience: Community-based Translations for Applications Hi5 has a large audience in Spanish-speaking markets, Thailand, Romania, Portugal, and many other countries. How much...

  • OpenSocial 0.8 In Beta On hi5

    Following close behind the release of the OpenSocial 0.8 specification two months ago, we have been hard at work implementing it, and are happy to...

  • Statistics API Available on Sandbox

    The Statistics API that we announced two weeks ago is available on sandbox. Please use the endpoints described in the earlier post, prefixed with http://sandbox.hi5.com/rest....

  • hi5 Providing Library For Templates

    The hi5.template library is a browser side, Javascript library which enables you to fuse Javascript data and logic into your HTML. It simplifies writing...

Close