Now that Timeline is a useable feature in Windows 10 Insider Preview build 17063, Microsoft has detailed instructions for developers on providing Windows Timeline in their own apps. On the Windows Blog, “Application Engagement in Windows Timeline with User Activities,” provides intricate instructions for developers to integrate Windows Timeline into their apps.
Starting with Windows Insider Preview build 17056 and higher, developers can use User Activities to appear their apps in Timeline. If developers write User Activities into the Microsoft Graph, specific content within their apps can trigger a destination that is in Windows 10, and can be accessed using an Android or iOS device.
As noted by Microsoft, each User Activity that is implemented with an app can trigger a separate “Activity Session.”
“Each User Activity represents a single destination within your app: such as a TV show, document or your current campaign in a game. When you engage with that activity (by creating an Activity Session), the system creates a history record indicating the start and end time for that activity. As you re-engage with that User Activity over time, multiple History Records will be recorded for a single User Activity.”
In order to get started, developers will need to install the Windows SDK for Windows 10 Fall Creators Update or the latest Windows Insider Preview SDK. You will need Visual Studio 2017 in order to use the Windows Insider Preview SDK. If developers are interested in trying out Timeline, they will need to install the latest Windows Insider Preview. Here’s a look at how developers can engage customers using Microsoft Graph, Adaptive Cards, and Windows Timeline.
Once the latest Windows Insider Preview build is installed, developers can get started on adding UserActivities to their app. UserActivities are the unit of user engagement in Windows 10 and they consist of three important parts, an activation deep-link, visuals, and content metadata. Microsoft provides a comprehensive explanation of these parts here:
- Activation Deep-Link is a URI that can be passed back to an application or experience in order to resume the application with specific context. Typically, these links take the form of protocol handler for a scheme (e.g. “my-app://page2?action=edit”) or an AppUriHandlers (e.g. http://constoso.com/page2?action=edit).
- Visuals are a set of properties that allow users to visually identify an activity, for example: title, description, or Adaptive Card elements.
- Content Metadata is metadata for the content of the of activity that can be used to group and retrieve activities under a specific context. Often, this takes the form of http://schema.org data.
Microsoft further details other UserActivities capabilities that you can add to your app to work with Timeline and Cortana. Microsoft provides more capabilities with further reading and more advanced required code.