Developers can build the best experience for consumers by ensuring that the switch from the site to the app is contextual. For example, in the above video, when the user switches to the app while reading a review of a phone on the Web site, the app automatically navigates the user to the phone review within the app. This provides users with a continuous experience from the site to the app.
msApplication-Arguments enables this. The content string of this meta tag is passed to the app as an argument string. The app parses this parameter and navigates users to the relevant in-app content.
The following code fragment shows how to handle this parameter in a Metro style app written in HTML/JavaScript:
This fragment could be used in a Metro style app written in XAML/C#
msApplication-Arguments enables this. The content string of this meta tag is passed to the app as an argument string. The app parses this parameter and navigates users to the relevant in-app content.
The following code fragment shows how to handle this parameter in a Metro style app written in HTML/JavaScript:
// Function available in default.js file in Visual Studio Express 11 templates provided in Developer Preview Build
WinJS.Application.onmainwindowactivated = function (e) {
if (e.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
// Insert this code to handle incoming argument when Metro style Internet Explorer launches the app
if (e.detail.arguments) {
// Parse the value of the msApplication-Arguments string
// Direct incoming user to relevant in-app content
}
}
}
// Function available in App.xaml.js file in Visual C# templates provided in Developer Preview Build Visual Studio Express 11
partial class App
{
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
// Insert this to handle incoming arguments, when Metro Style Internet Explorer launches the app
if (!String.IsNullOrEmpty(args.Arguments))
{
// Parse the value of the msApplication-Arguments string
// Direct incoming user to relevant in-app content
}
}
}