Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Facebook / Twitter app from my iOS app in Xamarin?

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

I have a "contact" UIViewController, with some buttons, including Facebook and 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?

like image 670
pasluc74669 Avatar asked Jul 19 '16 10:07

pasluc74669


People also ask

How do I distribute xamarin iOS app?

Select the App Store distribution channel. Select your signing identity and provisioning profile. Click Upload to Store. Enter your Apple ID and an app-specific password.

Can xamarin be used for iOS?

Xamarin. iOS allows developers to create native iOS applications using the same UI controls that are available in Objective-C and Xcode, except with the flexibility and elegance of a modern language (C#), the power of the .


1 Answers

Try this :

Device.OpenUri(new Uri("fb://page/page_id"));
Device.OpenUri(new Uri("twitter://user?user_id=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

like image 174
Himanshu Dwivedi Avatar answered Oct 05 '22 03:10

Himanshu Dwivedi