如何打开 Facebook 应用程序以在 WP8 上共享链接? [英] How can I open the Facebook App for sharing a link on WP8?

查看:39
本文介绍了如何打开 Facebook 应用程序以在 WP8 上共享链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在 Windows Phone 上打开官方 Facebook 应用程序以共享来自我的 C# 代码的 URI.像 "fb://" 这样的常见 Uri-Scheme 可能会打开应用程序,但似乎没有参数起作用.我有这样的想法,但它对我不起作用:

I wonder how to open the official Facebook App for sharing an URI from my C# code on Windows Phone. The common Uri-Scheme like "fb://" may open the App but no parameter seems to work. I have something like this in mind, but it will not work for me:

LaunchUriAsync(new Uri("fb://publish/profile/me?text=foo"));

当然我知道我可以使用 ShareTask 但这不是我想要的.你可以看看 Spotfy 应用程序,它在分享歌曲时完全符合我的要求.

Of course I know that I could use the ShareTask but that's not what I want. You can take a look at the Spotfy App, it does exactly, what I want to do, when sharing a song.

感谢您的帮助和解答!

PS:顺便说一下,和 Twitter 一样......

PS: Same with Twitter by the way...

推荐答案

我终于解决了!我花了将近两天的时间才找到解决方案,并且没有在任何地方记录,所以我想与您分享我的结果:

I finally solved it! It took me nearly two days to find the solution and it is not documented anywhere sothat I would like to share my results with you:

// Open official Facebook app for sharing
await Windows.System.Launcher.LaunchUriAsync(new Uri("fb:post?text=foo"));

我认为这是一个非常酷的功能,提醒用户它在其他平台上的工作方式.

I think this is a very cool feature and reminds users of how it works on other plarforms.

总而言之,通过 URI 方案从您的应用启动其他应用始终是具有良好用户体验的绝佳方案.

In conclusion launching other apps from your app via URI schemes is always a great scenario with a nice user experience.

提示:通过 URI 方案打开官方 Facebook 应用程序至少需要 4.1 版本!

这篇关于如何打开 Facebook 应用程序以在 WP8 上共享链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆