Aleff
Aleff

Reputation: 257

LaunchUriAsync() doesn't launch Windows Store App

I'm trying call my application on OnShareTargetActivated() method by LaunchUriAsync() but it doesn't work.

I have a protocol called "myapp" in appmanifest. When I put "myapp://test" on File Explorer, my application is launched, but when I do it:

protected async override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
{
   Uri uri = new Uri("myapp://test");
   await Windows.System.Launcher.LaunchUriAsync(uri);
}

This occurs when the user clicks on my application that is on Charm Bar in Share option. But the application is never launched.

Upvotes: 2

Views: 2591

Answers (1)

Eldho
Eldho

Reputation: 8263

sharing app sample (http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Target-App-e2689782)

You should check the format , of what you are sharing , metro will only accept some type of content to share , Sharing format are Text,uri,Bitmap,storageitems,Html

share target code and pictures (http://blogs.msdn.com/b/going_metro/archive/2012/05/03/integrating-with-windows-8-share-charm-part-1-receiving-data.aspx)

if u find useful , pls acccept as answer

Upvotes: 1

Related Questions