Launch the facebook application from my application and make it an open profile that is not mine

I am working on an application where I need to put a button that redirects users to a specific facebook page. Typically, clicking on this button should open the profile in the facebook application or in the navigator if facebook is not installed. Plus, I would like to do the same with the twitter page.

I would like to know how to do this.

Thanks so much for your time.

+5
source share
4 answers

URL. Facbook fb://, , fb://profile/zuck, Mobile Safari Facebook . Facebook , - .

, URL, .

::

Twitter, Twitter, twitter:// tweetbot://, https://twitter.com/#!/<# User Name #>

+5

@SkylarSch, Facebook, Mobile Safari:

NSURL *fbNativeAppURL = [NSURL URLWithString:@"fb://page/yourPageIDHere"];

// Check to make sure URL can be opened on device (whether the user has the Facebook app installed)
if ( [[UIApplication sharedApplication] canOpenURL:fbNativeAppURL])
{
    [[UIApplication sharedApplication] openURL:fbNativeAppURL];
}
// Otherwise, just open it in the browser
{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com/yourPageIDHere"]];
}
+4

, Facebook . , Facebook : URL https://www.facebook.com/pageName : http://findmyfacebookid.com URL-, Facebook, url @ "fb://profile/profileID"

!

+4

{edit} , {/edit}

iPhone iPhone URL fb://. , , , fb://profile/{page or profile id} iphone ( ).

I found that to this question , which has been accurate since version 3.4 (it is currently 4.0, but I think most of them are still valid)

+1
source

All Articles