Reputation: 2848
If the native Facebook app is installed on the WindowsPhone. How do I open a Facebook link into the native Facebook app from my app.
example link:
https://www.facebook.com/notifications
If native app is not installed, i wish to launch browser.
Upvotes: 0
Views: 532
Reputation: 7445
You can launch Facebook app using:
var success = await Windows.System.Launcher.LaunchUriAsync(new Uri("fb:XX")); // where XX is facebook id
if(!success) { // in case of fail
WebBrowserTask wbtask = new WebBrowserTask();
wbtask.Url = "yourUrlHere";
wbtask.Show();
}
You can read more about LauncheUriAsync here
Upvotes: 1
Reputation: 1478
Use this uri to launch your facebook application:
await Windows.System.Launcher.LaunchUriAsync(new Uri("fb:post?text=foo"));
Upvotes: 1