I'm creating a app
, and I wanted to insert a button to open a conversation on a particular facebook page, but by the messenger application and not by the browser, / p>
I'm creating a app
, and I wanted to insert a button to open a conversation on a particular facebook page, but by the messenger application and not by the browser, / p>
Open a conversation on a page you mean a post, right?
You can try this:
NSURL *url = [NSURL URLWithString:@"fb://post/<id_do_post>"];
[[UIApplication sharedApplication] openURL:url];
Now if you are talking about opening the fanpage or profile of someone just change the beginning of URL
, example:
NSURL *url = [NSURL URLWithString:@"fb://profile/<id_da_page_ou_perfil>"];
[[UIApplication sharedApplication] openURL:url];
More options you can see here:
To open a particular thread in Facebook Messenger simply use the URL Scheme fb-messenger://user/{user-id}
. The parameter user-id
is a long integer as can be seen in link .
More information this OS response.
Please note that from iOS 9 the Messenger Scheme URL ( fb-messenger
) needs to be placed on your whitelist.
I also recommend that you check with canOpenURL:
first and make a fallback if the user does not have the messenger installed.