rahulroy9202
rahulroy9202

Reputation: 2848

Open a Facebook link on Windows Phone

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

Answers (2)

Mateusz Rogulski
Mateusz Rogulski

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

Pradeep Kesharwani
Pradeep Kesharwani

Reputation: 1478

Use this uri to launch your facebook application:

await Windows.System.Launcher.LaunchUriAsync(new Uri("fb:post?text=foo"));

Upvotes: 1

Related Questions