App to App Communication

URI/Protocol Activation (8.1)

  • Launcher.LaunchUriAsync(new Uri(„sampleapp:?=ID=123“));
  • Launcher.LaunchUriAsync(file);

Share Contract (8.1)

  • DataTransferManager.ShowShareUI;

URI Activation (10)

Invoke a specific App

var options = new LauncherOptions();
options.TargetApplicationPackageFamilyName = "24919.InstapaperIt";
var lauchUri = new Uri("instapaper:?AddUrl=http%3A%2F%2Fbing.com");
await Launcher.LaunchUriAsync(launchUri, options);

Send Files

var options = new LauncherOptions();
options.TargetApplicationPackageFamilyName = "24919.InstapaperIt";
var token = SharedStorageAccessManager.AddFIle(file);
ValueSet inputData = new ValueSet();
inputData.Add("Token", token):
var lauchUri = new Uri("instapaper:?AddUrl=http%3A%2F%2Fbing.com");
await Launcher.LaunchUriAsync(launchUri, options, inputData);

Query URI Support

Discover if App already installed to handle a Uri

var queryUri = new Uri("instapaper:");
await Launcher.QueryUriSupportAsync(queryUri, LaunchUriType.LaunchUri);

With Package Family Name

var queryUri = new Uri("instapaper:");
string packageFamilyName = "24919.InstapaperIt"
await Launcher.QueryUriSupportAsync(queryUri, LaunchUriType.LaunchUriForResults, packageFamilyName);

Launch for Results

Launching the App

var options = new LauncherOptions();
options.TargetApplicationPackageFamilyName = "24919.InstapaperIt";
await Launcher.QueryUriSupportAsync(queryUri, LaunchUriType.LaunchUriForResults, packageFamilyName);
var lauchUri = new Uri("instapaper:?AddUrl=http%3A%2F%2Fbing.com");
ValueSet inputData = new ValueSet();
inputData.Add("Token", token):
await Launcher.LaunchUriForResultAsync(launchUri, options, inputData);
var resultData = New ValueSet();
resultData.Add("Result", value);
operation.ProtocolForResultsOperation.ReportComleted(resultData);
  • On Phone: App will be suspended.