如何从Xamarin中的iOS应用程序打开Facebook/Twitter应用程序?

如何从Xamarin中的iOS应用程序打开Facebook/Twitter应用程序?

问题描述:

我正在用C#开发Xamarin的iOS应用.

I'm developing an iOS app with Xamarin, in C#.

我有一个联系人" UIViewController,带有一些按钮,包括Facebook和Twitter.

I have a "contact" UIViewController, with some buttons, including Facebook and Twitter.

我需要使用应用程序中的特定Facebook页面和Twitter个人资料打开Facebook和Twitter应用程序.

I need to open the Facebook and Twitter App with a specific Facebook Page and Twitter profile from my app.

做到这一点的最佳方法是什么?

What is the best way to do this?

尝试一下:

Device.OpenUri(new Uri("fb://page/page_id"));
Device.OpenUri(new Uri("twitter://user?user_id=userid"));

对于page_id,右键单击页面并选择查看源页面,然后找到Facebook的page_id,与Twitter的相同,找到userid

For page_id right click on page and select view source page and find the page_id for facebook and same as for twitter find the userid