Timeline Framework C++ Edition

◆ CreateActivity()

int CreateActivity ( const tstring Id,
CwclUserActivity *&  Activity 
)

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

Parameters
IdThe identifier for the User Activity.
ActivityIf 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.
Returns
If the function succeed the return value is 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.

See also
CwclUserActivity