TwclTimelineChannel.CreateActivity(string,TwclUserActivity) Method

Creates (or gets) a User Activity with the specified ID.

Namespace: wclTimeline
public
 function CreateActivity(const Id: string;
 out Activity: TwclUserActivity): Integer;

Parameters

Id
Type: string

The identifier for the User Activity.

Activity
Type: TwclUserActivity

If the method completed with success on output contains the created User Activity object.

An application is responsible to release the User Activity object returned by this method.

Return Value

Type: Integer

If the function succeed the return value is wclErrors.WCL_E_SUCCESS. Otherwise the method returns one of the WCL error codes.

Your application should name activities in such a way that same ID is generated each time the user is in a particular location in the app. For example, if your application is page-based, use an identifier for the page, if it’s document based, use the name of the doc (or a hash of the name).

If there is an existing activity in the feed with the same ID, that activity will be return from the channel (with the UserActivity object State property set to asPublished). If there is no activity with that name, and new activity with State set to asNew.

Activities are scoped to your app, there is no need to worry about your activity ID colliding with IDs from other applications.