如何从Xamarin中的iOS应用程序打开Facebook/Twitter应用程序? [英] How to open Facebook / Twitter app from my iOS app in Xamarin?

查看:191
本文介绍了如何从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

这篇关于如何从Xamarin中的iOS应用程序打开Facebook/Twitter应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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